-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
odiglet: Initialize clientset at startup and do OpenShift selinux cha…
…nges last (#2405) This does 2 things in the Odiglet: * **Make SELinux calls for openshift last in the init phase.** These functions `chroot` to the host directory to run selinux commands that update the agent permissions, so they are readable by pods. This `chroot` was preventing the k8s client from initializing with `open /var/run/secrets/kubernetes.io/serviceaccount/token: no such file or directory`. Moved last so the `chroot` doesn't mess up future changes. * **Initializes the k8s clientset in the main odiglet function.** This allows the same clientset to be passed through to the init phase (which uses it to apply labels to nodes) and the odiglet controller. Doing so makes `clientset` an argument to functions like `odiglet.New` and `k8snode.AddLabelToNode`, the latter of which is just a helper which should not be initializing its own clientset every call anyway. Technically, either one of these changes would have fixed the issue. But doing both is even better to help prevent future issues like this.
- Loading branch information
Showing
4 changed files
with
65 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters