-
Notifications
You must be signed in to change notification settings - Fork 248
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
[kjobctl] Move unmask_filename to templates. #3180
base: main
Are you sure you want to change the base?
[kjobctl] Move unmask_filename to templates. #3180
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mbobrovskyi The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
✅ Deploy Preview for kubernetes-sigs-kueue canceled.
|
6fd8f26
to
24c188a
Compare
/cc @trasc |
24c188a
to
370eafd
Compare
unmask_filename
to templates.unmask_filename
as embed file.
387f031
to
5d71e96
Compare
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.
this is not a .tmpl :) , it should not be a match for the template wildcard
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 issue is that the linter incorrectly identifies it as a .sh file, resulting in an error: https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/3180/pull-kueue-test-kjobctl/1842216444394213376. Adding a shebang here results in it being duplicated in the template, which is incorrect. We could also ignore it using # shellcheck disable=SC2148
, but this would make the resulting output less clear.
Honestly, I think it should be template because this is a part of template. I moved it to separate file to be easier test this function. I don't see significant advantages to not using it as a template, but there are drawbacks - such as developer comments being included in the result and we need to create a separate embed variable, whereas simply including the file name in the template would be much easier.
I propose reverting to the previous solution, which I believe is much better. However, if you have another solution that you think is better, feel free to discuss 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.
Since it is only used in one place you could just put its content in the entrypoint template.
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.
We can't test it in this way 😕.
replaced="${replaced//%%/%}" | ||
|
||
echo "$replaced" | ||
} |
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.
NIT:
} | |
} | |
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.
Why do we need it? This space will be added in the main template.
5d71e96
to
2168679
Compare
unmask_filename
as embed file.
We discussed this case wit @trasc and take a decision to continue working on it after implementing e2e tests. /hold |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Move unmask_filename to templates in kjobctl.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Follow up for #3136 (comment).
Does this PR introduce a user-facing change?