Documentation ¶
Index ¶
- Constants
- func GetClient() (crclient.Client, error)
- func GetConfig() (*rest.Config, error)
- func GetImpersonatedClient(userName string) (crclient.Client, error)
- func GetPullSecret(name string, namespace string) ([]byte, error)
- func GetSecret(name string, namespace string) (*corev1.Secret, error)
- func GetSecretWithClient(client client.Client, name string, namespace string) (*corev1.Secret, error)
- func ParseAWSTags(tags []string) (map[string]string, error)
- func SetupAzureCredentials(l logr.Logger, credentials *AzureCreds, credentialsFile string) (string, *azidentity.DefaultAzureCredential, error)
- func ValidateRequiredOption(flag string, value string) error
- type AzureCreds
- type CredentialsSecretData
Constants ¶
const ( AutoInfraLabelName = "hypershift.openshift.io/auto-created-for-infra" // DeleteWithClusterLabelName marks CLI created secrets, to be safely removed on hosted cluster deletion DeleteWithClusterLabelName = "hypershift.openshift.io/safe-to-delete-with-cluster" )
Variables ¶
This section is empty.
Functions ¶
func GetImpersonatedClient ¶ added in v0.1.9
GetImpersonatedClient creates a controller-runtime client for Kubernetes
func GetPullSecret ¶ added in v0.1.7
func GetSecretWithClient ¶
func ParseAWSTags ¶
ParseAWSTags does exactly that
func SetupAzureCredentials ¶ added in v0.1.18
func SetupAzureCredentials(l logr.Logger, credentials *AzureCreds, credentialsFile string) (string, *azidentity.DefaultAzureCredential, error)
SetupAzureCredentials creates the Azure credentials needed to create Azure resources from credentials passed in from the user or from a credentials file
func ValidateRequiredOption ¶ added in v0.1.32
ValidateRequiredOption returns a cobra style error message when the flag value is empty
Types ¶
type AzureCreds ¶ added in v0.1.18
type AzureCreds struct { SubscriptionID string `json:"subscriptionId,omitempty"` ClientID string `json:"clientId,omitempty"` ClientSecret string `json:"clientSecret,omitempty"` TenantID string `json:"tenantId,omitempty"` }
AzureCreds is the file format we expect for credentials. It is copied from the installer to allow using the same credentials file for both: https://github.com/openshift/installer/blob/8fca1ade5b096d9b2cd312c4599881d099439288/pkg/asset/installconfig/azure/session.go#L36
func ReadCredentials ¶ added in v0.1.18
func ReadCredentials(path string) (*AzureCreds, error)
ReadCredentials reads a file with azure credentials and returns it as a struct
type CredentialsSecretData ¶ added in v0.1.32
type CredentialsSecretData struct { AWSAccessKeyID string AWSSecretAccessKey string AWSSessionToken string BaseDomain string }
func ExtractOptionsFromSecret ¶
func ExtractOptionsFromSecret(client client.Client, name string, namespace string, baseDomain string) (*CredentialsSecretData, error)
ExtractOptionsFromSecret Returns baseDomain, awsAccessKeyID & awsSecretAccessKey If len(baseDomain) > 0 we override the value found in the secret