-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(kubernetes): do not fail to deploy List kinds (e.g. ConfigMapList) (
#4501) * fix(kubernetes): do not fail to deploy List kinds (e.g. configMapList) Fixes #4500 Co-authored-by: Srihas Konduru <[email protected]> * improvement: slightly increase defensiveness Maybe the List is actually a CRD? Seems to be unlikely as other tools like Kustomize also treat kinds matching `*List` as lists. But add a better error message here if items contains something unexpected just in case. This logic is more or less equivalent to https://github.com/kubernetes-sigs/kustomize/blob/cf3e81b590ab1fd7fc8f50849535f44bfea0d355/api/resource/factory.go#L550 --------- Co-authored-by: Srihas Konduru <[email protected]>
- Loading branch information
Showing
4 changed files
with
58 additions
and
2 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
6 changes: 6 additions & 0 deletions
6
core/test/data/test-projects/kubernetes-module/config-map-list/garden.yml
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,6 @@ | ||
kind: "Deploy" | ||
type: "kubernetes" | ||
name: "config-map-list" | ||
spec: | ||
files: | ||
- manifests.yaml |
21 changes: 21 additions & 0 deletions
21
core/test/data/test-projects/kubernetes-module/config-map-list/manifests.yaml
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,21 @@ | ||
apiVersion: v1 | ||
items: | ||
- apiVersion: v1 | ||
data: | ||
foo.json: test | ||
kind: ConfigMap | ||
metadata: | ||
name: foo | ||
- apiVersion: v1 | ||
data: | ||
bar.json: test | ||
kind: ConfigMap | ||
metadata: | ||
name: bar | ||
- apiVersion: v1 | ||
data: | ||
baz.json: test | ||
kind: ConfigMap | ||
metadata: | ||
name: baz | ||
kind: ConfigMapList |
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