forked from argoproj/argo-rollouts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli): nil pointer while linting (argoproj#2324)
* fix nil pointer on lint Signed-off-by: zachaller <[email protected]> * github trigger re-run Signed-off-by: zachaller <[email protected]> * add test for having a virtual service but not using it in rollout Signed-off-by: zachaller <[email protected]> * change logic Signed-off-by: zachaller <[email protected]> * improve test cov Signed-off-by: zachaller <[email protected]> * remove unreachable code Signed-off-by: zachaller <[email protected]> * github trigger re-run Signed-off-by: zachaller <[email protected]> * github trigger re-run Signed-off-by: zachaller <[email protected]> * Add test coverage Signed-off-by: zachaller <[email protected]> * add more test coverage Signed-off-by: zachaller <[email protected]> * Standardize msg Signed-off-by: zachaller <[email protected]> * lint Signed-off-by: zachaller <[email protected]> Signed-off-by: zachaller <[email protected]>
- Loading branch information
Showing
6 changed files
with
117 additions
and
1 deletion.
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
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
5 changes: 5 additions & 0 deletions
5
pkg/kubectl-argo-rollouts/cmd/lint/testdata/invalid-empty-rollout-vsvc.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,5 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Rollout | ||
--- | ||
apiVersion: networking.istio.io/v1alpha3 | ||
kind: VirtualService |
74 changes: 74 additions & 0 deletions
74
pkg/kubectl-argo-rollouts/cmd/lint/testdata/valid-nginx-smi-with-vsvc.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,74 @@ | ||
apiVersion: networking.istio.io/v1beta1 | ||
kind: VirtualService | ||
metadata: | ||
name: istio-host-split-vsvc | ||
spec: | ||
hosts: | ||
- istio-host-split.com | ||
gateways: | ||
- istio-host-split-gateway | ||
http: | ||
- name: primary | ||
route: | ||
- destination: | ||
host: istio-host-split-stable | ||
weight: 100 | ||
- destination: | ||
host: istio-host-split-canary | ||
weight: 0 | ||
--- | ||
apiVersion: networking.istio.io/v1beta1 | ||
kind: VirtualService | ||
metadata: | ||
name: istio-host-split-vsvc-1 | ||
spec: | ||
hosts: | ||
- istio-host-split.com | ||
gateways: | ||
- istio-host-split-gateway | ||
http: | ||
- name: primary | ||
route: | ||
- destination: | ||
host: istio-host-split-stable | ||
weight: 100 | ||
- destination: | ||
host: istio-host-split-canary | ||
weight: 0 | ||
--- | ||
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: | ||
canaryService: nginx-rollout-canary | ||
stableService: nginx-rollout-stable | ||
trafficRouting: | ||
smi: | ||
trafficSplitName: rollout-smi-experiment-split | ||
rootService: rollout-smi-experiment-root | ||
nginx: | ||
stableIngress: nginx-rollout-ingress | ||
steps: | ||
- setWeight: 10 |