-
Notifications
You must be signed in to change notification settings - Fork 867
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: nil pointer while linting with basic canary and ingresses (#2256)
* fix: nil pointer while linting basic canary with Ingress resources Signed-off-by: zachaller <[email protected]> * Add test case Signed-off-by: zachaller <[email protected]> Signed-off-by: zachaller <[email protected]>
- Loading branch information
Showing
3 changed files
with
64 additions
and
0 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
58 changes: 58 additions & 0 deletions
58
pkg/kubectl-argo-rollouts/cmd/lint/testdata/valid-nginx-basic-canary.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,58 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: nginx-rollout-stable | ||
spec: | ||
type: NodePort | ||
ports: | ||
- port: 80 | ||
targetPort: http | ||
protocol: TCP | ||
name: http | ||
selector: | ||
app: nginx-rollout | ||
--- | ||
apiVersion: networking.k8s.io/v1beta1 | ||
kind: Ingress | ||
metadata: | ||
name: nginx-rollout-ingress | ||
spec: | ||
rules: | ||
- http: | ||
paths: | ||
- path: /* | ||
backend: | ||
serviceName: nginx-rollout-root | ||
servicePort: use-annotation | ||
--- | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Rollout | ||
metadata: | ||
name: nginx-rollout | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: nginx-rollout | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx-rollout | ||
spec: | ||
containers: | ||
- name: nginx-rollout | ||
image: argoproj/rollouts-demo:blue | ||
ports: | ||
- name: http | ||
containerPort: 80 | ||
protocol: TCP | ||
resources: | ||
requests: | ||
memory: 16Mi | ||
cpu: 5m | ||
strategy: | ||
canary: | ||
steps: | ||
- setWeight: 10 | ||
- pause: {} | ||
- setWeight: 50 | ||
- pause: {} |