Documentation
¶
Overview ¶
Package pullsecret provides pull secret validation functionality This package validates cluster pull secrets against OCM account data, similar to osdctl's validate-pull-secret-ext command.
Index ¶
- Constants
- Variables
- func GetAuthEmail(secret *corev1.Secret, authKey string) (string, error)
- func GetPullSecret(k8scli client.Client) (*corev1.Secret, error)
- func ValidateRegistryCredentials(k8scli client.Client, ocmConn *sdk.Connection, accountID string, ...) (*ValidationResult, []RegistryValidationResult)
- type AuthEmailNotFoundError
- type ParseSecretError
- type RegistryValidationResult
- type SecretAuthNotFoundError
- type ValidationResult
Constants ¶
View Source
const ( PullSecretName = "pull-secret" PullSecretNamespace = "openshift-config" // #nosec G101 CloudOpenShiftComAuthKey = "cloud.openshift.com" )
Variables ¶
View Source
var ErrSecretDataEmpty = errors.New("pull secret data is empty")
View Source
var ErrSecretMissingDockerConfigJson = errors.New("secret missing '.dockerconfigjson'")
Functions ¶
func GetAuthEmail ¶
GetAuthEmail extracts the email from a specific auth entry in the pull secret
func GetPullSecret ¶
GetPullSecret retrieves the pull secret from the cluster
func ValidateRegistryCredentials ¶
func ValidateRegistryCredentials(k8scli client.Client, ocmConn *sdk.Connection, accountID string, ocmEmail string) (*ValidationResult, []RegistryValidationResult)
ValidateRegistryCredentials validates the cluster pull secret against OCM registry credentials
Types ¶
type AuthEmailNotFoundError ¶
type AuthEmailNotFoundError struct {
Auth string
}
func (*AuthEmailNotFoundError) Error ¶
func (e *AuthEmailNotFoundError) Error() string
type ParseSecretError ¶
type ParseSecretError struct {
Err error
}
func (*ParseSecretError) Error ¶
func (e *ParseSecretError) Error() string
func (*ParseSecretError) Unwrap ¶
func (e *ParseSecretError) Unwrap() error
type SecretAuthNotFoundError ¶
type SecretAuthNotFoundError struct {
Auth string
}
func (*SecretAuthNotFoundError) Error ¶
func (e *SecretAuthNotFoundError) Error() string
type ValidationResult ¶
func ValidateEmail ¶
func ValidateEmail(k8scli client.Client, ocmEmail string) *ValidationResult
ValidateEmail validates the pull secret email against the OCM account email
func ValidateEmailWithSecret ¶
func ValidateEmailWithSecret(secret *corev1.Secret, ocmEmail string) *ValidationResult
ValidateEmailWithSecret compares the email in the pull secret against the OCM account email
func (*ValidationResult) AddWarning ¶
func (v *ValidationResult) AddWarning(format string, args ...any)
Click to show internal directories.
Click to hide internal directories.