Documentation
¶
Index ¶
- Constants
- Variables
- func GetErrorCategoryfromArmResponse(parsedErrorCode ARMOrResourceProviderErrorCode) apierror.ErrorCategory
- func IsErrorCodeRetryable(ctx context.Context, logger *log.Logger, resourceType ARMResourceType, ...) bool
- func IsErrorObjectIsBeingDeletedError(err string) bool
- func IsErrorObjectIsDeletedButRecoverableError(err string) bool
- func IsErrorPolicyDisallowedError(err string) bool
- func IsErrorPolicyViolationError(err string) bool
- func IsErrorRoleAssignmentLimitExceededError(err string) bool
- func IsErrorStringClientError(err string) (string, bool)
- func IsErrorStringConflictError(err string) bool
- func IsErrorStringDiskEncryptionSetError(err string) bool
- func IsErrorStringVMExtensionError(err string) (string, bool)
- func IsErrorStringVMSSProvisionError(err string) (string, bool)
- func IsVmExtensionErrorClientError(code string) bool
- func ParseRawError(err error) (apierror.ErrorCategory, apierror.ErrorCode, string)
- func ToErrorResponse(ctx context.Context, logger *log.Logger, ...) (apierror.ErrorResponse, error)
- type ARMOrResourceProviderErrorCode
- type ARMOrResourceProviderErrorMessage
- type ARMResourceProvider
- type ARMResourceType
- type VMExtensionErrorCode
Constants ¶
const ( // Snippet of error message to explain the error cause. ResourceGroupDeletionBlocked = "ResourceGroupDeletionBlocked" // resource type within error, used to identify ADAL resource type // adal package has two packageType "azure.multiTenantSPTAuthorizer" and "azure.BearerAuthorizer" // and both error have "WithAuthorization" method embedded. So we can safely check this message. ADALResourceWithinError = "WithAuthorization" )
const DefaultARMOperationTimeout = 150 * time.Minute
DefaultARMOperationTimeout defines a default (permissive) ARM operation timeout
Variables ¶
var ( PublicIPAddressesError = fmt.Errorf(string(PublicIPAddresses)) LoadBalancerError = fmt.Errorf(string(LoadBalancers)) PrivateLinkServicesError = fmt.Errorf(string(PrivateLinkServices)) PrivateEndpointsError = fmt.Errorf(string(PrivateEndpoints)) NATGatewayError = fmt.Errorf(string(NATGateway)) )
Functions ¶
func GetErrorCategoryfromArmResponse ¶
func GetErrorCategoryfromArmResponse(parsedErrorCode ARMOrResourceProviderErrorCode) apierror.ErrorCategory
GetErrorCategoryfromArmResponse returns the error category for an ARM Response Error Code
func IsErrorCodeRetryable ¶
func IsErrorCodeRetryable(ctx context.Context, logger *log.Logger, resourceType ARMResourceType, errorCode ARMOrResourceProviderErrorCode) bool
IsErrorCodeRetryable checks the error code returned by ARM (from ARM/Resource Provider) and determines if the error should be returned as retryable error so that the caller can retry ARM deployment operation
func IsErrorObjectIsBeingDeletedError ¶
IsErrorObjectIsBeingDeletedError checks whether ARM error string contains ObjectIsBeingDeleted
func IsErrorObjectIsDeletedButRecoverableError ¶
IsErrorObjectIsDeletedButRecoverableError checks whether ARM error string contains ObjectIsDeletedButRecoverable
func IsErrorPolicyDisallowedError ¶
IsErrorPolicyDisallowedError checks whether ARM error string contains RequestDisallowedByPolicy.
func IsErrorPolicyViolationError ¶
IsErrorPolicyViolationError determines if error string is a policy violation error or not
func IsErrorRoleAssignmentLimitExceededError ¶
IsErrorRoleAssignmentLimitExceededError checks whether ARM error string contains RoleAssignmentLimitExceeded
func IsErrorStringClientError ¶
IsErrorStringClientError determines an error string from azure sdk for go is client error or not, using default Arm list
func IsErrorStringConflictError ¶
IsErrorStringConflictError determines if error string is a ConflictError or not
func IsErrorStringDiskEncryptionSetError ¶
IsErrorStringDiskEncryptionSetError determines if error string is related to DiskEncryptionSet error
including following errors: KeyVaultAccessForbidden, DiskEncryptionSet not found
func IsErrorStringVMExtensionError ¶
IsErrorStringVMExtensionError determines an error string is VMExtensionError or not
func IsErrorStringVMSSProvisionError ¶
IsErrorStringVMSSProvisionError determines an error string is VMSSProvisionError or not
func IsVmExtensionErrorClientError ¶
IsVmExtensionErrorClientError determines an vm extension error is client error
func ParseRawError ¶
ParseRawError is trying to deduce error category, error code, related resource type all from err message body
func ToErrorResponse ¶
func ToErrorResponse(ctx context.Context, logger *log.Logger, operation resources.DeploymentOperation) (apierror.ErrorResponse, error)
ToErrorResponse parses ARM DeploymentOperationProperties object and determines if its an internal or client error.
Types ¶
type ARMOrResourceProviderErrorCode ¶
type ARMOrResourceProviderErrorCode string
ARMOrResourceProviderErrorCode represents the message returned from ARM or a Resource Provider
const ( ResourceDeploymentFailure ARMOrResourceProviderErrorCode = "ResourceDeploymentFailure" DNSRecordInUse ARMOrResourceProviderErrorCode = "DNSRecordInUse" MaxStorageAccountsCountPerSubscriptionExceeded ARMOrResourceProviderErrorCode = "MaxStorageAccountsCountPerSubscriptionExceeded" OverconstrainedAllocationRequest ARMOrResourceProviderErrorCode = "OverconstrainedAllocationRequest" OverconstrainedZonalAllocationRequest ARMOrResourceProviderErrorCode = "OverconstrainedZonalAllocationRequest" TooManyRequests ARMOrResourceProviderErrorCode = "TooManyRequests" Conflict ARMOrResourceProviderErrorCode = "Conflict" SkuNotAvailable ARMOrResourceProviderErrorCode = "SkuNotAvailable" RequestDisallowedByPolicy ARMOrResourceProviderErrorCode = "RequestDisallowedByPolicy" StorageAccountNotRecognized ARMOrResourceProviderErrorCode = "StorageAccountNotRecognized" MissingSubscriptionRegistration ARMOrResourceProviderErrorCode = "MissingSubscriptionRegistration" SubscriptionNotRegistered ARMOrResourceProviderErrorCode = "SubscriptionNotRegistered" MissingRegistrationForType ARMOrResourceProviderErrorCode = "MissingRegistrationForType" ResourceGroupBeingDeleted ARMOrResourceProviderErrorCode = "ResourceGroupBeingDeleted" ResourceGroupNotFound ARMOrResourceProviderErrorCode = "ResourceGroupNotFound" ResourceGroupQuotaExceeded ARMOrResourceProviderErrorCode = "ResourceGroupQuotaExceeded" AuthorizationFailed ARMOrResourceProviderErrorCode = "AuthorizationFailed" PublicIPCountLimitReached ARMOrResourceProviderErrorCode = "PublicIPCountLimitReached" StandardSkuPublicIPCountLimitReached ARMOrResourceProviderErrorCode = "StandardSkuPublicIPCountLimitReached" VnetCountLimitReached ARMOrResourceProviderErrorCode = "VnetCountLimitReached" VnetAddressSpaceOverlapsWithAlreadyPeeredVnet ARMOrResourceProviderErrorCode = "VnetAddressSpaceOverlapsWithAlreadyPeeredVnet" VnetAddressSpacesOverlap ARMOrResourceProviderErrorCode = "VnetAddressSpacesOverlap" OperationNotAllowed ARMOrResourceProviderErrorCode = "OperationNotAllowed" PrivateIPAddressNotInSubnet ARMOrResourceProviderErrorCode = "PrivateIPAddressNotInSubnet" InvalidParameter ARMOrResourceProviderErrorCode = "InvalidParameter" InvalidResourceReference ARMOrResourceProviderErrorCode = "InvalidResourceReference" ResizeDiskError ARMOrResourceProviderErrorCode = "ResizeDiskError" ResourceGroupDeletionTimeout ARMOrResourceProviderErrorCode = "ResourceGroupDeletionTimeout" ScopeLocked ARMOrResourceProviderErrorCode = "ScopeLocked" PublicIPAddressCannotBeDeleted ARMOrResourceProviderErrorCode = "PublicIPAddressCannotBeDeleted" MgmtDeletionDependency ARMOrResourceProviderErrorCode = "MgmtDeletionDependency" BadRequest ARMOrResourceProviderErrorCode = "BadRequest" ApplicationGatewaySubnetCannotBeUsedByOtherResources ARMOrResourceProviderErrorCode = "ApplicationGatewaySubnetCannotBeUsedByOtherResources" GatewaySubnet ARMOrResourceProviderErrorCode = "GatewaySubnet" InUseSubnetCannotBeDeleted ARMOrResourceProviderErrorCode = "InUseSubnetCannotBeDeleted" InUseNetworkSecurityGroupCannotBeDeleted ARMOrResourceProviderErrorCode = "InUseNetworkSecurityGroupCannotBeDeleted" InUseRouteTableCannotBeDeleted ARMOrResourceProviderErrorCode = "InUseRouteTableCannotBeDeleted" AllocationFailed ARMOrResourceProviderErrorCode = "AllocationFailed" QuotaExceeded ARMOrResourceProviderErrorCode = "QuotaExceeded" AppendPoliciesFieldsExist ARMOrResourceProviderErrorCode = "AppendPoliciesFieldsExist" VMExtensionProvisioningError ARMOrResourceProviderErrorCode = "VMExtensionProvisioningError" SubnetIsFull ARMOrResourceProviderErrorCode = "SubnetIsFull" OperationPreempted ARMOrResourceProviderErrorCode = "OperationPreempted" SubnetWithExternalResourcesCannotBeUsedByOtherResources ARMOrResourceProviderErrorCode = "SubnetWithExternalResourcesCannotBeUsedByOtherResources" ApplianceBeingDeleted ARMOrResourceProviderErrorCode = "ApplianceBeingDeleted" CustomerDeniedServicePlanAccess ARMOrResourceProviderErrorCode = "CustomerDeniedServicePlanAccess" ResourcePurchaseValidationFailed ARMOrResourceProviderErrorCode = "ResourcePurchaseValidationFailed" MarketplacePurchaseEligibilityFailed ARMOrResourceProviderErrorCode = "MarketplacePurchaseEligibilityFailed" FailedRoleAssignmentCreation ARMOrResourceProviderErrorCode = "FailedRoleAssignmentCreation" PrincipalNotFound ARMOrResourceProviderErrorCode = "PrincipalNotFound" Canceled ARMOrResourceProviderErrorCode = "Canceled" CanceledAndSupersededDueToAnotherOperation ARMOrResourceProviderErrorCode = "CanceledAndSupersededDueToAnotherOperation" CertificateNotFound ARMOrResourceProviderErrorCode = "CertificateNotFound" ResourceNotPermittedOnDelegatedSubnet ARMOrResourceProviderErrorCode = "ResourceNotPermittedOnDelegatedSubnet" ReferencedResourceNotProvisioned ARMOrResourceProviderErrorCode = "ReferencedResourceNotProvisioned" PrivateEndpointAndServiceEndpointsCannotCoexistInASubnet ARMOrResourceProviderErrorCode = "PrivateEndpointAndServiceEndpointsCannotCoexistInASubnet" ResourcesBeingMoved ARMOrResourceProviderErrorCode = "ResourcesBeingMoved" CannotUpdatePlan ARMOrResourceProviderErrorCode = "CannotUpdatePlan" ConflictingAppendPolicies ARMOrResourceProviderErrorCode = "ConflictingAppendPolicies" InvalidPolicyParameters ARMOrResourceProviderErrorCode = "InvalidPolicyParameters" PublicIPCountLimitExceededByVMScaleSet ARMOrResourceProviderErrorCode = "PublicIPCountLimitExceededByVMScaleSet" InvalidGatewayHost ARMOrResourceProviderErrorCode = "InvalidGatewayHost" ReservedResourceName ARMOrResourceProviderErrorCode = "ReservedResourceName" KeyVaultAccessForbidden ARMOrResourceProviderErrorCode = "KeyVaultAccessForbidden" DiskEncryptionSet ARMOrResourceProviderErrorCode = "DiskEncryptionSet" PolicyViolation ARMOrResourceProviderErrorCode = "policy violation" SpecifiedAllocatedOutboundPortsForOutboundRuleExceedsTotalNumberOfAvailablePorts ARMOrResourceProviderErrorCode = "SpecifiedAllocatedOutboundPortsForOutboundRuleExceedsTotalNumberOfAvailablePorts" NetworkSecurityGroupInUseByVirtualMachineScaleSet ARMOrResourceProviderErrorCode = "NetworkSecurityGroupInUseByVirtualMachineScaleSet" LoadBalancerInUseByVirtualMachineScaleSet ARMOrResourceProviderErrorCode = "LoadBalancerInUseByVirtualMachineScaleSet" ReadOnlyDisabledSubscription ARMOrResourceProviderErrorCode = "ReadOnlyDisabledSubscription" Throttled ARMOrResourceProviderErrorCode = "Throttled" SubscriptionRequestsThrottled ARMOrResourceProviderErrorCode = "SubscriptionRequestsThrottled" RoleAssignmentLimitExceeded ARMOrResourceProviderErrorCode = "RoleAssignmentLimitExceeded" ObjectIsDeletedButRecoverable ARMOrResourceProviderErrorCode = "ObjectIsDeletedButRecoverable" ObjectIsBeingDeleted ARMOrResourceProviderErrorCode = "ObjectIsBeingDeleted" NetworkInterfaceAndLoadBalancerAreInDifferentAvailabilitySets ARMOrResourceProviderErrorCode = "NetworkInterfaceAndLoadBalancerAreInDifferentAvailabilitySets " )
type ARMOrResourceProviderErrorMessage ¶
type ARMOrResourceProviderErrorMessage string
var NRPHostNameResolutionFailedMessage ARMOrResourceProviderErrorMessage = "Host name resolution failed for 'Microsoft.Network'"
type ARMResourceProvider ¶
type ARMResourceProvider string
ARMResourceProvider represents the different provider types available in ARM
const ( AllResourcesProviders ARMResourceProvider = "AllResourcesProviders" StorageProvider ARMResourceProvider = "Microsoft.Storage" NetworkProvider ARMResourceProvider = "Microsoft.Network" ComputeProvider ARMResourceProvider = "Microsoft.Compute" )
type ARMResourceType ¶
type ARMResourceType string
ARMResourceType represents the different types of resources available in ARM
const ( AllResources ARMResourceType = "AllResources" PublicIPAddresses ARMResourceType = "Microsoft.Network/publicIPAddresses" NetworkInterfaces ARMResourceType = "Microsoft.Network/networkInterfaces" NetworkSecurityGroups ARMResourceType = "Microsoft.Network/networkSecurityGroups" LoadBalancers ARMResourceType = "Microsoft.Network/loadBalancers" VirtualNetworks ARMResourceType = "Microsoft.Network/virtualNetworks" RouteTables ARMResourceType = "Microsoft.Network/routeTables" PrivateEndpoints ARMResourceType = "Microsoft.Network/privateEndpoints" PrivateLinkServices ARMResourceType = "Microsoft.Network/privateLinkServices" VirtualMachineScaleSets ARMResourceType = "Microsoft.Compute/virtualMachineScaleSets" VirtualMachines ARMResourceType = "Microsoft.Compute/virtualMachines" Disks ARMResourceType = "Microsoft.Compute/disks" AvailabilitySet ARMResourceType = "Microsoft.Compute/availabilitySets" Snapshots ARMResourceType = "Microsoft.Compute/snapshots" StorageAccounts ARMResourceType = "Microsoft.Storage/storageAccounts" StorageSyncServices ARMResourceType = "Microsoft.StorageSync/storageSyncServices" VirtualMachineExtensions ARMResourceType = "Microsoft.Compute/virtualMachines/extensions" ManagedApplications ARMResourceType = "Microsoft.Solutions/applications" OperationalInsights ARMResourceType = "Microsoft.OperationalInsights/workspaces" RoleAssignments ARMResourceType = "Microsoft.Authorization/roleAssignments" ResourceGroups ARMResourceType = "Microsoft.Resources/resourceGroups" Certificates ARMResourceType = "Microsoft.KeyVault/certificates" ContainerInsights ARMResourceType = "Microsoft.OperationsManagement/solutions" PolicyAssignments ARMResourceType = "Microsoft.Authorization/policyAssignments" DNSZones ARMResourceType = "Microsoft.Network/dnsZones" NATGateway ARMResourceType = "Microsoft.Network/natGateways" )
type VMExtensionErrorCode ¶
type VMExtensionErrorCode string
const ( SystemctlEnableFailVMExtensionError VMExtensionErrorCode = "SystemctlEnableFailVMExtensionError" // Service could not be enabled by systemctl -- DEPRECATED SystemctlStartFailVMExtensionError VMExtensionErrorCode = "SystemctlStartFailVMExtensionError" // Service could not be started or enabled by systemctl CloudInitTimeoutVMExtensionError VMExtensionErrorCode = "CloudInitTimeoutVMExtensionError" // Timeout waiting for cloud-init runcmd to complete FileWatchTimeoutVMExtensionError VMExtensionErrorCode = "FileWatchTimeoutVMExtensionError" // Timeout waiting for a file HoldWalinuxagentVMExtensionError VMExtensionErrorCode = "HoldWalinuxagentVMExtensionError" // Unable to place walinuxagent apt package on hold during install ReleaseHoldWalinuxagentVMExtensionError VMExtensionErrorCode = "ReleaseHoldWalinuxagentVMExtensionError" // Unable to release hold on walinuxagent apt package after install AptInstallTimeoutVMExtensionError VMExtensionErrorCode = "AptInstallTimeoutVMExtensionError" // Timeout installing required apt packages EtcdDataDirNotFoundVMExtensionError VMExtensionErrorCode = "EtcdDataDirNotFoundVMExtensionError" // Etcd data dir not found EtcdRunningTimeoutVMExtensionError VMExtensionErrorCode = "EtcdRunningTimeoutVMExtensionError" // Timeout waiting for etcd to be accessible EtcdDownloadTimeoutVMExtensionError VMExtensionErrorCode = "EtcdDownloadTimeoutVMExtensionError" // Timeout waiting for etcd to download EtcdVolMountFailVMExtensionError VMExtensionErrorCode = "EtcdVolMountFailVMExtensionError" // Unable to mount etcd disk volume EtcdStartTimeoutVMExtensionError VMExtensionErrorCode = "EtcdStartTimeoutVMExtensionError" // Unable to start etcd runtime EtcdConfigFailVMExtensionError VMExtensionErrorCode = "EtcdConfigFailVMExtensionError" // Unable to configure etcd cluster DockerInstallTimeoutVMExtensionError VMExtensionErrorCode = "DockerInstallTimeoutVMExtensionError" // Timeout waiting for docker install DockerDownloadTimeoutVMExtensionError VMExtensionErrorCode = "DockerDownloadTimeoutVMExtensionError" // Timout waiting for docker download(s) DockerKeyDownloadTimeoutVMExtensionError VMExtensionErrorCode = "DockerKeyDownloadTimeoutVMExtensionError" // Timeout waiting to download docker repo key DockerAptKeyTimeoutVMExtensionError VMExtensionErrorCode = "DockerAptKeyTimeoutVMExtensionError" // Timeout waiting for docker apt-key DockerStartFailVMExtensionError VMExtensionErrorCode = "DockerStartFailVMExtensionError" // Docker could not be started by systemctl K8SRunningTimeoutVMExtensionError VMExtensionErrorCode = "K8SRunningTimeoutVMExtensionError" // Timeout waiting for k8s cluster to be healthy K8SDownloadTimeoutVMExtensionError VMExtensionErrorCode = "K8SDownloadTimeoutVMExtensionError" // Timeout waiting for Kubernetes download(s) KubectlNotFoundVMExtensionError VMExtensionErrorCode = "KubectlNotFoundVMExtensionError" // kubectl client binary not found on local disk ImgDownloadTimeoutVMExtensionError VMExtensionErrorCode = "ImgDownloadTimeoutVMExtensionError" // Timeout waiting for img utility download ContainerImageDownloadTimeoutVMExtensionError VMExtensionErrorCode = "ContainerImageDownloadTimeoutVMExtensionError" // Timeout waiting for a container image to pull KubeletStartFailVMExtensionError VMExtensionErrorCode = "KubeletStartFailVMExtensionError" // kubelet could not be started by systemctl CniDownloadTimeoutVMExtensionError VMExtensionErrorCode = "CniDownloadTimeoutVMExtensionError" // Timeout waiting for CNI download(s) MSProdDebDownloadError VMExtensionErrorCode = "MSProdDebDownloadError" // Timeout waiting for https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb MSProdDebPkgAddError VMExtensionErrorCode = "MSProdDebPkgAddError" // Failed to add repo pkg file FlexvolumeDownloadError VMExtensionErrorCode = "FlexvolumeDownloadError" // Failed to download flexvol drivers -- DEPRECATED ModprobeError VMExtensionErrorCode = "ModprobeError" // Unable to load a kernel module using modprobe SystemdInstallError VMExtensionErrorCode = "SystemdInstallError" // Failed to install systemd OutboundConnFailVMExtensionError VMExtensionErrorCode = "OutboundConnFailVMExtensionError" // Unable to establish outbound connection K8SAPIServerConnFailVMExtensionError VMExtensionErrorCode = "K8SAPIServerConnFailVMExtensionError" // Unable to establish connection to k8s api server K8SAPIServerDNSLookupFailVMExtensionError VMExtensionErrorCode = "K8SAPIServerDNSLookupFailVMExtensionError" // Unable to resolve k8s api server name K8SAPIServerAzureDNSLookupFailVMExtensionError VMExtensionErrorCode = "K8SAPIServerAzureDNSLookupFailVMExtensionError" // Unable to resolve k8s api server name due to Azure DNS issue KataKeyDownloadTimeoutVMExtensionError VMExtensionErrorCode = "KataKeyDownloadTimeoutVMExtensionError" // Timeout waiting to download kata repo key KataAptKeyTimeoutVMExtensionError VMExtensionErrorCode = "KataAptKeyTimeoutVMExtensionError" // Timeout waiting for kata apt-key KataInstallTimeoutVMExtensionError VMExtensionErrorCode = "KataInstallTimeoutVMExtensionError" // Timeout waiting for kata install ContainerdTimeoutVMExtensionError VMExtensionErrorCode = "ContainerdTimeoutVMExtensionError" // Timeout waiting for containerd download(s) CustomSearchDomainsFailVMExtensionError VMExtensionErrorCode = "CustomSearchDomainsFailVMExtensionError" // Unable to configure custom search domains GpuDriversStartFailVMExtensionError VMExtensionErrorCode = "GpuDriversStartFailVMExtensionError" // nvidia-modprobe could not be started by systemctl GpuDriversInstallTimeoutVMExtensionError VMExtensionErrorCode = "GpuDriversInstallTimeoutVMExtensionError" // Timeout waiting for GPU drivers install AptDailyTimeoutVMExtensionError VMExtensionErrorCode = "AptDailyTimeoutVMExtensionError" // Timeout waiting for apt daily updates AptUpdateTimeoutVMExtensionError VMExtensionErrorCode = "AptUpdateTimeoutVMExtensionError" // Timeout waiting for apt-get update to complete CseProvisionScriptNotReadyVMExtensionError VMExtensionErrorCode = "CseProvisionScriptNotReadyVMExtensionError" // Timeout waiting for cloud-init to place custom script on the vm MobyAptListVMExtensionError VMExtensionErrorCode = "MobyAptListVMExtensionError" // Timeout waiting to get moby-required apt repos MobyGPGKeyDownloadVMExtensionError VMExtensionErrorCode = "MobyGPGKeyDownloadVMExtensionError" // Timeout waiting to get moby-required repo GPG public key MobyInstallVMExtensionError VMExtensionErrorCode = "MobyInstallVMExtensionError" // Timeout waiting to install moby )