Documentation ¶
Index ¶
- Constants
- Variables
- func NewAppClient(authorizer *msgraphsdk.GraphRequestAdapter) *appClient
- type Actuator
- func (a *Actuator) Create(ctx context.Context, cr *minterv1.CredentialsRequest) error
- func (a *Actuator) Delete(ctx context.Context, cr *minterv1.CredentialsRequest) error
- func (a *Actuator) Exists(ctx context.Context, cr *minterv1.CredentialsRequest) (bool, error)
- func (a *Actuator) GetCredentialsRootSecret(ctx context.Context, cr *minterv1.CredentialsRequest) (*corev1.Secret, error)
- func (a *Actuator) GetCredentialsRootSecretLocation() types.NamespacedName
- func (a *Actuator) IsValidMode() error
- func (a *Actuator) Update(ctx context.Context, cr *minterv1.CredentialsRequest) error
- func (a *Actuator) Upgradeable(mode operatorv1.CloudCredentialsMode) *configv1.ClusterOperatorStatusCondition
- type AppClient
- type AzureCredentialsMinter
Constants ¶
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 ¶
var RootSecretKey = client.ObjectKey{Name: constants.AzureCloudCredSecretName, Namespace: constants.CloudCredSecretNamespace}
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 NewFakeActuator ¶
func NewFakeActuator(c client.Client, codec *minterv1.ProviderCodec, credentialMinterBuilder credentialMinterBuilder, ) *Actuator
func (*Actuator) Exists ¶
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 (*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 (*Actuator) Upgradeable ¶
func (a *Actuator) Upgradeable(mode operatorv1.CloudCredentialsMode) *configv1.ClusterOperatorStatusCondition
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.