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 adding labels/annotations to resources or data to config maps/secrets when those were empty #116

Merged
merged 5 commits into from
Mar 1, 2018

Conversation

pdecat
Copy link
Contributor

@pdecat pdecat commented Feb 12, 2018

No description provided.

@pdecat
Copy link
Contributor Author

pdecat commented Feb 12, 2018

Acceptance test failure

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

                * kubernetes_namespace.test: 1 error(s) occurred:

                * kubernetes_namespace.test: jsonpatch add operation does not apply: doc is missing path: /metadata/labels/TestLabelTwo
FAIL
exit status 1
FAIL    github.com/terraform-providers/terraform-provider-kubernetes/kubernetes 6.424s
GNUmakefile:15: recipe for target 'testacc' failed
make: *** [testacc] Error 1

@pdecat pdecat changed the title [WIP] Fix adding labels to a resource that didn't have any [WIP] Fix adding labels and annotations to a resource that didn't have any Feb 12, 2018
@pdecat pdecat changed the title [WIP] Fix adding labels and annotations to a resource that didn't have any Fix adding labels and annotations to a resource that didn't have any Feb 12, 2018
@pdecat
Copy link
Contributor Author

pdecat commented Feb 12, 2018

Unit tests result

# make test TEST=./kubernetes
==> Checking that code complies with gofmt requirements...
go test -i ./kubernetes || exit 1
echo ./kubernetes | \
        xargs -t -n4 go test  -timeout=30s -parallel=4
go test -timeout=30s -parallel=4 ./kubernetes 
ok      github.com/terraform-providers/terraform-provider-kubernetes/kubernetes 0.089s

Acceptance tests result for namespace

# make testacc TEST=./kubernetes TESTARGS='-run=TestAccKubernetesNamespace_.*'                                                    
==> Checking that code complies with gofmt requirements...        
TF_ACC=1 go test ./kubernetes -v -run=TestAccKubernetesNamespace_.* -timeout 120m                                                   
=== RUN   TestAccKubernetesNamespace_basic                        
--- PASS: TestAccKubernetesNamespace_basic (6.59s)                
=== RUN   TestAccKubernetesNamespace_importBasic                  
--- PASS: TestAccKubernetesNamespace_importBasic (6.35s)          
=== RUN   TestAccKubernetesNamespace_generatedName                                                                                  
--- PASS: TestAccKubernetesNamespace_generatedName (6.33s)        
=== RUN   TestAccKubernetesNamespace_withSpecialCharacters                                                                          
--- PASS: TestAccKubernetesNamespace_withSpecialCharacters (6.33s)                                                                                                                                                                                                       
=== RUN   TestAccKubernetesNamespace_importGeneratedName                                                                                                                                                                                                                 --- PASS: TestAccKubernetesNamespace_importGeneratedName (6.37s)                                                                                                                                                                                                         
PASS                                                                                                                                
ok      github.com/terraform-providers/terraform-provider-kubernetes/kubernetes 32.054s                                             

@pdecat pdecat changed the title Fix adding labels and annotations to a resource that didn't have any Fix adding labels/annotations to resources or data to config maps when those were empty Feb 12, 2018
@pdecat
Copy link
Contributor Author

pdecat commented Feb 12, 2018

Acceptance tests result for config map:

# make testacc TEST=./kubernetes TESTARGS='-run=TestAccKubernetesConfigMap_.*' 
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./kubernetes -v -run=TestAccKubernetesConfigMap_.* -timeout 120m
=== RUN   TestAccKubernetesConfigMap_basic
--- PASS: TestAccKubernetesConfigMap_basic (0.35s)
=== RUN   TestAccKubernetesConfigMap_importBasic
--- PASS: TestAccKubernetesConfigMap_importBasic (0.13s)
=== RUN   TestAccKubernetesConfigMap_generatedName
--- PASS: TestAccKubernetesConfigMap_generatedName (0.10s)
=== RUN   TestAccKubernetesConfigMap_importGeneratedName
--- PASS: TestAccKubernetesConfigMap_importGeneratedName (0.11s)
PASS
ok      github.com/terraform-providers/terraform-provider-kubernetes/kubernetes 0.759s

@pdecat
Copy link
Contributor Author

pdecat commented Feb 12, 2018

Acceptance tests result for secret:

#  make testacc TEST=./kubernetes TESTARGS='-run=TestAccKubernetesSecret_.*'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./kubernetes -v -run=TestAccKubernetesSecret_.* -timeout 120m
=== RUN   TestAccKubernetesSecret_basic
--- PASS: TestAccKubernetesSecret_basic (0.38s)
=== RUN   TestAccKubernetesSecret_importBasic
--- PASS: TestAccKubernetesSecret_importBasic (0.10s)
=== RUN   TestAccKubernetesSecret_generatedName
--- PASS: TestAccKubernetesSecret_generatedName (0.08s)
=== RUN   TestAccKubernetesSecret_importGeneratedName
--- PASS: TestAccKubernetesSecret_importGeneratedName (0.10s)
PASS
ok      github.com/terraform-providers/terraform-provider-kubernetes/kubernetes 0.757s

@pdecat pdecat changed the title Fix adding labels/annotations to resources or data to config maps when those were empty Fix adding labels/annotations to resources or data to config maps/secrets when those were empty Feb 12, 2018
@radeksimko radeksimko added the bug label Feb 22, 2018
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 all attached tests @pdecat
This looks great.

Shipping... 🚢

@radeksimko radeksimko merged commit c73f7f9 into hashicorp:master Mar 1, 2018
@pdecat
Copy link
Contributor Author

pdecat commented Mar 1, 2018

Thanks!

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