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 mode conversion with config_map volume items #83

Merged
merged 2 commits into from
Oct 29, 2017

Conversation

pdecat
Copy link
Contributor

@pdecat pdecat commented Oct 26, 2017

I added a test case that reveals an issue with config_map volume items mode:

make testacc TEST=./kubernetes/ TESTARGS='-run=TestAccKubernetesPod_with_cfg_map_volume_mount'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./kubernetes/ -v -run=TestAccKubernetesPod_with_cfg_map_volume_mount -timeout 120m
=== RUN   TestAccKubernetesPod_with_cfg_map_volume_mount
--- FAIL: TestAccKubernetesPod_with_cfg_map_volume_mount (3.17s)testing.go:449: Step 0 error: Error applying: 1 error(s) occurred:
                * kubernetes_pod.test: 1 error(s) occurred:

                * kubernetes_pod.test: spec.0.volume.1.config_map.0.items.0.mode: '' expected type 'int', got unconvertible type '*int32'
        testing.go:509: Error destroying resource! WARNING: Dangling resources
                may exist. The full state and error is shown below.

                Error: Error refreshing: 1 error(s) occurred:
* kubernetes_pod.test: 1 error(s) occurred:

                * kubernetes_pod.test: kubernetes_pod.test: spec.0.volume.1.config_map.0.items.0.mode: '' expected type 'int', got unconvertible type '*int32'

                State: <nil>
FAIL
exit status 1
FAIL    github.com/terraform-providers/terraform-provider-kubernetes/kubernetes 3.330s
GNUmakefile:15: recipe for target 'testacc' failed
make: *** [testacc] Error 1

@pdecat
Copy link
Contributor Author

pdecat commented Oct 26, 2017

Test results with the fix

# make testacc TEST=./kubernetes/ TESTARGS='-run=TestAccKubernetes
Pod_with_cfg_map_volume_mount'                
==> Checking that code complies with gofmt requirements...                                   
TF_ACC=1 go test ./kubernetes/ -v -run=TestAccKubernetesPod_with_cfg_map_volume_mount -timeout 120m                                                                                       
=== RUN   TestAccKubernetesPod_with_cfg_map_volume_mount
--- PASS: TestAccKubernetesPod_with_cfg_map_volume_mount (5.48s)
PASS
ok      github.com/terraform-providers/terraform-provider-kubernetes/kubernetes 5.729s

@pdecat pdecat changed the title [WIP] Fix mode conversion with config_map volume items Fix mode conversion with config_map volume items Oct 26, 2017
@radeksimko radeksimko added the bug label Oct 29, 2017
Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

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

Thanks for the fix and attached test @pdecat 👍
LGTM.

@radeksimko radeksimko merged commit 9f80081 into hashicorp:master Oct 29, 2017
@pdecat pdecat deleted the fix-volume-configmap-items-mode branch February 12, 2018 16:01
@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.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants