-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
add hack/update-deps.sh #3
add hack/update-deps.sh #3
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: BenTheElder The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/assign @amwat |
hack/.kazelcfg.json
Outdated
@@ -0,0 +1,4 @@ | |||
{ | |||
"GoPrefix": "k8s.io/test-infra", |
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 wound up fixing this in the next commit, FYI
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.
/lgtm
kubeadm does not currently allow to configure a user reference id, and instead always uses kubernetes-admin. This causes a problem when we create multiple clusters with Kind and want to use each corresponding kubeconfig file at the same time in KUBECONFIG. Until kubeadm supports configuring a user reference id, the only option to fix this for Kind is to modify the kubeconfig file that kubeadm provides. As Kind already did this with the server name, it made sense to take the logic further and also make the user reference id unique to a cluster. Three approaches were considered: 1- continue with the current approach of parsing each line of the admin.conf kubeconfig file, and make the modifications necessary. After implementing this approach, the solution seemed quite brittle as it uses regex but no yaml structure. 2- use the go package yaml.v2 to -fully- parse the yaml of the admin.conf kubeconfig file, make the modifications, and then output the new yaml kubeconfig file. This solution requires to define a detailed struct of every field contained in the original yaml file. Having to map every field in advance is brittle as any modification that kubeadm may make to the file in the future would require adaptation in Kind. 3- use the go package yaml.v2 to -generically- parse the yaml of the admin.conf kubeconfig file, make the modifications, and then output the new yaml kubeconfig file. This solution only accesses the yaml fields that are required to be modified. Although any future changes from kubeadm to those fields would require modifications in Kind, modifications to all other fields would not. This commit implements solution #3 which was felt to be the most future-proof and least brittle of the three. Signed-off-by: Marc Khouzam <marc.khouzam@ville.montreal.qc.ca>
.. and run it to fix
bazel build //:kind
TODO: add verify scripts, presubmits, and guides for how to develop.