Documentation
¶
Index ¶
- func ApplicationGatewayID(subscriptionID SubscriptionID, resourceGroup ResourceGroup, ...) string
- func ConvertToClusterResourceGroup(subscriptionID SubscriptionID, resourceGroup ResourceGroup, err error) (string, error)
- func GetAuthorizerWithRetry(authLocation string, useManagedidentity bool, cpConfig *CloudProviderConfig, ...) (authorizer autorest.Authorizer, err error)
- func GetOperationIDFromPollingURL(pollingURL string) string
- func ParseResourceID(ID string) (SubscriptionID, ResourceGroup, ResourceName)
- func ParseSubResourceID(ID string) (SubscriptionID, ResourceGroup, ResourceName, ResourceName)
- func ResourceGroupID(subscriptionID SubscriptionID, resourceGroup ResourceGroup) string
- func ResourceID(subscriptionID SubscriptionID, resourceGroup ResourceGroup, provider string, ...) string
- func RouteTableID(subscriptionID SubscriptionID, resourceGroup ResourceGroup, ...) string
- type ApplyRouteTableFunc
- type AzClient
- type CloudProviderConfig
- type DeployGatewayFunc
- type FakeAzClient
- func (az *FakeAzClient) ApplyRouteTable(subnetID string, routeTableID string) error
- func (az *FakeAzClient) DeployGatewayWithSubnet(subnetID, skuName string) (err error)
- func (az *FakeAzClient) DeployGatewayWithVnet(resourceGroupName ResourceGroup, vnetName ResourceName, ...) (err error)
- func (az *FakeAzClient) GetGateway() (n.ApplicationGateway, error)
- func (az *FakeAzClient) GetPublicIP(resourceID string) (n.PublicIPAddress, error)
- func (az *FakeAzClient) GetSubnet(subnetID string) (n.Subnet, error)
- func (az *FakeAzClient) SetAuthorizer(authorizer autorest.Authorizer)
- func (az *FakeAzClient) SetDuration(retryDuration time.Duration)
- func (az *FakeAzClient) SetSender(sender autorest.Sender)
- func (az *FakeAzClient) UpdateGateway(appGwObj *n.ApplicationGateway) (err error)
- func (az *FakeAzClient) WaitForGetAccessOnGateway(maxRetryCount int) error
- type GetGatewayFunc
- type GetPublicIPFunc
- type GetSubnetFunc
- type ResourceGroup
- type ResourceName
- type SubscriptionID
- type UpdateGatewayFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplicationGatewayID ¶
func ApplicationGatewayID(subscriptionID SubscriptionID, resourceGroup ResourceGroup, applicationGatewayName ResourceName) string
ApplicationGatewayID generates a application gateway resource id
func ConvertToClusterResourceGroup ¶
func ConvertToClusterResourceGroup(subscriptionID SubscriptionID, resourceGroup ResourceGroup, err error) (string, error)
ConvertToClusterResourceGroup converts infra resource group to aks cluster ID
func GetAuthorizerWithRetry ¶
func GetAuthorizerWithRetry(authLocation string, useManagedidentity bool, cpConfig *CloudProviderConfig, maxAuthRetryCount int, retryPause time.Duration) (authorizer autorest.Authorizer, err error)
GetAuthorizerWithRetry return azure.Authorizer
func GetOperationIDFromPollingURL ¶
GetOperationIDFromPollingURL extracts operationID from pollingURL
func ParseResourceID ¶
func ParseResourceID(ID string) (SubscriptionID, ResourceGroup, ResourceName)
ParseResourceID gets subscriptionId, resource group, resource name from resourceID
func ParseSubResourceID ¶
func ParseSubResourceID(ID string) (SubscriptionID, ResourceGroup, ResourceName, ResourceName)
ParseSubResourceID gets subscriptionId, resource group, resource name, sub resource name from resourceID
func ResourceGroupID ¶
func ResourceGroupID(subscriptionID SubscriptionID, resourceGroup ResourceGroup) string
ResourceGroupID generates a resource group resource id
func ResourceID ¶
func ResourceID(subscriptionID SubscriptionID, resourceGroup ResourceGroup, provider string, resourceKind string, resourcePath string) string
ResourceID generates a resource id
func RouteTableID ¶
func RouteTableID(subscriptionID SubscriptionID, resourceGroup ResourceGroup, routeTableName ResourceName) string
RouteTableID generates a route table resource id
Types ¶
type ApplyRouteTableFunc ¶
ApplyRouteTableFunc is a function type
type AzClient ¶
type AzClient interface { SetAuthorizer(authorizer autorest.Authorizer) SetSender(sender autorest.Sender) SetDuration(retryDuration time.Duration) ApplyRouteTable(string, string) error WaitForGetAccessOnGateway(maxRetryCount int) error GetGateway() (n.ApplicationGateway, error) UpdateGateway(*n.ApplicationGateway) error DeployGatewayWithVnet(ResourceGroup, ResourceName, ResourceName, string, string) error DeployGatewayWithSubnet(string, string) error GetSubnet(string) (n.Subnet, error) GetPublicIP(string) (n.PublicIPAddress, error) }
AzClient is an interface for client to Azure
func NewAzClient ¶
func NewAzClient(subscriptionID SubscriptionID, resourceGroupName ResourceGroup, appGwName ResourceName, uniqueUserAgentSuffix, clientID string) AzClient
NewAzClient returns an Azure Client
type CloudProviderConfig ¶
type CloudProviderConfig struct { Cloud string `json:"cloud"` TenantID string `json:"tenantId"` SubscriptionID string `json:"subscriptionId"` ClientID string `json:"aadClientId"` ClientSecret string `json:"aadClientSecret"` ResourceGroup string `json:"resourceGroup"` Region string `json:"location"` VNetName string `json:"vnetName"` VNetResourceGroup string `json:"vnetResourceGroup"` RouteTableName string `json:"routeTableName"` RouteTableResourceGroup string `json:"routeTableResourceGroup"` UserAssignedIdentityID string `json:"userAssignedIdentityID"` }
CloudProviderConfig represent the CloudProvider Context file such as Azure
func NewCloudProviderConfig ¶
func NewCloudProviderConfig(path string) (*CloudProviderConfig, error)
NewCloudProviderConfig returns an CloudProviderConfig struct from file path
type DeployGatewayFunc ¶
DeployGatewayFunc is a function type
type FakeAzClient ¶
type FakeAzClient struct { GetGatewayFunc UpdateGatewayFunc DeployGatewayFunc GetPublicIPFunc ApplyRouteTableFunc GetSubnetFunc }
FakeAzClient is a fake struct for AzClient
func NewFakeAzClient ¶
func NewFakeAzClient() *FakeAzClient
NewFakeAzClient returns a fake Azure Client
func (*FakeAzClient) ApplyRouteTable ¶
func (az *FakeAzClient) ApplyRouteTable(subnetID string, routeTableID string) error
ApplyRouteTable runs ApplyRouteTableFunc
func (*FakeAzClient) DeployGatewayWithSubnet ¶
func (az *FakeAzClient) DeployGatewayWithSubnet(subnetID, skuName string) (err error)
DeployGatewayWithSubnet runs DeployGatewayFunc
func (*FakeAzClient) DeployGatewayWithVnet ¶
func (az *FakeAzClient) DeployGatewayWithVnet(resourceGroupName ResourceGroup, vnetName ResourceName, subnetName ResourceName, subnetPrefix, skuName string) (err error)
DeployGatewayWithVnet runs DeployGatewayFunc
func (*FakeAzClient) GetGateway ¶
func (az *FakeAzClient) GetGateway() (n.ApplicationGateway, error)
GetGateway runs GetGatewayFunc and return a gateway
func (*FakeAzClient) GetPublicIP ¶
func (az *FakeAzClient) GetPublicIP(resourceID string) (n.PublicIPAddress, error)
GetPublicIP runs GetPublicIPFunc
func (*FakeAzClient) GetSubnet ¶
func (az *FakeAzClient) GetSubnet(subnetID string) (n.Subnet, error)
func (*FakeAzClient) SetAuthorizer ¶
func (az *FakeAzClient) SetAuthorizer(authorizer autorest.Authorizer)
SetAuthorizer is an empty function
func (*FakeAzClient) SetDuration ¶
func (az *FakeAzClient) SetDuration(retryDuration time.Duration)
SetDuration is an empty function
func (*FakeAzClient) SetSender ¶
func (az *FakeAzClient) SetSender(sender autorest.Sender)
SetSender is an empty function
func (*FakeAzClient) UpdateGateway ¶
func (az *FakeAzClient) UpdateGateway(appGwObj *n.ApplicationGateway) (err error)
UpdateGateway runs UpdateGatewayFunc and return a gateway
func (*FakeAzClient) WaitForGetAccessOnGateway ¶
func (az *FakeAzClient) WaitForGetAccessOnGateway(maxRetryCount int) error
WaitForGetAccessOnGateway runs GetGatewayFunc until it returns a gateway
type GetGatewayFunc ¶
type GetGatewayFunc func() (n.ApplicationGateway, error)
GetGatewayFunc is a function type
type GetPublicIPFunc ¶
type GetPublicIPFunc func(string) (n.PublicIPAddress, error)
GetPublicIPFunc is a function type
type GetSubnetFunc ¶
GetSubnetFunc is a function type
type ResourceGroup ¶
type ResourceGroup string
ResourceGroup is the resource group in which resource is deployed in the resourceID
type SubscriptionID ¶
type SubscriptionID string
SubscriptionID is the subscription of the resource in the resourceID
type UpdateGatewayFunc ¶
type UpdateGatewayFunc func(*n.ApplicationGateway) error
UpdateGatewayFunc is a function type