Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a YAML Renderer to create ConfigMap SLS #2070

Closed
ChengYanJin opened this issue Nov 24, 2019 · 1 comment
Closed

Use a YAML Renderer to create ConfigMap SLS #2070

ChengYanJin opened this issue Nov 24, 2019 · 1 comment
Assignees
Labels
kind:debt Technical debt topic:build Anything related to building steps

Comments

@ChengYanJin
Copy link
Contributor

Both of salt_embed_text and salt_embed_bytes could rely on yaml.dump (see 1ada06c for an example of how to customize representers).

Originally posted by @gdemonet in #2062

@ChengYanJin ChengYanJin added kind:debt Technical debt moonshot topic:build Anything related to building steps labels Nov 24, 2019
slaperche-scality added a commit that referenced this issue Dec 10, 2019
We will need it to implement a YAML renderer.

Refs: #2070
Signed-off-by: Sylvain Laperche <[email protected]>
slaperche-scality added a commit that referenced this issue Dec 10, 2019
Add a new serialization format: YAML.

This can be used as base for an SLS serializer.

In order to handle long string payload and binary content we add two
helpers (`YAMLDocument.text` and `YAMLDocument.bytestring`) that use
custom renderers in order to have a readable encoding (using `|` string
block literal) and right encoding (use Base64 for binary contents).

Refs: #2070
Signed-off-by: Sylvain Laperche <[email protected]>
slaperche-scality added a commit that referenced this issue Dec 10, 2019
PyYAML has type annotations provided by typeshed, but those are
incomplete.

The long term solution would be to improve the type annotations in
typeshed, but for now we will selectively ignore the errors.

Note that we can't simply ignore the whole YAML library (like we do for
`docker` or `doit`) because it *has* type annotations.
Trying to do so results in a mypy warning:

    note: unused 'type: ignore' comment

Refs: #2070
Signed-off-by: Sylvain Laperche <[email protected]>
slaperche-scality added a commit that referenced this issue Dec 10, 2019
For now we define a SLS as a YAML file with optional shebang and list of
imports.

Since both YAML and SLS renderer uses YAML dump, we extract it into an
helper.

Refs: #2070
Signed-off-by: Sylvain Laperche <[email protected]>
slaperche-scality added a commit that referenced this issue Dec 10, 2019
TODO

Closes: #2070
Signed-off-by: Sylvain Laperche <[email protected]>
@slaperche-scality slaperche-scality self-assigned this Dec 10, 2019
slaperche-scality added a commit that referenced this issue Dec 10, 2019
Use the brand new SaltState serializer to generate the Dex ConfigMap.
Get rid of the now useless helper that were used to manually generate
YAML-encoded strings.

Closes: #2070
Signed-off-by: Sylvain Laperche <[email protected]>
slaperche-scality added a commit that referenced this issue Dec 16, 2019
We will need it to implement a YAML renderer.

Refs: #2070
Signed-off-by: Sylvain Laperche <[email protected]>
slaperche-scality added a commit that referenced this issue Dec 16, 2019
Add a new serialization format: YAML.

This can be used as base for an SLS serializer.

In order to handle long string payload and binary content we add two
helpers (`YAMLDocument.text` and `YAMLDocument.bytestring`) that use
custom renderers in order to have a readable encoding (using `|` string
block literal) and right encoding (use Base64 for binary contents).

Refs: #2070
Signed-off-by: Sylvain Laperche <[email protected]>
slaperche-scality added a commit that referenced this issue Dec 16, 2019
PyYAML has type annotations provided by typeshed, but those are
incomplete.

The long term solution would be to improve the type annotations in
typeshed, but for now we will selectively ignore the errors.

Note that we can't simply ignore the whole YAML library (like we do for
`docker` or `doit`) because it *has* type annotations.
Trying to do so results in a mypy warning:

    note: unused 'type: ignore' comment

Refs: #2070
Signed-off-by: Sylvain Laperche <[email protected]>
slaperche-scality added a commit that referenced this issue Dec 16, 2019
For now we define a SLS as a YAML file with optional shebang and list of
imports.

Since both YAML and SLS renderer uses YAML dump, we extract it into an
helper.

Refs: #2070
Signed-off-by: Sylvain Laperche <[email protected]>
slaperche-scality added a commit that referenced this issue Dec 16, 2019
Use the brand new SaltState serializer to generate the Dex ConfigMap.
Get rid of the now useless helper that were used to manually generate
YAML-encoded strings.

Closes: #2070
Signed-off-by: Sylvain Laperche <[email protected]>
slaperche-scality added a commit that referenced this issue Dec 16, 2019
@slaperche-scality
Copy link
Contributor

Solved with #2120

ChengYanJin pushed a commit that referenced this issue Dec 17, 2019
We will need it to implement a YAML renderer.

Refs: #2070
Signed-off-by: Sylvain Laperche <[email protected]>
ChengYanJin pushed a commit that referenced this issue Dec 17, 2019
Add a new serialization format: YAML.

This can be used as base for an SLS serializer.

In order to handle long string payload and binary content we add two
helpers (`YAMLDocument.text` and `YAMLDocument.bytestring`) that use
custom renderers in order to have a readable encoding (using `|` string
block literal) and right encoding (use Base64 for binary contents).

Refs: #2070
Signed-off-by: Sylvain Laperche <[email protected]>
ChengYanJin pushed a commit that referenced this issue Dec 17, 2019
PyYAML has type annotations provided by typeshed, but those are
incomplete.

The long term solution would be to improve the type annotations in
typeshed, but for now we will selectively ignore the errors.

Note that we can't simply ignore the whole YAML library (like we do for
`docker` or `doit`) because it *has* type annotations.
Trying to do so results in a mypy warning:

    note: unused 'type: ignore' comment

Refs: #2070
Signed-off-by: Sylvain Laperche <[email protected]>
ChengYanJin pushed a commit that referenced this issue Dec 17, 2019
For now we define a SLS as a YAML file with optional shebang and list of
imports.

Since both YAML and SLS renderer uses YAML dump, we extract it into an
helper.

Refs: #2070
Signed-off-by: Sylvain Laperche <[email protected]>
ChengYanJin pushed a commit that referenced this issue Dec 17, 2019
Use the brand new SaltState serializer to generate the Dex ConfigMap.
Get rid of the now useless helper that were used to manually generate
YAML-encoded strings.

Closes: #2070
Signed-off-by: Sylvain Laperche <[email protected]>
ChengYanJin pushed a commit that referenced this issue Dec 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:debt Technical debt topic:build Anything related to building steps
Projects
None yet
Development

No branches or pull requests

2 participants