Skip to content

Commit

Permalink
remove kustomizeVersion linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig O'Donnell committed Feb 9, 2024
1 parent 8697a79 commit 21f2d12
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 57 deletions.
35 changes: 0 additions & 35 deletions pkg/kots/lint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ metadata:
name: app-slug
spec:
title: App Name
kustomizeVersion: "3.5.4"
icon: https://github.com/cncf/artwork/blob/master/projects/kubernetes/icon/color/kubernetes-icon-color.png
statusInformers:
- deployment/example-nginx
Expand Down Expand Up @@ -1423,8 +1422,6 @@ spec:
icon: https://support.io/img/logo.png
releaseNotes: These are our release notes
allowRollback: false
kubectlVersion: latest
kustomizeVersion: latest
targetKotsVersion: "1.60.0"
minKotsVersion: "1.40.0"
requireMinimalRBACPrivileges: false
Expand Down Expand Up @@ -4072,7 +4069,6 @@ metadata:
name: app-slug
spec:
title: App Name
kustomizeVersion: "3.5.4"
icon: https://github.com/cncf/artwork/blob/master/projects/kubernetes/icon/color/kubernetes-icon-color.png
statusInformers:
- deployment/example-nginx
Expand Down Expand Up @@ -4129,7 +4125,6 @@ metadata:
name: app-slug
spec:
title: App Name
kustomizeVersion: "latest"
icon: https://github.com/cncf/artwork/blob/master/projects/kubernetes/icon/color/kubernetes-icon-color.png
statusInformers:
- deployment-example-nginx
Expand Down Expand Up @@ -4439,36 +4434,6 @@ spec:
},
expect: []LintExpression{},
},
{
name: "unsupported kustomize version",
specFiles: SpecFiles{
{
Name: "kots-app.yaml",
Path: "kots-app.yaml",
Content: `apiVersion: kots.io/v1beta1
kind: Application
metadata:
name: app-slug
spec:
kustomizeVersion: "2.0.0"`,
},
},
expect: []LintExpression{
{
Rule: "kustomize-version",
Type: "warn",
Path: "kots-app.yaml",
Message: "Unsupported kustomize version, 3.5.4 will be used instead",
Positions: []LintExpressionItemPosition{
{
Start: LintExpressionItemLinePosition{
Line: 6,
},
},
},
},
},
},
{
name: "ignore nonexistent-status-informer-object rule",
specFiles: SpecFiles{
Expand Down
22 changes: 0 additions & 22 deletions pkg/kots/rego/kots-spec-opa-rendered.rego
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@

package kots.spec.rendered

kustomize_versions = {
"",
"latest",
"3.5.4",
}

# Files set with the contents of each file as json
files[output] {
file := input[_]
Expand Down Expand Up @@ -55,22 +49,6 @@ lint[output] {
}
}

# Check if kustomize version is supported
lint[output] {
file := files[_]
file.content.kind == "Application"
file.content.apiVersion == "kots.io/v1beta1"
not kustomize_versions[file.content.spec.kustomizeVersion]
output := {
"rule": "kustomize-version",
"type": "warn",
"message": "Unsupported kustomize version, 3.5.4 will be used instead",
"path": file.path,
"field": "spec.kustomizeVersion",
"docIndex": file.docIndex
}
}

# Check if any "status informer" points to a non-existent object
informer_object_exists(informer) {
is_string(informer)
Expand Down

0 comments on commit 21f2d12

Please sign in to comment.