Skip to content

Commit

Permalink
chore: added test covering alekc#46
Browse files Browse the repository at this point in the history
  • Loading branch information
alekc authored and dfroberg committed Feb 16, 2024
1 parent a4d4f26 commit 692bba7
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 @@ -90,8 +90,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 692bba7

Please sign in to comment.