Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions api/types/kustomization.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@
deprecatedPatchesStrategicMergeMessage = "# Warning: 'patchesStrategicMerge' is deprecated. Please use 'patches' instead." + " " + deprecatedWarningToRunEditFix
deprecatedVarsMessage = "# Warning: 'vars' is deprecated. Please use 'replacements' instead." + " " + deprecatedWarningToRunEditFixExperimential
deprecatedCommonLabelsWarningMessage = "# Warning: 'commonLabels' is deprecated. Please use 'labels' instead." + " " + deprecatedWarningToRunEditFix
deprecationWarningKind = "# Warning: 'kind' field is required in future releases. Please set it explicitly."
deprecationWarningAPIVersion = "# Warning: 'apiVersion' field is required in future releases. Please set it explicitly."
)

// CheckDeprecatedFields check deprecated field is used or not.
Expand Down Expand Up @@ -222,10 +224,13 @@
// moving content of deprecated fields to newer
// fields.
func (k *Kustomization) FixKustomization() {
var warnings []string
if k.Kind == "" {
warnings = append(warnings, deprecationWarningKind)
k.Kind = KustomizationKind
}
if k.APIVersion == "" {
warnings = append(warnings, deprecationWarningAPIVersion)

Check failure on line 233 in api/types/kustomization.go

View workflow job for this annotation

GitHub Actions / Lint

ineffectual assignment to warnings (ineffassign)
if k.Kind == ComponentKind {
k.APIVersion = ComponentVersion
} else {
Expand Down
Loading