-
Notifications
You must be signed in to change notification settings - Fork 528
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a k8schain directly from pull secrets (#1049)
* Create a k8schain directly from pull secrets The k8schain package creates a new keychain by resolving Kubernets secrets from service accounts and other image pull secrets specified by name. The k8s client gets the full secret content for these named resources. Sometimes it's desirable to pull the content of a secret from a cache, or to watch a resource for changes in a controller. In this situation it would be helpful to create a k8schain directly from resolved secrets, without making calls to the k8s api server. This change refactors the existing k8schain.New() method to separate the resolution of secrets from the creation of the keychain. This is only a refactoring of existing behavior to shortcut the k8s api lookups. There is no change in existing behavior for the keychain. Added: k8schain.NewFromPullSecrets(context.Context, []corev1.Secret) (authn.Keychain, error) Signed-off-by: Scott Andrews <andrewssc@vmware.com> * gofmt Signed-off-by: Scott Andrews <andrewssc@vmware.com>
- Loading branch information
Showing
2 changed files
with
85 additions
and
14 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