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

Don't set terraform user_data if it is empty #8744

Merged
merged 2 commits into from
Mar 31, 2020

Conversation

rifelpet
Copy link
Member

Bastion hosts have no user_data by default. This is not valid in terraform, evidenced by the error messages reported here.

The Terraform provider code says user_data is optional for both LaunchConfigurations and LaunchTemplates.

This change prevents the user_data property from being added to aws_launch_configuration and aws_launch_template resources if the string is empty.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 14, 2020
@rifelpet rifelpet changed the title Don't set terraform's user_data if it is an empty string Don't set terraform user_data if it is empty Mar 14, 2020
@k8s-ci-robot k8s-ci-robot added the area/provider/aws Issues or PRs related to aws provider label Mar 14, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rifelpet

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 14, 2020
@rifelpet
Copy link
Member Author

Ugh integration tests failing because we shouldnt expect a bastion user_data file unless the additionalUserData isnt empty. adding support for that in the integration tests will be a significant change which would conflict with #8737 so i'm inclined to wait for that to get merged which might be a while.

@rifelpet rifelpet mentioned this pull request Mar 15, 2020
@rifelpet
Copy link
Member Author

/hold for #8737 and some rebase work ill do afterwards

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 27, 2020
Bastion hosts have no user_data by default.
This is not valid in terraform, based on the error messages reported here [0]

The Terraform provider code says user_data is optional for both LaunchConfigurations and LaunchTemplates [1] [2]

This change prevents the user_data property from being added to aws_launch_configuration and aws_launch_template resources unless the string is not empty.

[0] https://travis-ci.org/github/kubernetes/kops/jobs/662472020
[1] https://github.com/terraform-providers/terraform-provider-aws/blob/04d24f80f3b740d0c9d74d97e818b7da15cb96c5/aws/resource_aws_launch_configuration.go#L74-L76
[2] https://github.com/terraform-providers/terraform-provider-aws/blob/04d24f80f3b740d0c9d74d97e818b7da15cb96c5/aws/resource_aws_launch_template.go#L510-L512
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 31, 2020
@hakman
Copy link
Member

hakman commented Mar 31, 2020

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 31, 2020
@rifelpet
Copy link
Member Author

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 31, 2020
@k8s-ci-robot k8s-ci-robot merged commit 73d4d1c into kubernetes:master Mar 31, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.18 milestone Mar 31, 2020
@rifelpet rifelpet deleted the tf-bastion-userdata branch August 6, 2020 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/provider/aws Issues or PRs related to aws provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants