-
Notifications
You must be signed in to change notification settings - Fork 867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: nil pointer while linting with basic canary and ingresses #2256
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: {} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
valid-nginx-basic-canary.yml
manifest you added has noSpec.Strategy.Canary.TrafficRouting
field, which tests the second part of this clause, but it does have aSpec.Strategy.Canary
field.Should we add another test Rollout manifest with no
Spec.Strategy.Canary
field to test the former part of this clause? Apologies if I'm misunderstanding the original bugThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea the bug was really only ever for the missing TrafficRoutering field which is for basic canary. There are already test cases such as blue green https://github.com/argoproj/argo-rollouts/blob/754a5c7d0f1e7d4a26f26f8ff594a64dede82886/pkg/kubectl-argo-rollouts/cmd/lint/testdata/valid-blue-green.yml where we do not check for referenced resources that do not have
Spec.Strategy.Canary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clarifying!