util

package
v0.1.25 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 21 Imported by: 5

Documentation

Index

Constants

View Source
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 ExtractOptionsFromSecret

func ExtractOptionsFromSecret(client client.Client, name string, namespace string, baseDomain string) (string, string, string, error)

ExtractOptionsFromSecret Returns baseDomain, awsAccessKeyID & awsSecretAccessKey If len(baseDomain) > 0 we override the value found in the secret

func GetClient

func GetClient() (crclient.Client, error)

GetClient creates a controller-runtime client for Kubernetes

func GetConfig

func GetConfig() (*rest.Config, error)

GetConfig creates a REST config from current context

func GetImpersonatedClient added in v0.1.9

func GetImpersonatedClient(userName string) (crclient.Client, error)

GetImpersonatedClient creates a controller-runtime client for Kubernetes

func GetPullSecret added in v0.1.7

func GetPullSecret(name string, namespace string) ([]byte, error)

func GetSecret

func GetSecret(name string, namespace string) (*corev1.Secret, error)

func GetSecretWithClient

func GetSecretWithClient(client client.Client, name string, namespace string) (*corev1.Secret, error)

func ParseAWSTags

func ParseAWSTags(tags []string) (map[string]string, error)

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

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL