-
Notifications
You must be signed in to change notification settings - Fork 904
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: lint supporting rollout in multiple doc (#1176)
- To support use cases where the yaml file may contain deploy, service, etc (generated from helm template) Signed-off-by: Hui Kang <[email protected]>
- Loading branch information
Showing
4 changed files
with
171 additions
and
22 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
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
53 changes: 53 additions & 0 deletions
53
pkg/kubectl-argo-rollouts/cmd/lint/testdata/invalid-multiple-docs.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,53 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: argo-rollouts-metrics | ||
labels: | ||
region: us-west | ||
spec: | ||
ports: | ||
- name: metrics | ||
protocol: TCP | ||
port: 8090 | ||
targetPort: 8090 | ||
--- | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Rollout | ||
metadata: | ||
name: invalid-rollout | ||
spec: | ||
revisionHistoryLimit: 1 | ||
replicas: 1 | ||
strategy: | ||
canary: | ||
maxUnavailable: 0 | ||
maxSurge: 0 | ||
analysis: | ||
templates: | ||
- templateName: integrationtests | ||
steps: | ||
- setWeight: 10 | ||
- setWeight: 20 | ||
- setWeight: 40 | ||
- setWeight: 80 | ||
selector: | ||
matchLabels: | ||
app: invalid-rollout | ||
template: | ||
metadata: | ||
labels: | ||
app: invalid-rollout | ||
spec: | ||
containers: | ||
- name: invalid-rollout | ||
image: invalid-rollout:0.0.0 | ||
ports: | ||
- name: http | ||
containerPort: 8080 | ||
protocol: TCP | ||
readinessProbe: | ||
httpGet: | ||
path: /ping | ||
port: 8080 | ||
periodSeconds: 5 |
34 changes: 34 additions & 0 deletions
34
pkg/kubectl-argo-rollouts/cmd/lint/testdata/invalid-unknown-field.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,34 @@ | ||
--- | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Rollout | ||
metadata: | ||
name: invalid-rollout | ||
spec: | ||
replicas: 10 | ||
strategy: | ||
unknown-strategy: | ||
analysis: | ||
templates: | ||
- templateName: integrationtests | ||
steps: | ||
- setWeight: 10 | ||
selector: | ||
matchLabels: | ||
app: invalid-rollout | ||
template: | ||
metadata: | ||
labels: | ||
app: invalid-rollout | ||
spec: | ||
containers: | ||
- name: invalid-rollout | ||
image: valid-rollout:0.0.0 | ||
ports: | ||
- name: http | ||
containerPort: 8080 | ||
protocol: TCP | ||
readinessProbe: | ||
httpGet: | ||
path: /ping | ||
port: 8080 | ||
periodSeconds: 5 |