Skip to content

Commit

Permalink
chore: added test covering #46
Browse files Browse the repository at this point in the history
  • Loading branch information
alekc committed Sep 19, 2023
1 parent a8eb8d0 commit 62dd5f1
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion kubernetes/resource_kubectl_manifest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,40 @@ YAML
})
}

func TestAccKubectlUnknownNamespace(t *testing.T) {
func TestAccInconsistentPlanning(t *testing.T) {
//See https://github.com/alekc/terraform-provider-kubectl/pull/46
config := `
resource "kubectl_manifest" "secret" {
yaml_body = <<EOF
apiVersion: v1
kind: Secret
metadata:
name: test-secret
stringData:
var: "${formatdate("YYYYMMDDhhmmss", timestamp())}"
EOF
}
`
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckkubectlDestroy,

Steps: []resource.TestStep{
{
Config: config,
ExpectNonEmptyPlan: true, // yaml_incluster is going to be constantly different
},
{
// used to crash out on the second run
Config: config,
ExpectNonEmptyPlan: true,
},
},
})
}

func TestAccKubectlUnknownNamespace(t *testing.T) {
config := `
resource "kubectl_manifest" "test" {
yaml_body = <<EOT
Expand Down

0 comments on commit 62dd5f1

Please sign in to comment.