-
Notifications
You must be signed in to change notification settings - Fork 20
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
Migrate from kuttl to chainsaw #181
Conversation
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
@eddycharly I've opened a PR that should close out #177 and #119 with my changes as a branch so we can validate that automation is working as part of the PR. I have the last KUTTL test remove staged locally as well, just doing some testing before pushing it up. let me know if the chainsaw-test changes I made make sense or if there are any suggestions you have |
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.
Suggestion: I think having a Readme for chainsaw e2e tests would be helpful
e2e/linodeobjectstoragebucket-controller/minimal-linodeobjectstoragebucket/chainsaw-test.yaml
Show resolved
Hide resolved
@eljohnson92 i will take a look after dinner, today has been very busy, sorry |
@eljohnson92 the tests look good, there's a couple of things we could do to improve readability but it's a very good start! i hope chainsaw is not too hard to work with :) |
@@ -1,11 +1,11 @@ | |||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1 | |||
kind: LinodeObjectStorageBucket | |||
metadata: | |||
name: linodeobjectstoragebucket-sample | |||
name: (join('-', [$namespace, 'backups'])) |
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.
instead of computing this multiple times i would create a test level binding with the computed name
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.
is $namespace
available at the top binding level? I am seeing this error
=== NAME chainsaw
| 19:35:38 | chainsaw | @main | INTERNAL | ERROR |
=== ERROR
<nil>: Internal error: variable not defined: $namespace
with this binding def
spec:
template: true
bindings:
- name: bucketName
value: (join('-', [$namespace, 'backups']))
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.
You're right, it's a bug. Fixing it, it will be in the next release.
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.
- name: step-04 | ||
try: | ||
- delete: | ||
ref: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1 | ||
kind: LinodeObjectStorageBucket | ||
name: (join('-', [($namespace), 'backups'])) | ||
- name: step-05 | ||
try: | ||
- error: | ||
file: 05-errors.yaml |
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.
i wonder if you want to run this in a finally
block
- name: step-03 | ||
try: | ||
- delete: | ||
ref: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1 | ||
kind: LinodeVPC | ||
name: ($namespace) | ||
- error: | ||
file: 03-error.yaml | ||
- name: step-04 | ||
try: | ||
- script: | ||
env: | ||
- name: TARGET_API | ||
value: api.linode.com | ||
- name: TARGET_API_VERSION | ||
value: v4beta | ||
- name: URI | ||
value: nodebalancers | ||
- name: FILTER | ||
value: '{"label":"($namespace)"}' | ||
content: | | ||
set -e | ||
curl -s \ | ||
-H "Authorization: Bearer $LINODE_TOKEN" \ | ||
-H "X-Filter: $FILTER" \ | ||
-H "Content-Type: application/json" \ | ||
"https://$TARGET_API/$TARGET_API_VERSION/$URI" | ||
check: | ||
($error): ~ | ||
(json_parse($stdout)): | ||
results: 0 |
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.
same question about the finally
block (to make sure it is executed even when the test fails)
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.
if a single step fails does that cause other steps to not run? I see documentation about a finally block within the scope of a single step but not the scope of a test.
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.
you're right, if a step fails following steps are not run and finally blocks are per step.
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.
Are there any current features that would allow us to always run a step to clean up resources even if previous steps fail?
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.
nope, chainsaw will automatically delete all resources it created though, you shouldn't need it.
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.
great, that is good to know
Folks, i see this concludes the kuttl -> chainsaw migration 🎉 Thanks for your support, really appreciated 🙏 I have one more request for you, we try to maintain a list of adopters, it helps us dedicate some time to the project. Would you mind opening a PR to add yourself in the list ? No obligation of course but would be greatly appreciated 🤞 |
@eddycharly Thank you for your change, i really appreciate it 🙏 |
Hey @mhmxs this is a small world 😂 BTW, i take this opportunity to renew my request #181 (comment) |
* chore: migrate from kuttl to chainsaw Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * set bucket name based on namespace * migrate vpc test from kuttl to chainsaw and remove all kuttl related tooling --------- Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
What type of PR is this?
/kind feature
What this PR does / why we need it:
Migrate from kuttl to chainsaw
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
TODOs: