-
Notifications
You must be signed in to change notification settings - Fork 15
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
[etcdbackup&restore] Implement RKE2Config webhook #542
base: main
Are you sure you want to change the base?
Conversation
056468c
to
a9c1745
Compare
@alexander-demicev PTAL |
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.
Thank for working on it, I have a couple of comments
@@ -0,0 +1,6 @@ | |||
package webhooks | |||
|
|||
var installsh = ` |
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'd prefer to embed
library here, we can update it later when actual script is implemented
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 just a skeleton for installsh.go file and will be changed when actually introducing installsh script
|
||
logger.Info("Service account secret is populated") | ||
|
||
serverUrlSetting := &unstructured.Unstructured{} |
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 use this library instead of unstructured https://github.com/rancher/turtles/tree/main/internal/rancher, we just to make it importable
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.
To make it importable we need a new go.mod file and dedicated file for this kind (=Setting)? I am not sure if that's worth the effort. I noticed the unstructured usage in few places, i.e https://github.com/rancher/turtles/blob/main/test/framework/rancher_helpers.go#L219-L221
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 believe we need to move the webhook pathing code to the internal package of its own, and if possible, move out the internal/rancher
to and API level, because it is a public API. Then the use of the generated Setting
as a typed resource will be easy and correct.
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.
In any case, that change seems to be out of scope of this PR and can be discussed separately IMO.
var errs []error | ||
|
||
// Create the ServiceAccount first to later pass to the RoleBinding creation | ||
sa := r.createServiceAccount(planSecretName, rke2Config) |
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 create it later as we already know the namespace and name to use
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.
No we don't know it beforehand. I had to create it first and later refer to it.
Signed-off-by: Furkat Gofurov <furkat.gofurov@suse.com>
Signed-off-by: Furkat Gofurov <furkat.gofurov@suse.com>
a9c1745
to
005455c
Compare
…efile target Signed-off-by: Furkat Gofurov <furkat.gofurov@suse.com>
What this PR does / why we need it:
Adds RKE2Config webhook implementation
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 #498
Part of: #388
Special notes for your reviewer:
Checklist: