-
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
fix(glide): use kubeapp interfaces for Kubernetes client operations #51
Conversation
By analyzing the blame information on this pull request, we identified @jackfrancis and @mboersma to be potential reviewers |
this dependency will be used for mocking the k8s clients in unit tests
All code that requires a Kubernetes client to interact with secrets now takes in a KubeSecretGetterCreator - an interface that composes (github.com/arschles/kubeapp/api/secret).{Getter, Creator} - and the real Kubernetes client is passed down the stack, as it’s an implementation of that interface. Tests are still broken as of this commit, fixes forthcoming.
this commit also modifies various structs in the data package to store the secret creator/getter inside the struct, instead of changing the interface definition
pass implementations in prod and test code
I'll augment @mention-bot by guessing that @vdice might be interested in this PR as well 😄 |
} | ||
deisSecrets := kubeClient.Secrets(deisNamespace) | ||
secret, err := deisSecrets.Get(wfmSecretName) | ||
// deisSecrets := kubeClient.Secrets(deisNamespace) |
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.
looks like this commented code can be 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.
right you are. fixed in bea47fe
Some functions of the code in the
data
package were creating new Kubernetes clients, using them, and passing them elsewhere. This PR makes a few changes to eliminate that pattern:main
funcjackfan.us.kg/arschles/kubeapp/api
package, and use thoseThis change allows for unit tests to provide an in-memory implementation to test the behavior of these functions without any externally running services. This change allows us to implement the first bullet point in the description of meta: tests #38:
Contributes to #38