-
Notifications
You must be signed in to change notification settings - Fork 975
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
manifest: remove forced replacement with `x-kubernetes-preserve-unkno…
…wn-fields` (#2437) * Do not force replacement on type changes caused by CRD attributes with `x-kubernetes-preserve-unknown-fields` * Add warning for when type changes
- Loading branch information
Showing
9 changed files
with
104 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note | ||
`kubernetes_manifest`: add TypeCheck for `x-kubernetes-preserve-unknown-fields` to prevent unnecessary replacement | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
manifest/test/acceptance/testdata/x-kubernetes-preserve-unknown-fields/test-cr-3.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
resource "kubernetes_manifest" "test" { | ||
manifest = { | ||
apiVersion = var.group_version | ||
kind = var.kind | ||
metadata = { | ||
name = var.name | ||
namespace = var.namespace | ||
} | ||
spec = { | ||
count = 100 | ||
resources = { | ||
foo = ["bar"] | ||
baz = "42" | ||
} | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
manifest/test/acceptance/testdata/x-kubernetes-preserve-unknown-fields/test-cr-4.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
resource "kubernetes_manifest" "test" { | ||
manifest = { | ||
apiVersion = var.group_version | ||
kind = var.kind | ||
metadata = { | ||
name = var.name | ||
namespace = var.namespace | ||
} | ||
spec = { | ||
count = 100 | ||
resources = false | ||
} | ||
} | ||
} |