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

generators: Use new cloud-init config keys #580

Merged
merged 1 commit into from
Nov 15, 2021

Conversation

monstermunchkin
Copy link
Member

@monstermunchkin monstermunchkin commented Nov 11, 2021

This uses and prefers the new cloud-init config keys (cloud-init.network-config, cloud-init.user-data, and cloud-init.vendor-data) for any cloud-init configuration. The old config keys (user.network-config, user.user-data, and user.vendor-data) are still available and will not be removed. They will serve a fallback keys if the new keys aren't used.

Signed-off-by: Thomas Hipp thomas.hipp@canonical.com

generators/cloud-init.go Outdated Show resolved Hide resolved
Comment on lines 123 to 127
content = `{%- if config_get("cloud-init.user-data", properties.default) == properties.default -%}
{{ config_get("user.user-data", properties.default) }}
{%- else -%}
{{- config_get("cloud-init.user-data", properties.default) }}
{%- endif -%}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of this should be vendor-data, not user-data, no?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Comment on lines 118 to 122
`{%- if config_get("cloud-init.user-data", properties.default) == properties.default -%}
{{ config_get("user.user-data", properties.default) }}
{%- else -%}
{{- config_get("cloud-init.user-data", properties.default) }}
{%- endif -%}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, all of this is supposed to be vendor-data, not user-data.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

{{ config_get("user.network-config", "") }}
{%- else -%}
{{- config_get("cloud-init.network-config", "") }}
{%- endif -%}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's going on here, where is our default network config going?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. I moved that to properties["default"] but had forgotten to include it. Fixed now.

Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
@stgraber stgraber merged commit 332f133 into lxc:master Nov 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants