-
Notifications
You must be signed in to change notification settings - Fork 988
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
[TK-1957] Update container.resources
schema for Pod, DaemonSet and Deployment
#1889
Conversation
container.resources
schema for Pod, DaemonSet and Deploymentcontainer.resources
schema for Pod, DaemonSet and Deployment
f499226
to
24bb7d9
Compare
@@ -348,15 +348,11 @@ func flattenContainerPorts(in []v1.ContainerPort) []interface{} { | |||
return att | |||
} | |||
|
|||
func flattenContainerResourceRequirements(in v1.ResourceRequirements) ([]interface{}, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the error
return from this function since we never return any errors, just nil
.
if len(in.Requests) > 0 { | ||
att["requests"] = flattenResourceList(in.Requests) | ||
} | ||
return []interface{}{att}, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove length validation here and accept an empty map from flattenResourceList
to store empty values instead of null
in the Terraform state file.
f0ac63e
to
ddc8450
Compare
You can also skip this and just allow Terraform to destroy and recreate the resource, but this is not recommended for resources like `kubernetes_service` and `kubernetes_deployment`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what exactly has changed here, this is the result of 'make website-lint-fix'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just trailing whitespace being remove
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
1 similar comment
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Description
This PR does the following changes:
spec.container.resources.limits
orspec.container.resources.requests
produce continuous diff output duringplan
although no real changes were made. Affected resources:kubernetes_pod
,kubernetes_pod_v1
,kubernetes_daemonset
,kubernetes_daemon_set_v1
,kubernetes_deployment
,kubernetes_deployment_v1
.spec.container.resources.limits
orspec.container.resources.requests
does not update appropriate Kubernetes resources. Affected resources:kubernetes_pod
,kubernetes_pod_v1
.spec.container.resources.limits
orspec.container.resources.requests
will force resource recreation. Affected resources:kubernetes_pod
,kubernetes_pod_v1
.Related documentation changes are in the different PR: #1882
Acceptance tests
Output from acceptance testing:
Release Note
Release note for CHANGELOG:
References
Fix: #1880
Community Note