This repository was archived by the owner on Jun 29, 2022. It is now read-only.
Conversation
abcbe0f to
50a07b8
Compare
50a07b8 to
d51b7e7
Compare
Member
Author
|
Rebased to resolve conflicts. |
iaguis
suggested changes
Jun 26, 2020
cli/cmd/cluster-apply.go
Outdated
|
|
||
| func verifyCluster(kubeconfigPath string, expectedNodes int) error { | ||
| client, err := k8sutil.NewClientset(kubeconfigPath) | ||
| client, err := k8sutil.NewClientsetFromFile(kubeconfigPath) |
Contributor
There was a problem hiding this comment.
The commit message is very confusing, can you try to rephrase?
Member
Author
There was a problem hiding this comment.
Right. Sorry about that, I wrote complete nonsense. I rephrased now, it should be better :)
d51b7e7 to
e50c13d
Compare
Member
Author
|
I applied your suggestions, thanks for reviewing @iaguis 🙏 |
63c0256 to
5703bcd
Compare
ipochi
suggested changes
Jun 30, 2020
Member
ipochi
left a comment
There was a problem hiding this comment.
Reviewed the later half of the PR :)
5703bcd to
2ba8cef
Compare
This commit renames NewClientset function into NewClientsetFromFile to better describe it's functionality, as function takes file path as an argument to build the clientset object. It also makes room for new NewClientset function, which will take content of kubeconfig file instead of file path, to make it decoupled from dependency on local filesystem. NewClientsetFromFile is only a temporary and should be removed once we switch back to use NewClientset function everywhere. This commit also adds some small documentation to NewClientsetFromFile function to avoid triggering the linter. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
This commit adds NewClientset exported function, which allows creating Kubernetes Clientset from content of kubeconfig file, which allows to create it from sources different than file on local file system. This is required for being able to execute 'lokoctl health' without having kubeconfig file present in local assets directory, as it can be pulled from other places, e.g. Terraform state. See #608 for more details. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
In some places we use 'client' to refer to it, in other 'cs', we should be consistent in it. This commit fixes that. The consistency is particulary useful when you grep for code calling the function. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
NewClientsetFromFile is now deprecated, as we want to gradually switch to loading kubeconfig file from the file content rather than from the file path. This commit preserves existing functionality, but uses new function, which should simplify the change later for loading from the file content. The code duplication here is intentional, to put calls to NewClientset function in place. In next commits, functions parameter types will be changed and calls to iotuil.ReadFile will be removed. This allows to do more step-by-step transition to different data flow. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
NewClientsetFromFile is now deprecated, as we want to gradually switch to loading kubeconfig file from the file content rather than from the file path. This commit preserves existing functionality, but uses new function, which should simplify the change later for loading from the file content. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
All uses of this function are now replaced by NewClientset function, so this function is unused and safe to remove. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
2ba8cef to
90f3c1a
Compare
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As a first step towards resolving #608, this PR changes
NewClientsetto create Kubernetes Clientset fromkubeconfigfile content, instead of from file path. The clients are changes to manually load the file content, which should simplify changing it to also accept the file content as an argument in the upcoming patches.