Documentation ¶
Overview ¶
Package armhelpers stores helpers and wrapper for the go azure sdk.
Index ¶
- Constants
- Variables
- func DeployTemplateSync(az AKSEngineClient, logger *logrus.Entry, ...) error
- type AKSEngineClient
- type AKSStorageClient
- type AzureClient
- func NewAzureClientWithCLI(env azure.Environment, subscriptionID string) (*AzureClient, error)
- func NewAzureClientWithClientCertificate(env azure.Environment, subscriptionID, clientID string, ...) (*AzureClient, error)
- func NewAzureClientWithClientCertificateExternalTenant(env azure.Environment, subscriptionID, tenantID, clientID string, ...) (*AzureClient, error)
- func NewAzureClientWithClientCertificateFile(env azure.Environment, ...) (*AzureClient, error)
- func NewAzureClientWithClientSecret(env azure.Environment, subscriptionID, clientID, clientSecret string) (*AzureClient, error)
- func NewAzureClientWithClientSecretExternalTenant(env azure.Environment, subscriptionID, tenantID, clientID, clientSecret string) (*AzureClient, error)
- func NewAzureClientWithDeviceAuth(env azure.Environment, subscriptionID string) (*AzureClient, error)
- func (az *AzureClient) AddAcceptLanguages(languages []string)
- func (az *AzureClient) AddAuxiliaryTokens(tokens []string)
- func (az *AzureClient) CheckDeploymentExistence(ctx context.Context, resourceGroupName string, deploymentName string) (result autorest.Response, err error)
- func (az *AzureClient) CheckResourceGroupExistence(ctx context.Context, name string) (result autorest.Response, err error)
- func (az *AzureClient) CreateApp(ctx context.Context, appName, appURL string, replyURLs *[]string, ...) (applicationResp graphrbac.Application, ...)
- func (az *AzureClient) CreateGraphApplication(ctx context.Context, ...) (graphrbac.Application, error)
- func (az *AzureClient) CreateGraphPrincipal(ctx context.Context, ...) (graphrbac.ServicePrincipal, error)
- func (az *AzureClient) CreateRoleAssignment(ctx context.Context, scope string, roleAssignmentName string, ...) (authorization.RoleAssignment, error)
- func (az *AzureClient) CreateRoleAssignmentSimple(ctx context.Context, resourceGroup, servicePrincipalObjectID string) error
- func (az *AzureClient) CreateUserAssignedID(location string, resourceGroup string, userAssignedID string) (id *msi.Identity, err error)
- func (az *AzureClient) DeleteApp(ctx context.Context, applicationName, applicationObjectID string) (autorest.Response, error)
- func (az *AzureClient) DeleteGraphApplication(ctx context.Context, applicationObjectID string) (result autorest.Response, err error)
- func (az *AzureClient) DeleteManagedDisk(ctx context.Context, resourceGroupName string, diskName string) error
- func (az *AzureClient) DeleteNetworkInterface(ctx context.Context, resourceGroup, nicName string) error
- func (az *AzureClient) DeleteResourceGroup(ctx context.Context, name string) error
- func (az *AzureClient) DeleteRoleAssignmentByID(ctx context.Context, roleAssignmentID string) (authorization.RoleAssignment, error)
- func (az *AzureClient) DeleteVirtualMachine(ctx context.Context, resourceGroup, name string) error
- func (az *AzureClient) DeleteVirtualMachineScaleSet(ctx context.Context, resourceGroup, vmssName string) error
- func (az *AzureClient) DeleteVirtualMachineScaleSetVM(ctx context.Context, resourceGroup, virtualMachineScaleSet, instanceID string) error
- func (az *AzureClient) DeployTemplate(ctx context.Context, resourceGroupName, deploymentName string, ...) (de resources.DeploymentExtended, err error)
- func (az *AzureClient) EnsureProvidersRegistered(subscriptionID string) error
- func (az *AzureClient) EnsureResourceGroup(ctx context.Context, name, location string, managedBy *string) (resourceGroup *resources.Group, err error)
- func (az *AzureClient) GetAvailabilitySet(ctx context.Context, resourceGroup, availabilitySetName string) (compute.AvailabilitySet, error)
- func (az *AzureClient) GetAvailabilitySetFaultDomainCount(ctx context.Context, resourceGroup string, vmasIDs []string) (int, error)
- func (az *AzureClient) GetDeployment(ctx context.Context, resourceGroupName, deploymentName string) (result resources.DeploymentExtended, err error)
- func (az *AzureClient) GetKubernetesClient(apiserverURL, kubeConfig string, interval, timeout time.Duration) (KubernetesClient, error)
- func (az *AzureClient) GetStorageClient(ctx context.Context, resourceGroup, accountName string) (AKSStorageClient, error)
- func (az *AzureClient) GetVirtualMachine(ctx context.Context, resourceGroup, name string) (compute.VirtualMachine, error)
- func (az *AzureClient) ListDeploymentOperations(ctx context.Context, resourceGroupName string, deploymentName string, ...) (DeploymentOperationsListResultPage, error)
- func (az *AzureClient) ListManagedDisksByResourceGroup(ctx context.Context, resourceGroupName string) (result DiskListPage, err error)
- func (az *AzureClient) ListProviders(ctx context.Context) (ProviderListResultPage, error)
- func (az *AzureClient) ListRoleAssignmentsForPrincipal(ctx context.Context, scope string, principalID string) (RoleAssignmentListResultPage, error)
- func (az *AzureClient) ListVirtualMachineScaleSetVMs(ctx context.Context, resourceGroup, virtualMachineScaleSet string) (VirtualMachineScaleSetVMListResultPage, error)
- func (az *AzureClient) ListVirtualMachineScaleSets(ctx context.Context, resourceGroup string) (VirtualMachineScaleSetListResultPage, error)
- func (az *AzureClient) ListVirtualMachines(ctx context.Context, resourceGroup string) (VirtualMachineListResultPage, error)
- func (az *AzureClient) RestartVirtualMachine(ctx context.Context, resourceGroup, name string) error
- func (az *AzureClient) RestartVirtualMachineScaleSets(ctx context.Context, resourceGroup string, virtualMachineScaleSet string, ...) error
- func (az *AzureClient) SetVirtualMachineScaleSetCapacity(ctx context.Context, resourceGroup, virtualMachineScaleSet string, ...) error
- func (az *AzureClient) ValidateTemplate(ctx context.Context, resourceGroupName string, deploymentName string, ...) (result resources.DeploymentValidateResult, err error)
- type AzureStorageClient
- func (as *AzureStorageClient) CreateContainer(containerName string, options *azStorage.CreateContainerOptions) (bool, error)
- func (as *AzureStorageClient) DeleteBlob(vhdContainer, vhdBlob string, options *azStorage.DeleteBlobOptions) error
- func (as *AzureStorageClient) SaveBlockBlob(containerName, blobName string, b []byte, options *azStorage.PutBlobOptions) error
- type DeploymentError
- type DeploymentOperationsListResultPage
- type DeploymentValidationError
- type DiskListPage
- type KubernetesClient
- type KubernetesClientSetClient
- func (c *KubernetesClientSetClient) DeleteNode(name string) error
- func (c *KubernetesClientSetClient) DeletePod(pod *v1.Pod) error
- func (c *KubernetesClientSetClient) DeleteServiceAccount(sa *v1.ServiceAccount) error
- func (c *KubernetesClientSetClient) EvictPod(pod *v1.Pod, policyGroupVersion string) error
- func (c *KubernetesClientSetClient) GetDeployment(namespace, name string) (*appsv1.Deployment, error)
- func (c *KubernetesClientSetClient) GetNode(name string) (*v1.Node, error)
- func (c *KubernetesClientSetClient) ListAllPods() (*v1.PodList, error)
- func (c *KubernetesClientSetClient) ListNodes() (*v1.NodeList, error)
- func (c *KubernetesClientSetClient) ListPods(node *v1.Node) (*v1.PodList, error)
- func (c *KubernetesClientSetClient) ListServiceAccounts(namespace string) (*v1.ServiceAccountList, error)
- func (c *KubernetesClientSetClient) SupportEviction() (string, error)
- func (c *KubernetesClientSetClient) UpdateDeployment(namespace string, deployment *appsv1.Deployment) (*appsv1.Deployment, error)
- func (c *KubernetesClientSetClient) UpdateNode(node *v1.Node) (*v1.Node, error)
- func (c *KubernetesClientSetClient) WaitForDelete(logger *log.Entry, pods []v1.Pod, usingEviction bool) ([]v1.Pod, error)
- type MockAKSEngineClient
- func (mc *MockAKSEngineClient) AddAcceptLanguages(languages []string)
- func (mc *MockAKSEngineClient) AddAuxiliaryTokens(tokens []string)
- func (mc *MockAKSEngineClient) CreateApp(ctx context.Context, applicationName, applicationURL string, ...) (result graphrbac.Application, servicePrincipalObjectID, secret string, ...)
- func (mc *MockAKSEngineClient) CreateGraphApplication(ctx context.Context, ...) (graphrbac.Application, error)
- func (mc *MockAKSEngineClient) CreateGraphPrincipal(ctx context.Context, ...) (graphrbac.ServicePrincipal, error)
- func (mc *MockAKSEngineClient) CreateRoleAssignment(ctx context.Context, scope string, roleAssignmentName string, ...) (authorization.RoleAssignment, error)
- func (mc *MockAKSEngineClient) CreateRoleAssignmentSimple(ctx context.Context, applicationID, roleID string) error
- func (mc *MockAKSEngineClient) CreateUserAssignedID(location string, resourceGroup string, userAssignedID string) (*msi.Identity, error)
- func (mc *MockAKSEngineClient) DeleteApp(ctx context.Context, appName, applicationObjectID string) (response autorest.Response, err error)
- func (mc *MockAKSEngineClient) DeleteManagedDisk(ctx context.Context, resourceGroupName string, diskName string) error
- func (mc *MockAKSEngineClient) DeleteNetworkInterface(ctx context.Context, resourceGroup, nicName string) error
- func (mc *MockAKSEngineClient) DeleteRoleAssignmentByID(ctx context.Context, roleAssignmentID string) (authorization.RoleAssignment, error)
- func (mc *MockAKSEngineClient) DeleteVirtualMachine(ctx context.Context, resourceGroup, name string) error
- func (mc *MockAKSEngineClient) DeleteVirtualMachineScaleSetVM(ctx context.Context, resourceGroup, virtualMachineScaleSet, instanceID string) error
- func (mc *MockAKSEngineClient) DeployTemplate(ctx context.Context, resourceGroup, name string, ...) (de resources.DeploymentExtended, err error)
- func (mc *MockAKSEngineClient) EnsureResourceGroup(ctx context.Context, resourceGroup, location string, managedBy *string) (*resources.Group, error)
- func (mc *MockAKSEngineClient) GetAvailabilitySet(ctx context.Context, resourceGroup, availabilitySetName string) (compute.AvailabilitySet, error)
- func (mc *MockAKSEngineClient) GetAvailabilitySetFaultDomainCount(ctx context.Context, resourceGroup string, vmasIDs []string) (int, error)
- func (mc *MockAKSEngineClient) GetKubernetesClient(apiserverURL, kubeConfig string, interval, timeout time.Duration) (KubernetesClient, error)
- func (mc *MockAKSEngineClient) GetStorageClient(ctx context.Context, resourceGroup, accountName string) (AKSStorageClient, error)
- func (mc *MockAKSEngineClient) GetVirtualMachine(ctx context.Context, resourceGroup, name string) (compute.VirtualMachine, error)
- func (mc *MockAKSEngineClient) ListDeploymentOperations(ctx context.Context, resourceGroupName string, deploymentName string, ...) (result DeploymentOperationsListResultPage, err error)
- func (mc *MockAKSEngineClient) ListDeploymentOperationsNextResults(lastResults resources.DeploymentOperationsListResult) (result resources.DeploymentOperationsListResult, err error)
- func (mc *MockAKSEngineClient) ListManagedDisksByResourceGroup(ctx context.Context, resourceGroupName string) (result DiskListPage, err error)
- func (mc *MockAKSEngineClient) ListProviders(ctx context.Context) (ProviderListResultPage, error)
- func (mc *MockAKSEngineClient) ListRoleAssignmentsForPrincipal(ctx context.Context, scope string, principalID string) (RoleAssignmentListResultPage, error)
- func (mc *MockAKSEngineClient) ListVirtualMachineScaleSetVMs(ctx context.Context, resourceGroup, virtualMachineScaleSet string) (VirtualMachineScaleSetVMListResultPage, error)
- func (mc *MockAKSEngineClient) ListVirtualMachineScaleSets(ctx context.Context, resourceGroup string) (VirtualMachineScaleSetListResultPage, error)
- func (mc *MockAKSEngineClient) ListVirtualMachines(ctx context.Context, resourceGroup string) (VirtualMachineListResultPage, error)
- func (mc *MockAKSEngineClient) MakeFakeVirtualMachine(vmName string, orchestratorVersion string) compute.VirtualMachine
- func (mc *MockAKSEngineClient) MakeFakeVirtualMachineScaleSetVM(orchestratorTag string) compute.VirtualMachineScaleSetVM
- func (mc *MockAKSEngineClient) MakeFakeVirtualMachineScaleSetVMWithGivenName(orchestratorTag string, computerName string) compute.VirtualMachineScaleSetVM
- func (mc *MockAKSEngineClient) RestartVirtualMachine(ctx context.Context, resourceGroup, name string) error
- func (mc *MockAKSEngineClient) RestartVirtualMachineScaleSets(ctx context.Context, resourceGroup, name string, ...) error
- func (mc *MockAKSEngineClient) SetVirtualMachineScaleSetCapacity(ctx context.Context, resourceGroup, virtualMachineScaleSet string, ...) error
- type MockDeploymentOperationsListResultPage
- func (page *MockDeploymentOperationsListResultPage) Next() error
- func (page MockDeploymentOperationsListResultPage) NotDone() bool
- func (page MockDeploymentOperationsListResultPage) Response() resources.DeploymentOperationsListResult
- func (page MockDeploymentOperationsListResultPage) Values() []resources.DeploymentOperation
- type MockKubernetesClient
- func (mkc *MockKubernetesClient) DeleteNode(name string) error
- func (mkc *MockKubernetesClient) DeletePod(pod *v1.Pod) error
- func (mkc *MockKubernetesClient) DeleteServiceAccount(sa *v1.ServiceAccount) error
- func (mkc *MockKubernetesClient) EvictPod(pod *v1.Pod, policyGroupVersion string) error
- func (mkc *MockKubernetesClient) GetDeployment(namespace, name string) (*appsv1.Deployment, error)
- func (mkc *MockKubernetesClient) GetNode(name string) (*v1.Node, error)
- func (mkc *MockKubernetesClient) ListAllPods() (*v1.PodList, error)
- func (mkc *MockKubernetesClient) ListNodes() (*v1.NodeList, error)
- func (mkc *MockKubernetesClient) ListPods(node *v1.Node) (*v1.PodList, error)
- func (mkc *MockKubernetesClient) ListServiceAccounts(namespace string) (*v1.ServiceAccountList, error)
- func (mkc *MockKubernetesClient) SupportEviction() (string, error)
- func (mkc *MockKubernetesClient) UpdateDeployment(namespace string, deployment *appsv1.Deployment) (*appsv1.Deployment, error)
- func (mkc *MockKubernetesClient) UpdateNode(node *v1.Node) (*v1.Node, error)
- func (mkc *MockKubernetesClient) WaitForDelete(logger *log.Entry, pods []v1.Pod, usingEviction bool) ([]v1.Pod, error)
- type MockRoleAssignmentListResultPage
- type MockStorageClient
- func (msc *MockStorageClient) CreateContainer(container string, options *azStorage.CreateContainerOptions) (bool, error)
- func (msc *MockStorageClient) DeleteBlob(container, blob string, options *azStorage.DeleteBlobOptions) error
- func (msc *MockStorageClient) SaveBlockBlob(container, blob string, b []byte, options *azStorage.PutBlobOptions) error
- type MockVirtualMachineListResultPage
- type MockVirtualMachineScaleSetListResultPage
- func (page *MockVirtualMachineScaleSetListResultPage) Next() error
- func (page *MockVirtualMachineScaleSetListResultPage) NextWithContext(context context.Context) error
- func (page MockVirtualMachineScaleSetListResultPage) NotDone() bool
- func (page MockVirtualMachineScaleSetListResultPage) Response() compute.VirtualMachineScaleSetListResult
- func (page MockVirtualMachineScaleSetListResultPage) Values() []compute.VirtualMachineScaleSet
- type MockVirtualMachineScaleSetVMListResultPage
- func (page *MockVirtualMachineScaleSetVMListResultPage) Next() error
- func (page *MockVirtualMachineScaleSetVMListResultPage) NextWithContext(ctx context.Context) error
- func (page MockVirtualMachineScaleSetVMListResultPage) NotDone() bool
- func (page MockVirtualMachineScaleSetVMListResultPage) Response() compute.VirtualMachineScaleSetVMListResult
- func (page MockVirtualMachineScaleSetVMListResultPage) Values() []compute.VirtualMachineScaleSetVM
- type ProviderListResultPage
- type RoleAssignmentListResultPage
- type VirtualMachineListResultPage
- type VirtualMachineScaleSetListResultPage
- type VirtualMachineScaleSetVMListResultPage
Constants ¶
const ( // AADContributorRoleID is the role id that exists in every subscription for 'Contributor' AADContributorRoleID = "b24988ac-6180-42a0-ab88-20f7382dd24c" // AADRoleReferenceTemplate is a template for a roleDefinitionId AADRoleReferenceTemplate = "/subscriptions/%s/providers/Microsoft.Authorization/roleDefinitions/%s" // AADRoleResourceGroupScopeTemplate is a template for a roleDefinition scope AADRoleResourceGroupScopeTemplate = "/subscriptions/%s/resourceGroups/%s" )
const (
// ApplicationDir is the name of the dir where the token is cached
ApplicationDir = ".acsengine"
)
const DefaultARMOperationTimeout = 150 * time.Minute
DefaultARMOperationTimeout defines a default (permissive) ARM operation timeout
const (
//DefaultFakeVMName is the default name assigned to VMs part of FakeListVirtualMachineScaleSetVMsResult and FakeListVirtualMachineResult
DefaultFakeVMName = "k8s-agentpool1-12345678-0"
)
Variables ¶
var ( // RequiredResourceProviders is the list of Azure Resource Providers needed for AKS Engine to function RequiredResourceProviders = []string{"Microsoft.Compute", "Microsoft.Storage", "Microsoft.Network"} )
Functions ¶
func DeployTemplateSync ¶
func DeployTemplateSync(az AKSEngineClient, logger *logrus.Entry, resourceGroupName, deploymentName string, template map[string]interface{}, parameters map[string]interface{}) error
DeployTemplateSync deploys the template and returns ArmError
Types ¶
type AKSEngineClient ¶
type AKSEngineClient interface { //AddAcceptLanguages sets the list of languages to accept on this request AddAcceptLanguages(languages []string) // AddAuxiliaryTokens sets the list of aux tokens to accept on this request AddAuxiliaryTokens(tokens []string) // DeployTemplate can deploy a template into Azure ARM DeployTemplate(ctx context.Context, resourceGroup, name string, template, parameters map[string]interface{}) (resources.DeploymentExtended, error) // EnsureResourceGroup ensures the specified resource group exists in the specified location EnsureResourceGroup(ctx context.Context, resourceGroup, location string, managedBy *string) (*resources.Group, error) // List lists VM resources ListVirtualMachines(ctx context.Context, resourceGroup string) (VirtualMachineListResultPage, error) // GetVirtualMachine retrieves the specified virtual machine. GetVirtualMachine(ctx context.Context, resourceGroup, name string) (compute.VirtualMachine, error) // RestartVirtualMachine restarts the specified virtual machine. RestartVirtualMachine(ctx context.Context, resourceGroup, name string) error // DeleteVirtualMachine deletes the specified virtual machine. DeleteVirtualMachine(ctx context.Context, resourceGroup, name string) error // ListVirtualMachineScaleSets lists the VMSS resources in the resource group ListVirtualMachineScaleSets(ctx context.Context, resourceGroup string) (VirtualMachineScaleSetListResultPage, error) // RestartVirtualMachineScaleSets restarts the specified VMSS RestartVirtualMachineScaleSets(ctx context.Context, resourceGroup, virtualMachineScaleSet string, instanceIDs *compute.VirtualMachineScaleSetVMInstanceIDs) error // ListVirtualMachineScaleSetVMs lists the virtual machines contained in a VMSS ListVirtualMachineScaleSetVMs(ctx context.Context, resourceGroup, virtualMachineScaleSet string) (VirtualMachineScaleSetVMListResultPage, error) // DeleteVirtualMachineScaleSetVM deletes a VM in a VMSS DeleteVirtualMachineScaleSetVM(ctx context.Context, resourceGroup, virtualMachineScaleSet, instanceID string) error // SetVirtualMachineScaleSetCapacity sets the VMSS capacity SetVirtualMachineScaleSetCapacity(ctx context.Context, resourceGroup, virtualMachineScaleSet string, sku compute.Sku, location string) error // GetAvailabilitySet retrieves the specified VM availability set. GetAvailabilitySet(ctx context.Context, resourceGroup, availabilitySet string) (compute.AvailabilitySet, error) // GetAvailabilitySetFaultDomainCount returns the first platform fault domain count it finds from the // VM availability set IDs provided. GetAvailabilitySetFaultDomainCount(ctx context.Context, resourceGroup string, vmasIDs []string) (int, error) // GetStorageClient uses SRP to retrieve keys, and then an authenticated client for talking to the specified storage // account. GetStorageClient(ctx context.Context, resourceGroup, accountName string) (AKSStorageClient, error) // DeleteNetworkInterface deletes the specified network interface. DeleteNetworkInterface(ctx context.Context, resourceGroup, nicName string) error // CreateGraphAppliction creates an application via the graphrbac client CreateGraphApplication(ctx context.Context, applicationCreateParameters graphrbac.ApplicationCreateParameters) (graphrbac.Application, error) // CreateGraphPrincipal creates a service principal via the graphrbac client CreateGraphPrincipal(ctx context.Context, servicePrincipalCreateParameters graphrbac.ServicePrincipalCreateParameters) (graphrbac.ServicePrincipal, error) CreateApp(ctx context.Context, applicationName, applicationURL string, replyURLs *[]string, requiredResourceAccess *[]graphrbac.RequiredResourceAccess) (result graphrbac.Application, servicePrincipalObjectID, secret string, err error) DeleteApp(ctx context.Context, applicationName, applicationObjectID string) (autorest.Response, error) // User Assigned MSI //CreateUserAssignedID - Creates a user assigned msi. CreateUserAssignedID(location string, resourceGroup string, userAssignedID string) (*msi.Identity, error) // RBAC CreateRoleAssignment(ctx context.Context, scope string, roleAssignmentName string, parameters authorization.RoleAssignmentCreateParameters) (authorization.RoleAssignment, error) CreateRoleAssignmentSimple(ctx context.Context, applicationID, roleID string) error DeleteRoleAssignmentByID(ctx context.Context, roleAssignmentNameID string) (authorization.RoleAssignment, error) ListRoleAssignmentsForPrincipal(ctx context.Context, scope string, principalID string) (RoleAssignmentListResultPage, error) // MANAGED DISKS DeleteManagedDisk(ctx context.Context, resourceGroupName string, diskName string) error ListManagedDisksByResourceGroup(ctx context.Context, resourceGroupName string) (result DiskListPage, err error) GetKubernetesClient(apiserverURL, kubeConfig string, interval, timeout time.Duration) (KubernetesClient, error) ListProviders(ctx context.Context) (ProviderListResultPage, error) // ListDeploymentOperations gets all deployments operations for a deployment. ListDeploymentOperations(ctx context.Context, resourceGroupName string, deploymentName string, top *int32) (result DeploymentOperationsListResultPage, err error) }
AKSEngineClient is the interface used to talk to an Azure environment. This interface exposes just the subset of Azure APIs and clients needed for AKS Engine.
type AKSStorageClient ¶
type AKSStorageClient interface { // DeleteBlob deletes the specified blob in the specified container. DeleteBlob(containerName, blobName string, options *azStorage.DeleteBlobOptions) error // CreateContainer creates the CloudBlobContainer if it does not exist CreateContainer(containerName string, options *azStorage.CreateContainerOptions) (bool, error) // SaveBlockBlob initializes a block blob by taking the byte SaveBlockBlob(containerName, blobName string, b []byte, options *azStorage.PutBlobOptions) error }
AKSStorageClient interface models the azure storage client
type AzureClient ¶
type AzureClient struct {
// contains filtered or unexported fields
}
AzureClient implements the `AKSEngineClient` interface. This client is backed by real Azure clients talking to an ARM endpoint.
func NewAzureClientWithCLI ¶ added in v0.29.0
func NewAzureClientWithCLI(env azure.Environment, subscriptionID string) (*AzureClient, error)
NewAzureClientWithCLI creates an AzureClient configured from Azure CLI 2.0 for local development scenarios.
func NewAzureClientWithClientCertificate ¶
func NewAzureClientWithClientCertificate(env azure.Environment, subscriptionID, clientID string, certificate *x509.Certificate, privateKey *rsa.PrivateKey) (*AzureClient, error)
NewAzureClientWithClientCertificate returns an AzureClient via client_id and jwt certificate assertion
func NewAzureClientWithClientCertificateExternalTenant ¶
func NewAzureClientWithClientCertificateExternalTenant(env azure.Environment, subscriptionID, tenantID, clientID string, certificate *x509.Certificate, privateKey *rsa.PrivateKey) (*AzureClient, error)
NewAzureClientWithClientCertificateExternalTenant returns an AzureClient via client_id and jwt certificate assertion against a 3rd party tenant
func NewAzureClientWithClientCertificateFile ¶
func NewAzureClientWithClientCertificateFile(env azure.Environment, subscriptionID, clientID, certificatePath, privateKeyPath string) (*AzureClient, error)
NewAzureClientWithClientCertificateFile returns an AzureClient via client_id and jwt certificate assertion
func NewAzureClientWithClientSecret ¶
func NewAzureClientWithClientSecret(env azure.Environment, subscriptionID, clientID, clientSecret string) (*AzureClient, error)
NewAzureClientWithClientSecret returns an AzureClient via client_id and client_secret
func NewAzureClientWithClientSecretExternalTenant ¶
func NewAzureClientWithClientSecretExternalTenant(env azure.Environment, subscriptionID, tenantID, clientID, clientSecret string) (*AzureClient, error)
NewAzureClientWithClientSecretExternalTenant returns an AzureClient via client_id and client_secret from a tenant
func NewAzureClientWithDeviceAuth ¶
func NewAzureClientWithDeviceAuth(env azure.Environment, subscriptionID string) (*AzureClient, error)
NewAzureClientWithDeviceAuth returns an AzureClient by having a user complete a device authentication flow
func (*AzureClient) AddAcceptLanguages ¶
func (az *AzureClient) AddAcceptLanguages(languages []string)
AddAcceptLanguages sets the list of languages to accept on this request
func (*AzureClient) AddAuxiliaryTokens ¶
func (az *AzureClient) AddAuxiliaryTokens(tokens []string)
AddAuxiliaryTokens sets the list of aux tokens to accept on this request
func (*AzureClient) CheckDeploymentExistence ¶
func (az *AzureClient) CheckDeploymentExistence(ctx context.Context, resourceGroupName string, deploymentName string) (result autorest.Response, err error)
CheckDeploymentExistence returns if the deployment already exists
func (*AzureClient) CheckResourceGroupExistence ¶
func (az *AzureClient) CheckResourceGroupExistence(ctx context.Context, name string) (result autorest.Response, err error)
CheckResourceGroupExistence return if the resource group exists
func (*AzureClient) CreateApp ¶
func (az *AzureClient) CreateApp(ctx context.Context, appName, appURL string, replyURLs *[]string, requiredResourceAccess *[]graphrbac.RequiredResourceAccess) (applicationResp graphrbac.Application, servicePrincipalObjectID, servicePrincipalClientSecret string, err error)
CreateApp is a simpler method for creating an application
func (*AzureClient) CreateGraphApplication ¶
func (az *AzureClient) CreateGraphApplication(ctx context.Context, applicationCreateParameters graphrbac.ApplicationCreateParameters) (graphrbac.Application, error)
CreateGraphApplication creates an application via the graphrbac client
func (*AzureClient) CreateGraphPrincipal ¶
func (az *AzureClient) CreateGraphPrincipal(ctx context.Context, servicePrincipalCreateParameters graphrbac.ServicePrincipalCreateParameters) (graphrbac.ServicePrincipal, error)
CreateGraphPrincipal creates a service principal via the graphrbac client
func (*AzureClient) CreateRoleAssignment ¶
func (az *AzureClient) CreateRoleAssignment(ctx context.Context, scope string, roleAssignmentName string, parameters authorization.RoleAssignmentCreateParameters) (authorization.RoleAssignment, error)
CreateRoleAssignment creates a role assignment via the authorization client
func (*AzureClient) CreateRoleAssignmentSimple ¶
func (az *AzureClient) CreateRoleAssignmentSimple(ctx context.Context, resourceGroup, servicePrincipalObjectID string) error
CreateRoleAssignmentSimple is a wrapper around RoleAssignmentsClient.Create
func (*AzureClient) CreateUserAssignedID ¶
func (az *AzureClient) CreateUserAssignedID(location string, resourceGroup string, userAssignedID string) (id *msi.Identity, err error)
CreateUserAssignedID - Creates a user assigned msi.
func (*AzureClient) DeleteApp ¶
func (az *AzureClient) DeleteApp(ctx context.Context, applicationName, applicationObjectID string) (autorest.Response, error)
DeleteApp is a simpler method for deleting an application and the associated spn
func (*AzureClient) DeleteGraphApplication ¶
func (az *AzureClient) DeleteGraphApplication(ctx context.Context, applicationObjectID string) (result autorest.Response, err error)
DeleteGraphApplication deletes an application via the graphrbac client
func (*AzureClient) DeleteManagedDisk ¶
func (az *AzureClient) DeleteManagedDisk(ctx context.Context, resourceGroupName string, diskName string) error
DeleteManagedDisk deletes a managed disk.
func (*AzureClient) DeleteNetworkInterface ¶
func (az *AzureClient) DeleteNetworkInterface(ctx context.Context, resourceGroup, nicName string) error
DeleteNetworkInterface deletes the specified network interface.
func (*AzureClient) DeleteResourceGroup ¶
func (az *AzureClient) DeleteResourceGroup(ctx context.Context, name string) error
DeleteResourceGroup delete the named resource group
func (*AzureClient) DeleteRoleAssignmentByID ¶
func (az *AzureClient) DeleteRoleAssignmentByID(ctx context.Context, roleAssignmentID string) (authorization.RoleAssignment, error)
DeleteRoleAssignmentByID deletes a roleAssignment via its unique identifier
func (*AzureClient) DeleteVirtualMachine ¶
func (az *AzureClient) DeleteVirtualMachine(ctx context.Context, resourceGroup, name string) error
DeleteVirtualMachine handles deletion of a CRP/VMAS VM (aka, not a VMSS VM).
func (*AzureClient) DeleteVirtualMachineScaleSet ¶ added in v0.30.0
func (az *AzureClient) DeleteVirtualMachineScaleSet(ctx context.Context, resourceGroup, vmssName string) error
DeleteVirtualMachineScaleSet deletes an entire VM Scale Set.
func (*AzureClient) DeleteVirtualMachineScaleSetVM ¶
func (az *AzureClient) DeleteVirtualMachineScaleSetVM(ctx context.Context, resourceGroup, virtualMachineScaleSet, instanceID string) error
DeleteVirtualMachineScaleSetVM deletes a VM in a VMSS
func (*AzureClient) DeployTemplate ¶
func (az *AzureClient) DeployTemplate(ctx context.Context, resourceGroupName, deploymentName string, template map[string]interface{}, parameters map[string]interface{}) (de resources.DeploymentExtended, err error)
DeployTemplate implements the TemplateDeployer interface for the AzureClient client
func (*AzureClient) EnsureProvidersRegistered ¶
func (az *AzureClient) EnsureProvidersRegistered(subscriptionID string) error
EnsureProvidersRegistered checks if the AzureClient is registered to required resource providers and, if not, register subscription to providers
func (*AzureClient) EnsureResourceGroup ¶
func (az *AzureClient) EnsureResourceGroup(ctx context.Context, name, location string, managedBy *string) (resourceGroup *resources.Group, err error)
EnsureResourceGroup ensures the named resource group exists in the given location.
func (*AzureClient) GetAvailabilitySet ¶ added in v0.37.0
func (az *AzureClient) GetAvailabilitySet(ctx context.Context, resourceGroup, availabilitySetName string) (compute.AvailabilitySet, error)
GetAvailabilitySet retrieves the specified VM availability set.
func (*AzureClient) GetAvailabilitySetFaultDomainCount ¶ added in v0.37.0
func (az *AzureClient) GetAvailabilitySetFaultDomainCount(ctx context.Context, resourceGroup string, vmasIDs []string) (int, error)
GetAvailabilitySetFaultDomainCount returns the first existing fault domain count it finds from the IDs provided.
func (*AzureClient) GetDeployment ¶
func (az *AzureClient) GetDeployment(ctx context.Context, resourceGroupName, deploymentName string) (result resources.DeploymentExtended, err error)
GetDeployment returns the template deployment
func (*AzureClient) GetKubernetesClient ¶
func (az *AzureClient) GetKubernetesClient(apiserverURL, kubeConfig string, interval, timeout time.Duration) (KubernetesClient, error)
GetKubernetesClient returns a KubernetesClient hooked up to the api server at the apiserverURL.
func (*AzureClient) GetStorageClient ¶
func (az *AzureClient) GetStorageClient(ctx context.Context, resourceGroup, accountName string) (AKSStorageClient, error)
GetStorageClient returns an authenticated client for the specified account.
func (*AzureClient) GetVirtualMachine ¶
func (az *AzureClient) GetVirtualMachine(ctx context.Context, resourceGroup, name string) (compute.VirtualMachine, error)
GetVirtualMachine returns the specified machine in the specified resource group.
func (*AzureClient) ListDeploymentOperations ¶
func (az *AzureClient) ListDeploymentOperations(ctx context.Context, resourceGroupName string, deploymentName string, top *int32) (DeploymentOperationsListResultPage, error)
ListDeploymentOperations gets all deployments operations for a deployment.
func (*AzureClient) ListManagedDisksByResourceGroup ¶
func (az *AzureClient) ListManagedDisksByResourceGroup(ctx context.Context, resourceGroupName string) (result DiskListPage, err error)
ListManagedDisksByResourceGroup lists managed disks in a resource group.
func (*AzureClient) ListProviders ¶
func (az *AzureClient) ListProviders(ctx context.Context) (ProviderListResultPage, error)
ListProviders returns all the providers for a given AzureClient
func (*AzureClient) ListRoleAssignmentsForPrincipal ¶
func (az *AzureClient) ListRoleAssignmentsForPrincipal(ctx context.Context, scope string, principalID string) (RoleAssignmentListResultPage, error)
ListRoleAssignmentsForPrincipal (e.g. a VM) via the scope and the unique identifier of the principal
func (*AzureClient) ListVirtualMachineScaleSetVMs ¶
func (az *AzureClient) ListVirtualMachineScaleSetVMs(ctx context.Context, resourceGroup, virtualMachineScaleSet string) (VirtualMachineScaleSetVMListResultPage, error)
ListVirtualMachineScaleSetVMs returns the list of VMs per VMSS
func (*AzureClient) ListVirtualMachineScaleSets ¶
func (az *AzureClient) ListVirtualMachineScaleSets(ctx context.Context, resourceGroup string) (VirtualMachineScaleSetListResultPage, error)
ListVirtualMachineScaleSets returns (the first page of) the VMSS resources in the specified resource group.
func (*AzureClient) ListVirtualMachines ¶
func (az *AzureClient) ListVirtualMachines(ctx context.Context, resourceGroup string) (VirtualMachineListResultPage, error)
ListVirtualMachines returns (the first page of) the machines in the specified resource group.
func (*AzureClient) RestartVirtualMachine ¶ added in v0.35.0
func (az *AzureClient) RestartVirtualMachine(ctx context.Context, resourceGroup, name string) error
RestartVirtualMachine restarts the specified virtual machine.
func (*AzureClient) RestartVirtualMachineScaleSets ¶ added in v0.35.0
func (az *AzureClient) RestartVirtualMachineScaleSets(ctx context.Context, resourceGroup string, virtualMachineScaleSet string, instanceIDs *compute.VirtualMachineScaleSetVMInstanceIDs) error
RestartVirtualMachineScaleSets restarts the specified VMSS
func (*AzureClient) SetVirtualMachineScaleSetCapacity ¶
func (az *AzureClient) SetVirtualMachineScaleSetCapacity(ctx context.Context, resourceGroup, virtualMachineScaleSet string, sku compute.Sku, location string) error
SetVirtualMachineScaleSetCapacity sets the VMSS capacity
func (*AzureClient) ValidateTemplate ¶
func (az *AzureClient) ValidateTemplate( ctx context.Context, resourceGroupName string, deploymentName string, template map[string]interface{}, parameters map[string]interface{}) (result resources.DeploymentValidateResult, err error)
ValidateTemplate validate the template and parameters
type AzureStorageClient ¶
type AzureStorageClient struct {
// contains filtered or unexported fields
}
AzureStorageClient implements the StorageClient interface and wraps the Azure storage client.
func (*AzureStorageClient) CreateContainer ¶
func (as *AzureStorageClient) CreateContainer(containerName string, options *azStorage.CreateContainerOptions) (bool, error)
CreateContainer creates the CloudBlobContainer if it does not exist
func (*AzureStorageClient) DeleteBlob ¶
func (as *AzureStorageClient) DeleteBlob(vhdContainer, vhdBlob string, options *azStorage.DeleteBlobOptions) error
DeleteBlob deletes the specified blob TODO(colemick): why doesn't SDK give a way to just delete a blob by URI? it's what it ends up doing internally anyway...
func (*AzureStorageClient) SaveBlockBlob ¶
func (as *AzureStorageClient) SaveBlockBlob(containerName, blobName string, b []byte, options *azStorage.PutBlobOptions) error
SaveBlockBlob initializes a block blob by taking the byte
type DeploymentError ¶
type DeploymentError struct { DeploymentName string ResourceGroup string TopError error StatusCode int Response []byte ProvisioningState string OperationsLists []resources.DeploymentOperationsListResult }
DeploymentError contains the root deployment error along with deployment operation errors
func (*DeploymentError) Error ¶
func (e *DeploymentError) Error() string
Error implements error interface
type DeploymentOperationsListResultPage ¶
type DeploymentOperationsListResultPage interface { Next() error NotDone() bool Response() resources.DeploymentOperationsListResult Values() []resources.DeploymentOperation }
DeploymentOperationsListResultPage is an interface for resources.DeploymentOperationsListResultPage to aid in mocking
type DeploymentValidationError ¶
type DeploymentValidationError struct {
Err error
}
DeploymentValidationError contains validation error
func (*DeploymentValidationError) Error ¶
func (e *DeploymentValidationError) Error() string
Error implements error interface
type DiskListPage ¶ added in v0.34.0
type DiskListPage interface { Next() error NextWithContext(ctx context.Context) (err error) NotDone() bool Response() compute.DiskList Values() []compute.Disk }
DiskListPage is an interface for compute.DiskListPage to aid in mocking
type KubernetesClient ¶
type KubernetesClient interface { // ListPods returns Pods running on the passed in node. ListPods(node *v1.Node) (*v1.PodList, error) // ListPods returns all Pods running ListAllPods() (*v1.PodList, error) // ListNodes returns a list of Nodes registered in the api server. ListNodes() (*v1.NodeList, error) // ListServiceAccounts returns a list of Service Accounts in a namespace ListServiceAccounts(namespace string) (*v1.ServiceAccountList, error) // GetNode returns details about node with passed in name. GetNode(name string) (*v1.Node, error) // UpdateNode updates the node in the api server with the passed in info. UpdateNode(node *v1.Node) (*v1.Node, error) // DeleteNode deregisters node in the api server. DeleteNode(name string) error // SupportEviction queries the api server to discover if it supports eviction, and returns supported type if it is supported. SupportEviction() (string, error) // DeletePod deletes the passed in pod. DeletePod(pod *v1.Pod) error // DeleteServiceAccount deletes the passed in service account. DeleteServiceAccount(sa *v1.ServiceAccount) error // EvictPod evicts the passed in pod using the passed in api version. EvictPod(pod *v1.Pod, policyGroupVersion string) error // WaitForDelete waits until all pods are deleted. Returns all pods not deleted and an error on failure. WaitForDelete(logger *log.Entry, pods []v1.Pod, usingEviction bool) ([]v1.Pod, error) // GetDeployment returns a given deployment in a namespace. GetDeployment(namespace, name string) (*appsv1.Deployment, error) // UpdateDeployment updates a deployment to match the given specification. UpdateDeployment(namespace string, deployment *appsv1.Deployment) (*appsv1.Deployment, error) }
KubernetesClient interface models client for interacting with kubernetes api server
type KubernetesClientSetClient ¶
type KubernetesClientSetClient struct {
// contains filtered or unexported fields
}
KubernetesClientSetClient is a Kubernetes client hooked up to a live api server.
func (*KubernetesClientSetClient) DeleteNode ¶
func (c *KubernetesClientSetClient) DeleteNode(name string) error
DeleteNode deregisters the node in the api server.
func (*KubernetesClientSetClient) DeletePod ¶
func (c *KubernetesClientSetClient) DeletePod(pod *v1.Pod) error
DeletePod deletes the passed in pod.
func (*KubernetesClientSetClient) DeleteServiceAccount ¶ added in v0.35.0
func (c *KubernetesClientSetClient) DeleteServiceAccount(sa *v1.ServiceAccount) error
DeleteServiceAccount deletes the passed in service account.
func (*KubernetesClientSetClient) EvictPod ¶
func (c *KubernetesClientSetClient) EvictPod(pod *v1.Pod, policyGroupVersion string) error
EvictPod evicts the passed in pod using the passed in api version.
func (*KubernetesClientSetClient) GetDeployment ¶ added in v0.37.0
func (c *KubernetesClientSetClient) GetDeployment(namespace, name string) (*appsv1.Deployment, error)
GetDeployment returns a given deployment in a namespace.
func (*KubernetesClientSetClient) GetNode ¶
func (c *KubernetesClientSetClient) GetNode(name string) (*v1.Node, error)
GetNode returns details about node with passed in name.
func (*KubernetesClientSetClient) ListAllPods ¶ added in v0.35.0
func (c *KubernetesClientSetClient) ListAllPods() (*v1.PodList, error)
ListAllPods returns all Pods running.
func (*KubernetesClientSetClient) ListNodes ¶ added in v0.35.0
func (c *KubernetesClientSetClient) ListNodes() (*v1.NodeList, error)
ListNodes returns a list of Nodes registered in the api server.
func (*KubernetesClientSetClient) ListServiceAccounts ¶ added in v0.35.0
func (c *KubernetesClientSetClient) ListServiceAccounts(namespace string) (*v1.ServiceAccountList, error)
ListServiceAccounts returns a list of Service Accounts in the provided namespace.
func (*KubernetesClientSetClient) SupportEviction ¶
func (c *KubernetesClientSetClient) SupportEviction() (string, error)
SupportEviction queries the api server to discover if it supports eviction, and returns supported type if it is supported.
func (*KubernetesClientSetClient) UpdateDeployment ¶ added in v0.37.0
func (c *KubernetesClientSetClient) UpdateDeployment(namespace string, deployment *appsv1.Deployment) (*appsv1.Deployment, error)
UpdateDeployment updates a deployment to match the given specification.
func (*KubernetesClientSetClient) UpdateNode ¶
UpdateNode updates the node in the api server with the passed in info.
type MockAKSEngineClient ¶
type MockAKSEngineClient struct { FailDeployTemplate bool FailDeployTemplateQuota bool FailDeployTemplateConflict bool FailDeployTemplateWithProperties bool FailEnsureResourceGroup bool FailListVirtualMachines bool FailListVirtualMachinesTags bool FailListVirtualMachineScaleSets bool FailRestartVirtualMachineScaleSets bool FailGetVirtualMachine bool FailRestartVirtualMachine bool FailDeleteVirtualMachine bool FailDeleteVirtualMachineScaleSetVM bool FailSetVirtualMachineScaleSetCapacity bool FailListVirtualMachineScaleSetVMs bool FailGetStorageClient bool FailDeleteNetworkInterface bool FailGetKubernetesClient bool FailListProviders bool ShouldSupportVMIdentity bool FailDeleteRoleAssignment bool MockKubernetesClient *MockKubernetesClient FakeListVirtualMachineScaleSetsResult func() []compute.VirtualMachineScaleSet FakeListVirtualMachineResult func() []compute.VirtualMachine FakeListVirtualMachineScaleSetVMsResult func() []compute.VirtualMachineScaleSetVM }
MockAKSEngineClient is an implementation of AKSEngineClient where all requests error out
func (*MockAKSEngineClient) AddAcceptLanguages ¶
func (mc *MockAKSEngineClient) AddAcceptLanguages(languages []string)
AddAcceptLanguages mock
func (*MockAKSEngineClient) AddAuxiliaryTokens ¶
func (mc *MockAKSEngineClient) AddAuxiliaryTokens(tokens []string)
AddAuxiliaryTokens mock
func (*MockAKSEngineClient) CreateApp ¶
func (mc *MockAKSEngineClient) CreateApp(ctx context.Context, applicationName, applicationURL string, replyURLs *[]string, requiredResourceAccess *[]graphrbac.RequiredResourceAccess) (result graphrbac.Application, servicePrincipalObjectID, secret string, err error)
CreateApp is a simpler method for creating an application
func (*MockAKSEngineClient) CreateGraphApplication ¶
func (mc *MockAKSEngineClient) CreateGraphApplication(ctx context.Context, applicationCreateParameters graphrbac.ApplicationCreateParameters) (graphrbac.Application, error)
CreateGraphApplication creates an application via the graphrbac client
func (*MockAKSEngineClient) CreateGraphPrincipal ¶
func (mc *MockAKSEngineClient) CreateGraphPrincipal(ctx context.Context, servicePrincipalCreateParameters graphrbac.ServicePrincipalCreateParameters) (graphrbac.ServicePrincipal, error)
CreateGraphPrincipal creates a service principal via the graphrbac client
func (*MockAKSEngineClient) CreateRoleAssignment ¶
func (mc *MockAKSEngineClient) CreateRoleAssignment(ctx context.Context, scope string, roleAssignmentName string, parameters authorization.RoleAssignmentCreateParameters) (authorization.RoleAssignment, error)
CreateRoleAssignment creates a role assignment via the authorization client
func (*MockAKSEngineClient) CreateRoleAssignmentSimple ¶
func (mc *MockAKSEngineClient) CreateRoleAssignmentSimple(ctx context.Context, applicationID, roleID string) error
CreateRoleAssignmentSimple is a wrapper around RoleAssignmentsClient.Create
func (*MockAKSEngineClient) CreateUserAssignedID ¶
func (mc *MockAKSEngineClient) CreateUserAssignedID(location string, resourceGroup string, userAssignedID string) (*msi.Identity, error)
CreateUserAssignedID - Creates a user assigned msi.
func (*MockAKSEngineClient) DeleteApp ¶
func (mc *MockAKSEngineClient) DeleteApp(ctx context.Context, appName, applicationObjectID string) (response autorest.Response, err error)
DeleteApp is a simpler method for deleting an application
func (*MockAKSEngineClient) DeleteManagedDisk ¶
func (mc *MockAKSEngineClient) DeleteManagedDisk(ctx context.Context, resourceGroupName string, diskName string) error
DeleteManagedDisk is a wrapper around disksClient.Delete
func (*MockAKSEngineClient) DeleteNetworkInterface ¶
func (mc *MockAKSEngineClient) DeleteNetworkInterface(ctx context.Context, resourceGroup, nicName string) error
DeleteNetworkInterface mock
func (*MockAKSEngineClient) DeleteRoleAssignmentByID ¶
func (mc *MockAKSEngineClient) DeleteRoleAssignmentByID(ctx context.Context, roleAssignmentID string) (authorization.RoleAssignment, error)
DeleteRoleAssignmentByID deletes a roleAssignment via its unique identifier
func (*MockAKSEngineClient) DeleteVirtualMachine ¶
func (mc *MockAKSEngineClient) DeleteVirtualMachine(ctx context.Context, resourceGroup, name string) error
DeleteVirtualMachine mock
func (*MockAKSEngineClient) DeleteVirtualMachineScaleSetVM ¶
func (mc *MockAKSEngineClient) DeleteVirtualMachineScaleSetVM(ctx context.Context, resourceGroup, virtualMachineScaleSet, instanceID string) error
DeleteVirtualMachineScaleSetVM mock
func (*MockAKSEngineClient) DeployTemplate ¶
func (mc *MockAKSEngineClient) DeployTemplate(ctx context.Context, resourceGroup, name string, template, parameters map[string]interface{}) (de resources.DeploymentExtended, err error)
DeployTemplate mock
func (*MockAKSEngineClient) EnsureResourceGroup ¶
func (mc *MockAKSEngineClient) EnsureResourceGroup(ctx context.Context, resourceGroup, location string, managedBy *string) (*resources.Group, error)
EnsureResourceGroup mock
func (*MockAKSEngineClient) GetAvailabilitySet ¶ added in v0.37.0
func (mc *MockAKSEngineClient) GetAvailabilitySet(ctx context.Context, resourceGroup, availabilitySetName string) (compute.AvailabilitySet, error)
GetAvailabilitySet mock
func (*MockAKSEngineClient) GetAvailabilitySetFaultDomainCount ¶ added in v0.37.0
func (mc *MockAKSEngineClient) GetAvailabilitySetFaultDomainCount(ctx context.Context, resourceGroup string, vmasIDs []string) (int, error)
GetAvailabilitySetFaultDomainCount mock
func (*MockAKSEngineClient) GetKubernetesClient ¶
func (mc *MockAKSEngineClient) GetKubernetesClient(apiserverURL, kubeConfig string, interval, timeout time.Duration) (KubernetesClient, error)
GetKubernetesClient mock
func (*MockAKSEngineClient) GetStorageClient ¶
func (mc *MockAKSEngineClient) GetStorageClient(ctx context.Context, resourceGroup, accountName string) (AKSStorageClient, error)
GetStorageClient mock
func (*MockAKSEngineClient) GetVirtualMachine ¶
func (mc *MockAKSEngineClient) GetVirtualMachine(ctx context.Context, resourceGroup, name string) (compute.VirtualMachine, error)
GetVirtualMachine mock
func (*MockAKSEngineClient) ListDeploymentOperations ¶
func (mc *MockAKSEngineClient) ListDeploymentOperations(ctx context.Context, resourceGroupName string, deploymentName string, top *int32) (result DeploymentOperationsListResultPage, err error)
ListDeploymentOperations gets all deployments operations for a deployment.
func (*MockAKSEngineClient) ListDeploymentOperationsNextResults ¶
func (mc *MockAKSEngineClient) ListDeploymentOperationsNextResults(lastResults resources.DeploymentOperationsListResult) (result resources.DeploymentOperationsListResult, err error)
ListDeploymentOperationsNextResults retrieves the next set of results, if any.
func (*MockAKSEngineClient) ListManagedDisksByResourceGroup ¶
func (mc *MockAKSEngineClient) ListManagedDisksByResourceGroup(ctx context.Context, resourceGroupName string) (result DiskListPage, err error)
ListManagedDisksByResourceGroup is a wrapper around disksClient.ListManagedDisksByResourceGroup
func (*MockAKSEngineClient) ListProviders ¶
func (mc *MockAKSEngineClient) ListProviders(ctx context.Context) (ProviderListResultPage, error)
ListProviders mock
func (*MockAKSEngineClient) ListRoleAssignmentsForPrincipal ¶
func (mc *MockAKSEngineClient) ListRoleAssignmentsForPrincipal(ctx context.Context, scope string, principalID string) (RoleAssignmentListResultPage, error)
ListRoleAssignmentsForPrincipal (e.g. a VM) via the scope and the unique identifier of the principal
func (*MockAKSEngineClient) ListVirtualMachineScaleSetVMs ¶
func (mc *MockAKSEngineClient) ListVirtualMachineScaleSetVMs(ctx context.Context, resourceGroup, virtualMachineScaleSet string) (VirtualMachineScaleSetVMListResultPage, error)
ListVirtualMachineScaleSetVMs mock
func (*MockAKSEngineClient) ListVirtualMachineScaleSets ¶
func (mc *MockAKSEngineClient) ListVirtualMachineScaleSets(ctx context.Context, resourceGroup string) (VirtualMachineScaleSetListResultPage, error)
ListVirtualMachineScaleSets mock
func (*MockAKSEngineClient) ListVirtualMachines ¶
func (mc *MockAKSEngineClient) ListVirtualMachines(ctx context.Context, resourceGroup string) (VirtualMachineListResultPage, error)
ListVirtualMachines mock
func (*MockAKSEngineClient) MakeFakeVirtualMachine ¶ added in v0.32.0
func (mc *MockAKSEngineClient) MakeFakeVirtualMachine(vmName string, orchestratorVersion string) compute.VirtualMachine
MakeFakeVirtualMachine returns a fake compute.VirtualMachine
func (*MockAKSEngineClient) MakeFakeVirtualMachineScaleSetVM ¶ added in v0.32.0
func (mc *MockAKSEngineClient) MakeFakeVirtualMachineScaleSetVM(orchestratorTag string) compute.VirtualMachineScaleSetVM
MakeFakeVirtualMachineScaleSetVM creates a fake VMSS VM
func (*MockAKSEngineClient) MakeFakeVirtualMachineScaleSetVMWithGivenName ¶ added in v0.32.0
func (mc *MockAKSEngineClient) MakeFakeVirtualMachineScaleSetVMWithGivenName(orchestratorTag string, computerName string) compute.VirtualMachineScaleSetVM
MakeFakeVirtualMachineScaleSetVM creates a fake VMSS VM with name provided
func (*MockAKSEngineClient) RestartVirtualMachine ¶ added in v0.35.0
func (mc *MockAKSEngineClient) RestartVirtualMachine(ctx context.Context, resourceGroup, name string) error
RestartVirtualMachine mock
func (*MockAKSEngineClient) RestartVirtualMachineScaleSets ¶ added in v0.35.0
func (mc *MockAKSEngineClient) RestartVirtualMachineScaleSets(ctx context.Context, resourceGroup, name string, instanceIDs *compute.VirtualMachineScaleSetVMInstanceIDs) error
RestartVirtualMachineScaleSets mock
func (*MockAKSEngineClient) SetVirtualMachineScaleSetCapacity ¶
func (mc *MockAKSEngineClient) SetVirtualMachineScaleSetCapacity(ctx context.Context, resourceGroup, virtualMachineScaleSet string, sku compute.Sku, location string) error
SetVirtualMachineScaleSetCapacity mock
type MockDeploymentOperationsListResultPage ¶
type MockDeploymentOperationsListResultPage struct { Fn func(resources.DeploymentOperationsListResult) (resources.DeploymentOperationsListResult, error) Dolr resources.DeploymentOperationsListResult }
MockDeploymentOperationsListResultPage contains a page of DeploymentOperation values.
func (*MockDeploymentOperationsListResultPage) Next ¶
func (page *MockDeploymentOperationsListResultPage) Next() error
Next advances to the next page of values. If there was an error making the request the page does not advance and the error is returned.
func (MockDeploymentOperationsListResultPage) NotDone ¶
func (page MockDeploymentOperationsListResultPage) NotDone() bool
NotDone returns true if the page enumeration should be started or is not yet complete.
func (MockDeploymentOperationsListResultPage) Response ¶
func (page MockDeploymentOperationsListResultPage) Response() resources.DeploymentOperationsListResult
Response returns the raw server response from the last page request.
func (MockDeploymentOperationsListResultPage) Values ¶
func (page MockDeploymentOperationsListResultPage) Values() []resources.DeploymentOperation
Values returns the slice of values for the current page or nil if there are no values.
type MockKubernetesClient ¶
type MockKubernetesClient struct { FailListPods bool FailListNodes bool FailListServiceAccounts bool FailGetNode bool UpdateNodeFunc func(*v1.Node) (*v1.Node, error) GetNodeFunc func(name string) (*v1.Node, error) FailUpdateNode bool FailDeleteNode bool FailDeleteServiceAccount bool FailSupportEviction bool FailDeletePod bool FailEvictPod bool FailWaitForDelete bool ShouldSupportEviction bool PodsList *v1.PodList ServiceAccountList *v1.ServiceAccountList FailGetDeploymentCount int FailUpdateDeploymentCount int }
MockKubernetesClient mock implementation of KubernetesClient
func (*MockKubernetesClient) DeleteNode ¶
func (mkc *MockKubernetesClient) DeleteNode(name string) error
DeleteNode deregisters node in the api server
func (*MockKubernetesClient) DeletePod ¶
func (mkc *MockKubernetesClient) DeletePod(pod *v1.Pod) error
DeletePod deletes the passed in pod
func (*MockKubernetesClient) DeleteServiceAccount ¶ added in v0.35.0
func (mkc *MockKubernetesClient) DeleteServiceAccount(sa *v1.ServiceAccount) error
DeleteServiceAccount deletes the provided service account
func (*MockKubernetesClient) EvictPod ¶
func (mkc *MockKubernetesClient) EvictPod(pod *v1.Pod, policyGroupVersion string) error
EvictPod evicts the passed in pod using the passed in api version
func (*MockKubernetesClient) GetDeployment ¶ added in v0.37.0
func (mkc *MockKubernetesClient) GetDeployment(namespace, name string) (*appsv1.Deployment, error)
GetDeployment returns a given deployment in a namespace.
func (*MockKubernetesClient) GetNode ¶
func (mkc *MockKubernetesClient) GetNode(name string) (*v1.Node, error)
GetNode returns details about node with passed in name
func (*MockKubernetesClient) ListAllPods ¶ added in v0.35.0
func (mkc *MockKubernetesClient) ListAllPods() (*v1.PodList, error)
ListAllPods returns all Pods running
func (*MockKubernetesClient) ListNodes ¶ added in v0.35.0
func (mkc *MockKubernetesClient) ListNodes() (*v1.NodeList, error)
ListNodes returns a list of Nodes registered in the api server
func (*MockKubernetesClient) ListServiceAccounts ¶ added in v0.35.0
func (mkc *MockKubernetesClient) ListServiceAccounts(namespace string) (*v1.ServiceAccountList, error)
ListServiceAccounts returns a list of Service Accounts in the provided namespace
func (*MockKubernetesClient) SupportEviction ¶
func (mkc *MockKubernetesClient) SupportEviction() (string, error)
SupportEviction queries the api server to discover if it supports eviction, and returns supported type if it is supported
func (*MockKubernetesClient) UpdateDeployment ¶ added in v0.37.0
func (mkc *MockKubernetesClient) UpdateDeployment(namespace string, deployment *appsv1.Deployment) (*appsv1.Deployment, error)
UpdateDeployment updates a deployment to match the given specification.
func (*MockKubernetesClient) UpdateNode ¶
UpdateNode updates the node in the api server with the passed in info
type MockRoleAssignmentListResultPage ¶
type MockRoleAssignmentListResultPage struct { Fn func(authorization.RoleAssignmentListResult) (authorization.RoleAssignmentListResult, error) Ralr authorization.RoleAssignmentListResult }
MockRoleAssignmentListResultPage contains a page of RoleAssignment values.
func (*MockRoleAssignmentListResultPage) Next ¶
func (page *MockRoleAssignmentListResultPage) Next() error
Next advances to the next page of values. If there was an error making the request the page does not advance and the error is returned.
func (MockRoleAssignmentListResultPage) NotDone ¶
func (page MockRoleAssignmentListResultPage) NotDone() bool
NotDone returns true if the page enumeration should be started or is not yet complete.
func (MockRoleAssignmentListResultPage) Response ¶
func (page MockRoleAssignmentListResultPage) Response() authorization.RoleAssignmentListResult
Response returns the raw server response from the last page request.
func (MockRoleAssignmentListResultPage) Values ¶
func (page MockRoleAssignmentListResultPage) Values() []authorization.RoleAssignment
Values returns the slice of values for the current page or nil if there are no values.
type MockStorageClient ¶
MockStorageClient mock implementation of StorageClient
func (*MockStorageClient) CreateContainer ¶
func (msc *MockStorageClient) CreateContainer(container string, options *azStorage.CreateContainerOptions) (bool, error)
CreateContainer mock
func (*MockStorageClient) DeleteBlob ¶
func (msc *MockStorageClient) DeleteBlob(container, blob string, options *azStorage.DeleteBlobOptions) error
DeleteBlob mock
func (*MockStorageClient) SaveBlockBlob ¶
func (msc *MockStorageClient) SaveBlockBlob(container, blob string, b []byte, options *azStorage.PutBlobOptions) error
SaveBlockBlob mock
type MockVirtualMachineListResultPage ¶
type MockVirtualMachineListResultPage struct { Fn func(compute.VirtualMachineListResult) (compute.VirtualMachineListResult, error) Vmlr compute.VirtualMachineListResult }
MockVirtualMachineListResultPage contains a page of VirtualMachine values.
func (*MockVirtualMachineListResultPage) Next ¶
func (page *MockVirtualMachineListResultPage) Next() error
Next advances to the next page of values. If there was an error making the request the page does not advance and the error is returned.
func (MockVirtualMachineListResultPage) NotDone ¶
func (page MockVirtualMachineListResultPage) NotDone() bool
NotDone returns true if the page enumeration should be started or is not yet complete.
func (MockVirtualMachineListResultPage) Response ¶
func (page MockVirtualMachineListResultPage) Response() compute.VirtualMachineListResult
Response returns the raw server response from the last page request.
func (MockVirtualMachineListResultPage) Values ¶
func (page MockVirtualMachineListResultPage) Values() []compute.VirtualMachine
Values returns the slice of values for the current page or nil if there are no values.
type MockVirtualMachineScaleSetListResultPage ¶ added in v0.32.0
type MockVirtualMachineScaleSetListResultPage struct { Fn func(compute.VirtualMachineScaleSetListResult) (compute.VirtualMachineScaleSetListResult, error) Vmsslr compute.VirtualMachineScaleSetListResult }
MockVirtualMachineScaleSetListResultPage contains a page of VirtualMachine values.
func (*MockVirtualMachineScaleSetListResultPage) Next ¶ added in v0.32.0
func (page *MockVirtualMachineScaleSetListResultPage) Next() error
Next advances to the next page of values. If there was an error making the request the page does not advance and the error is returned.
func (*MockVirtualMachineScaleSetListResultPage) NextWithContext ¶ added in v0.32.0
func (page *MockVirtualMachineScaleSetListResultPage) NextWithContext(context context.Context) error
NextWithContext advances to the next page of values. If there was an error making the request the page does not advance and the error is returned. context is ignored in the mock impl.
func (MockVirtualMachineScaleSetListResultPage) NotDone ¶ added in v0.32.0
func (page MockVirtualMachineScaleSetListResultPage) NotDone() bool
NotDone returns true if the page enumeration should be started or is not yet complete.
func (MockVirtualMachineScaleSetListResultPage) Response ¶ added in v0.32.0
func (page MockVirtualMachineScaleSetListResultPage) Response() compute.VirtualMachineScaleSetListResult
Response returns the raw server response from the last page request.
func (MockVirtualMachineScaleSetListResultPage) Values ¶ added in v0.32.0
func (page MockVirtualMachineScaleSetListResultPage) Values() []compute.VirtualMachineScaleSet
Values returns the slice of values for the current page or nil if there are no values.
type MockVirtualMachineScaleSetVMListResultPage ¶ added in v0.32.0
type MockVirtualMachineScaleSetVMListResultPage struct { Fn func(compute.VirtualMachineScaleSetVMListResult) (compute.VirtualMachineScaleSetVMListResult, error) Vmssvlr compute.VirtualMachineScaleSetVMListResult }
MockVirtualMachineScaleSetVMListResultPage contains a page of VMSS VirtualMachine values.
func (*MockVirtualMachineScaleSetVMListResultPage) Next ¶ added in v0.32.0
func (page *MockVirtualMachineScaleSetVMListResultPage) Next() error
Next advances to the next page of values. If there was an error making the request the page does not advance and the error is returned.
func (*MockVirtualMachineScaleSetVMListResultPage) NextWithContext ¶ added in v0.32.0
func (page *MockVirtualMachineScaleSetVMListResultPage) NextWithContext(ctx context.Context) error
NextWithContext advances to the next page of values. If there was an error making the request the page does not advance and the error is returned. Context is ignored for the mock implementation
func (MockVirtualMachineScaleSetVMListResultPage) NotDone ¶ added in v0.32.0
func (page MockVirtualMachineScaleSetVMListResultPage) NotDone() bool
NotDone returns true if the page enumeration should be started or is not yet complete.
func (MockVirtualMachineScaleSetVMListResultPage) Response ¶ added in v0.32.0
func (page MockVirtualMachineScaleSetVMListResultPage) Response() compute.VirtualMachineScaleSetVMListResult
Response returns the raw server response from the last page request.
func (MockVirtualMachineScaleSetVMListResultPage) Values ¶ added in v0.32.0
func (page MockVirtualMachineScaleSetVMListResultPage) Values() []compute.VirtualMachineScaleSetVM
Values returns the slice of values for the current page or nil if there are no values.
type ProviderListResultPage ¶ added in v0.34.0
type ProviderListResultPage interface { Next() error NextWithContext(ctx context.Context) (err error) NotDone() bool Response() resources.ProviderListResult Values() []resources.Provider }
ProviderListResultPage is an interface for resources.ProviderListResultPage to aid in mocking
type RoleAssignmentListResultPage ¶
type RoleAssignmentListResultPage interface { Next() error NotDone() bool Response() authorization.RoleAssignmentListResult Values() []authorization.RoleAssignment }
RoleAssignmentListResultPage is an interface for authorization.RoleAssignmentListResultPage to aid in mocking
type VirtualMachineListResultPage ¶
type VirtualMachineListResultPage interface { Next() error NotDone() bool Response() compute.VirtualMachineListResult Values() []compute.VirtualMachine }
VirtualMachineListResultPage is an interface for compute.VirtualMachineListResultPage to aid in mocking
type VirtualMachineScaleSetListResultPage ¶ added in v0.32.0
type VirtualMachineScaleSetListResultPage interface { Next() error NextWithContext(ctx context.Context) (err error) NotDone() bool Response() compute.VirtualMachineScaleSetListResult Values() []compute.VirtualMachineScaleSet }
VirtualMachineScaleSetListResultPage is an interface for compute.VirtualMachineScaleSetListResultPage to aid in mocking
type VirtualMachineScaleSetVMListResultPage ¶ added in v0.32.0
type VirtualMachineScaleSetVMListResultPage interface { Next() error NextWithContext(ctx context.Context) (err error) NotDone() bool Response() compute.VirtualMachineScaleSetVMListResult Values() []compute.VirtualMachineScaleSetVM }
VirtualMachineScaleSetVMListResultPage is an interface for compute.VirtualMachineScaleSetListResultPage to aid in mocking
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package utils provides helper methods to assist with ARM operations.
|
Package utils provides helper methods to assist with ARM operations. |