azure

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AzureClientID       = "azure_client_id"
	AzureClientSecret   = "azure_client_secret"
	AzureRegion         = "azure_region"
	AzureResourceGroup  = "azure_resourcegroup"
	AzureResourcePrefix = "azure_resource_prefix"
	AzureSubscriptionID = "azure_subscription_id"
	AzureTenantID       = "azure_tenant_id"
)

Variables

Functions

func NewAppClient

func NewAppClient(authorizer *msgraphsdk.GraphRequestAdapter) *appClient

Types

type Actuator

type Actuator struct {
	// contains filtered or unexported fields
}

Actuator implements the CredentialsRequest Actuator interface to create credentials for Azure.

func NewActuator

func NewActuator(c client.Client, cloudName configv1.AzureCloudEnvironment) (*Actuator, error)

func NewFakeActuator

func NewFakeActuator(c client.Client, codec *minterv1.ProviderCodec,
	credentialMinterBuilder credentialMinterBuilder,
) *Actuator

func (*Actuator) Create

func (*Actuator) Delete

func (*Actuator) Exists

func (a *Actuator) Exists(ctx context.Context, cr *minterv1.CredentialsRequest) (bool, error)

Checks if the credentials currently exist.

To do this we will check if the target secret exists. This call is only used to determine if we're doing a Create or an Update, but in the context of this acutator it makes no difference. As such we will not check if the SP exists in Azure and is correctly configured as this will all be handled in both Create and Update.

func (*Actuator) GetCredentialsRootSecret

func (a *Actuator) GetCredentialsRootSecret(ctx context.Context, cr *minterv1.CredentialsRequest) (*corev1.Secret, error)

func (*Actuator) GetCredentialsRootSecretLocation

func (a *Actuator) GetCredentialsRootSecretLocation() types.NamespacedName

GetCredentialsRootSecretLocation returns the namespace and name where the parent credentials secret is stored.

func (*Actuator) IsValidMode

func (a *Actuator) IsValidMode() error

func (*Actuator) Update

func (*Actuator) Upgradeable

Upgradeable returns a ClusterOperator status condition for the upgradeable type if the system is considered not upgradeable. Otherwise, return nil as the default value is for things to be upgradeable.

type AppClient

type AppClient interface {
	List(ctx context.Context, filter string) ([]models.Applicationable, error)
	Delete(ctx context.Context, applicationObjectID string) error
}

AppClient is a wrapper object for actual Azure SDK to allow for easier testing.

type AzureCredentialsMinter

type AzureCredentialsMinter struct {
	// contains filtered or unexported fields
}

func NewAzureCredentialsMinter

func NewAzureCredentialsMinter(logger log.FieldLogger, clientID, clientSecret string, cloudName configv1.AzureCloudEnvironment, tenantID, subscriptionID string) (*AzureCredentialsMinter, error)

func NewFakeAzureCredentialsMinter

func NewFakeAzureCredentialsMinter(logger log.FieldLogger, clientID, clientSecret, tenantID, subscriptionID string, appClient AppClient) (*AzureCredentialsMinter, error)

func (*AzureCredentialsMinter) DeleteAADApplication

func (credMinter *AzureCredentialsMinter) DeleteAADApplication(ctx context.Context, aadAppName string) error

DeleteAADApplication deletes an AAD application. If the application does not exist, it's no-op.

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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