-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleanup: breakup the pkg/credentials into writer and matcher
The credentials package contains the a matcher and a writer which out of which only the writer is used in cmd/entrypoint. In an effort to isolate usage and not indirectly import the corev1 api which the matcher uses for MatchingAnnotations, we are breaking up the credentials builder interface into two builders for writer and matcher. This ensures that the entrypoint only uses the writer and not the matcher, and we are only using either the writer or the matcher functionality as necessary and not importing unnecessary deps. cleanup: use better names for the credentials interfaces cleanup: use CredsDir from entrypoint pkg instead of pipeline cleanup: remove corev1 usage from credentials package cleanup: add goling gosec exception for Secret type constants
- Loading branch information
1 parent
25a6227
commit b9d05a7
Showing
13 changed files
with
255 additions
and
167 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package common | ||
|
||
// Secret key constants used in credential files, | ||
// so as to avoid reliance on corev1.Secret. | ||
// | ||
//nolint:gosec // for known Kubernetes secret-type constants, not real credentials | ||
const ( | ||
BasicAuthUsernameKey = "username" | ||
BasicAuthPasswordKey = "password" | ||
SSHAuthPrivateKey = "ssh-privatekey" | ||
DockerConfigKey = ".dockercfg" | ||
DockerConfigJsonKey = ".dockerconfigjson" | ||
SecretTypeBasicAuth = "kubernetes.io/basic-auth" | ||
SecretTypeSSHAuth = "kubernetes.io/ssh-auth" | ||
SecretTypeDockerConfigJson = "kubernetes.io/dockerconfigjson" | ||
SecretTypeDockercfg = "kubernetes.io/dockercfg" | ||
SecretTypeServiceAccountToken = "kubernetes.io/service-account-token" | ||
SecretTypeOpaque = "kubernetes.io/opaque" | ||
SecretTypeTLS = "kubernetes.io/tls" | ||
SecretTypeBootstrapToken = "kubernetes.io/bootstrap-token" | ||
) |
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
Oops, something went wrong.