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

Fix updates of stateful set images #252

Merged
merged 2 commits into from
Dec 12, 2018

Conversation

pdecat
Copy link
Contributor

@pdecat pdecat commented Dec 10, 2018

Images used for container in Stateful Set templates cannot be updated.

TODO:

  • add acceptance test
  • fix issue

Acceptance test result without fix:

# make testacc TEST=./kubernetes TESTARGS='-run=TestAccKubernetesStatefulSet_update_image -count=1'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./kubernetes -v -run=TestAccKubernetesStatefulSet_update_image -count=1 -timeout 120m
=== RUN   TestAccKubernetesStatefulSet_update_image
--- FAIL: TestAccKubernetesStatefulSet_update_image (3.01s)
        testing.go:518: Step 1 error: Check failed: 1 error(s) occurred:

                * Check 2/2 error: kubernetes_stateful_set.test: Attribute 'spec.0.template.0.spec.0.container.0.image' expected "k8s.gcr.io/liveness:latest", got "k8s.gcr.io/pause:latest"
FAIL
FAIL    github.com/terraform-providers/terraform-provider-kubernetes/kubernetes 3.059s
make: *** [GNUmakefile:17: testacc] Error 1

@ghost ghost added the size/M label Dec 10, 2018
@pdecat pdecat force-pushed the fix-statefulset-update-image branch from bdc281d to 761d3b4 Compare December 11, 2018 07:08
@ghost ghost added size/L and removed size/M labels Dec 11, 2018
@pdecat pdecat changed the title [WIP] Fix updates of stateful set images Fix updates of stateful set images Dec 11, 2018
@pdecat
Copy link
Contributor Author

pdecat commented Dec 11, 2018

Acceptance test results with fix:

# make testacc TEST=./kubernetes TESTARGS='-run=TestAccKubernetes\(StatefulSet\).* -count=1'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./kubernetes -v -run=TestAccKubernetes\(StatefulSet\).* -count=1 -timeout 120m
=== RUN   TestAccKubernetesStatefulSet_basic
--- PASS: TestAccKubernetesStatefulSet_basic (1.81s)
=== RUN   TestAccKubernetesStatefulSet_basic_idempotency
--- PASS: TestAccKubernetesStatefulSet_basic_idempotency (1.94s)
=== RUN   TestAccKubernetesStatefulSet_update_image
--- PASS: TestAccKubernetesStatefulSet_update_image (2.88s)
=== RUN   TestAccKubernetesStatefulSet_update_template_selector_labels
--- PASS: TestAccKubernetesStatefulSet_update_template_selector_labels (2.64s)
=== RUN   TestAccKubernetesStatefulSet_update_replicas
--- PASS: TestAccKubernetesStatefulSet_update_replicas (2.40s)
=== RUN   TestAccKubernetesStatefulSet_update_rolling_update_partition
--- PASS: TestAccKubernetesStatefulSet_update_rolling_update_partition (2.40s)
=== RUN   TestAccKubernetesStatefulSet_update_update_strategy_on_delete
--- PASS: TestAccKubernetesStatefulSet_update_update_strategy_on_delete (2.35s)
=== RUN   TestAccKubernetesStatefulSet_update_update_strategy_rolling_update
--- PASS: TestAccKubernetesStatefulSet_update_update_strategy_rolling_update (2.35s)
=== RUN   TestAccKubernetesStatefulSet_update_pod_template_container_port
--- PASS: TestAccKubernetesStatefulSet_update_pod_template_container_port (2.59s)
PASS
ok      github.com/terraform-providers/terraform-provider-kubernetes/kubernetes 21.400s

@pdecat
Copy link
Contributor Author

pdecat commented Dec 11, 2018

Copy link
Member

@alexsomesan alexsomesan left a comment

Choose a reason for hiding this comment

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

Change looks great! Thanks for catching this and adding the safeguard test.
Please remove the test.yaml that accidentally got picked up by git and then we can merge.

test.yml Outdated Show resolved Hide resolved
@pdecat pdecat force-pushed the fix-statefulset-update-image branch from 1a37e8c to 2c6a586 Compare December 12, 2018 20:11
@ghost ghost added size/M and removed size/L labels Dec 12, 2018
@alexsomesan alexsomesan merged commit 7761ba0 into hashicorp:master Dec 12, 2018
@pdecat pdecat deleted the fix-statefulset-update-image branch December 12, 2018 20:37
pdecat added a commit to pdecat/terraform-provider-kubernetes that referenced this pull request Dec 13, 2018
alexsomesan pushed a commit that referenced this pull request Jan 7, 2019
* Update changelog for #249

* Update changelog for #252
@ghost ghost locked and limited conversation to collaborators Apr 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants