-
Notifications
You must be signed in to change notification settings - Fork 1.4k
✨ Add support to clusterctl for inserting workload kubeconfig into an existing kubeconfig file #11942
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
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
/area clusterctl |
c014c6e
to
c43c52a
Compare
@fabriziopandini could you please to have a look at this PR when possible |
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 left one nits, but otherwise looks good.
/lgtm
} | ||
} | ||
|
||
const workloadKubeconfig = `apiVersion: v1 |
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.
Let's separate to other file. We can embed these data to use go:embed.
It's more readable.
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.
Totally agree with you and embed is my preferable way for big data values in tests.
But I can see, that most of the test approaches in the Cluster API tests are using constants.
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.
Then, let's move constants to embedded way after it or asynchronously.
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.
Fixed, please review
LGTM label has been added. Git tree hash: 9989754b9f0d1c43516c96d2d986b122b165cc56
|
New changes are detected. LGTM label has been removed. |
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 updating. I left nits, PTAL 🙏
//go:embed testdata/existsing-kubeconfig.yaml | ||
var existingKubeconfig string | ||
|
||
//go:embed testdata/workload-kubeconfig.yaml | ||
var workloadKubeconfig string | ||
|
||
//go:embed testdata/joined-kubeconfig.yaml | ||
var joinedKubeconfig string |
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.
//go:embed testdata/existsing-kubeconfig.yaml | |
var existingKubeconfig string | |
//go:embed testdata/workload-kubeconfig.yaml | |
var workloadKubeconfig string | |
//go:embed testdata/joined-kubeconfig.yaml | |
var joinedKubeconfig string | |
var ( | |
//go:embed testdata/existsing-kubeconfig.yaml | |
existingKubeconfig string | |
//go:embed testdata/workload-kubeconfig.yaml | |
workloadKubeconfig string | |
//go:embed testdata/joined-kubeconfig.yaml | |
joinedKubeconfig string | |
) |
Just a bit easier to read.
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.
Ok, will fix
var existingKubeconfig string | ||
|
||
//go:embed testdata/workload-kubeconfig.yaml | ||
var workloadKubeconfig string |
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.
var workloadKubeconfig string | |
var singleWorkloadKubeconfig string |
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.
Ok, will fix
var workloadKubeconfig string | ||
|
||
//go:embed testdata/joined-kubeconfig.yaml | ||
var joinedKubeconfig string |
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.
var joinedKubeconfig string | |
var multipleWorkloadKubeconfig string |
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.
Ok, will fix
… existing kubeconfig file
What this PR does / why we need it:
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 #10133