fake

package
v0.0.0-test.load Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2025 License: Apache-2.0, Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const Region = "southcentralus"
View Source
const RegionNonZonal = "westcentralus"

Variables

View Source
var AKSAgentPoolsAPIErrorFromAKSAgentPoolNotFound = &azcore.ResponseError{
	ErrorCode:  "NotFound",
	StatusCode: http.StatusNotFound,
}
View Source
var AKSMachineAPIErrorAny = &azcore.ResponseError{
	ErrorCode: "SomeRandomError",
}
View Source
var AKSMachineAPIErrorFromAKSMachineImmutablePropertyChangeAttempted = &azcore.ResponseError{
	ErrorCode:  "OperationNotAllowed",
	StatusCode: http.StatusBadRequest,
}
View Source
var AKSMachineAPIErrorFromAKSMachineNotFound = &azcore.ResponseError{
	ErrorCode:  "NotFound",
	StatusCode: http.StatusNotFound,
}
View Source
var AKSMachineAPIErrorFromAKSMachinesPoolNotFound = &azcore.ResponseError{
	ErrorCode:  "NotFound",
	StatusCode: http.StatusNotFound,
}
View Source
var ResourceSkus = make(map[string][]compute.ResourceSku)

ResourceSkus is a map of location to resource skus

Functions

func AKSAgentPoolsAPIErrorFromAKSMachineNotFound added in v1.6.8

func AKSAgentPoolsAPIErrorFromAKSMachineNotFound(agentPoolName string, validMachines []string) error

AKSAgentPoolsAPIErrorFromAKSMachineNotFound creates the specific error for when machines cannot be found during delete

func AKSMachineAPIProvisioningErrorAllocationFailed added in v1.6.8

func AKSMachineAPIProvisioningErrorAllocationFailed() *armcontainerservice.ErrorDetail

func AKSMachineAPIProvisioningErrorAny added in v1.6.8

func AKSMachineAPIProvisioningErrorAny() *armcontainerservice.ErrorDetail

func AKSMachineAPIProvisioningErrorLowPriorityCoresQuota added in v1.6.8

func AKSMachineAPIProvisioningErrorLowPriorityCoresQuota(location string) *armcontainerservice.ErrorDetail

func AKSMachineAPIProvisioningErrorOverconstrainedAllocation added in v1.6.8

func AKSMachineAPIProvisioningErrorOverconstrainedAllocation() *armcontainerservice.ErrorDetail

func AKSMachineAPIProvisioningErrorOverconstrainedZonalAllocation added in v1.6.8

func AKSMachineAPIProvisioningErrorOverconstrainedZonalAllocation() *armcontainerservice.ErrorDetail

func AKSMachineAPIProvisioningErrorSkuNotAvailable added in v1.6.8

func AKSMachineAPIProvisioningErrorSkuNotAvailable(sku string, location string) *armcontainerservice.ErrorDetail

func AKSMachineAPIProvisioningErrorTotalRegionalCoresQuota added in v1.6.8

func AKSMachineAPIProvisioningErrorTotalRegionalCoresQuota(location string) *armcontainerservice.ErrorDetail

func AKSMachineAPIProvisioningErrorVMFamilyQuotaExceeded added in v1.6.8

func AKSMachineAPIProvisioningErrorVMFamilyQuotaExceeded(location string, familyName string, currentLimit int32, currentUsage int32, additionalRequired int32, newLimitRequired int32) *armcontainerservice.ErrorDetail

func AKSMachineAPIProvisioningErrorZoneAllocationFailed added in v1.6.8

func AKSMachineAPIProvisioningErrorZoneAllocationFailed(sku string, zone string) *armcontainerservice.ErrorDetail

func GetVMImageIDFromContext added in v1.6.8

func GetVMImageIDFromContext(ctx context.Context) string

This is not really the real one being used, which is the header. But the header cannot be extracted due to azure-sdk-for-go being restrictive. This is good enough.

func MakeBackendAddressPoolID

func MakeBackendAddressPoolID(resourceGroupName, loadBalancerName string, backendAddressPoolName string) string

func MakeLoadBalancerID

func MakeLoadBalancerID(resourceGroupName, loadBalancerName string) string

func MakeNetworkInterfaceID added in v1.6.2

func MakeNetworkInterfaceID(resourceGroupName, interfaceName string) string

func MakeNetworkSecurityGroupID added in v1.5.0

func MakeNetworkSecurityGroupID(resourceGroupName, networkSecurityGroupName string) string

func MakeVMExtensionID added in v1.6.2

func MakeVMExtensionID(resourceGroupName, vmName, extensionName string) string

func MkAgentPoolID added in v1.6.8

func MkAgentPoolID(resourceGroupName string, clusterName string, agentPoolName string) string

func MkMachineID added in v1.6.8

func MkMachineID(resourceGroupName string, clusterName string, agentPoolName string, aksMachineName string) string

func MkVMID added in v1.4.0

func MkVMID(resourceGroupName string, vmName string) string

func NewProductPrice

func NewProductPrice(instanceType string, price float64) client.Item

func NewSpotProductPrice

func NewSpotProductPrice(instanceType string, price float64) client.Item

Types

type AKSAgentPoolsAPI added in v1.6.8

type AKSAgentPoolsAPI struct {
	AgentPoolsBehavior
	// contains filtered or unexported fields
}

func NewAKSAgentPoolsAPI added in v1.6.8

func NewAKSAgentPoolsAPI(aksDataStorage *AKSDataStorage) *AKSAgentPoolsAPI

func (*AKSAgentPoolsAPI) BeginDeleteMachines added in v1.6.8

Already procedural, and is a fake nolint: gocyclo

func (*AKSAgentPoolsAPI) Get added in v1.6.8

func (*AKSAgentPoolsAPI) Reset added in v1.6.8

func (c *AKSAgentPoolsAPI) Reset()

Reset must be called between tests otherwise tests will pollute each other.

type AKSDataStorage added in v1.6.8

type AKSDataStorage struct {
	AgentPools  *sync.Map
	AKSMachines *sync.Map
}

AKSDataStorage contains the shared data stores for both AKS agent pools and machines

func NewAKSDataStorage added in v1.6.8

func NewAKSDataStorage() *AKSDataStorage

NewAKSDataStorage creates a new instance of shared data stores

type AKSMachineCreateOrUpdateInput added in v1.6.8

type AKSMachineCreateOrUpdateInput struct {
	ResourceGroupName string
	ResourceName      string
	AgentPoolName     string
	AKSMachineName    string
	AKSMachine        armcontainerservice.Machine
	Options           *armcontainerservice.MachinesClientBeginCreateOrUpdateOptions
}

type AKSMachineGetInput added in v1.6.8

type AKSMachineGetInput struct {
	ResourceGroupName string
	ResourceName      string
	AgentPoolName     string
	AKSMachineName    string
	Options           *armcontainerservice.MachinesClientGetOptions
}

type AKSMachineListInput added in v1.6.8

type AKSMachineListInput struct {
	ResourceGroupName string
	ResourceName      string
	AgentPoolName     string
	Options           *armcontainerservice.MachinesClientListOptions
}

type AKSMachinesAPI added in v1.6.8

type AKSMachinesAPI struct {
	AKSMachinesBehavior
	// contains filtered or unexported fields
}

func NewAKSMachinesAPI added in v1.6.8

func NewAKSMachinesAPI(aksDataStorage *AKSDataStorage) *AKSMachinesAPI

NewAKSMachinesAPI creates a new AKSMachinesAPI instance with shared data stores

func (*AKSMachinesAPI) BeginCreateOrUpdate added in v1.6.8

func (c *AKSMachinesAPI) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, aksMachineName string, parameters armcontainerservice.Machine, options *armcontainerservice.MachinesClientBeginCreateOrUpdateOptions) (*runtime.Poller[armcontainerservice.MachinesClientCreateOrUpdateResponse], error)

func (*AKSMachinesAPI) Get added in v1.6.8

func (c *AKSMachinesAPI) Get(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, aksMachineName string, options *armcontainerservice.MachinesClientGetOptions) (armcontainerservice.MachinesClientGetResponse, error)

func (*AKSMachinesAPI) NewListPager added in v1.6.8

func (c *AKSMachinesAPI) NewListPager(resourceGroupName string, resourceName string, agentPoolName string, options *armcontainerservice.MachinesClientListOptions) *runtime.Pager[armcontainerservice.MachinesClientListResponse]

func (*AKSMachinesAPI) Reset added in v1.6.8

func (c *AKSMachinesAPI) Reset()

Reset must be called between tests otherwise tests will pollute each other.

type AgentPoolCreateOrUpdateInput added in v1.6.8

type AgentPoolCreateOrUpdateInput struct {
	ResourceGroupName string
	ResourceName      string
	AgentPoolName     string
	Parameters        armcontainerservice.AgentPool
	Options           *armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions
}

type AgentPoolDeleteMachinesInput added in v1.6.8

type AgentPoolDeleteMachinesInput struct {
	ResourceGroupName string
	ResourceName      string
	AgentPoolName     string
	AKSMachines       armcontainerservice.AgentPoolDeleteMachinesParameter
	Options           *armcontainerservice.AgentPoolsClientBeginDeleteMachinesOptions
}

type AgentPoolGetInput added in v1.6.8

type AgentPoolGetInput struct {
	ResourceGroupName string
	ResourceName      string
	AgentPoolName     string
	Options           *armcontainerservice.AgentPoolsClientGetOptions
}

type AtomicError

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

func (*AtomicError) Get

func (e *AtomicError) Get() error

Get is equivalent to the error being called, so we increase number of calls in this function

func (*AtomicError) IsNil

func (e *AtomicError) IsNil() bool

func (*AtomicError) Reset

func (e *AtomicError) Reset()

func (*AtomicError) Set

func (e *AtomicError) Set(err error, opts ...AtomicErrorOption)

type AtomicErrorOption

type AtomicErrorOption func(atomicError *AtomicError)

func MaxCalls

func MaxCalls(maxCalls int) AtomicErrorOption

type AtomicPtr

type AtomicPtr[T any] struct {
	// contains filtered or unexported fields
}

AtomicPtr is intended for use in mocks to easily expose variables for use in testing. It makes setting and retrieving the values race free by wrapping the pointer itself in a mutex. There is no Get() method, but instead a Clone() method deep copies the object being stored by serializing/de-serializing it from JSON. This pattern shouldn't be followed anywhere else but is an easy way to eliminate races in our tests.

func (*AtomicPtr[T]) Clone

func (a *AtomicPtr[T]) Clone() *T

func (*AtomicPtr[T]) IsNil

func (a *AtomicPtr[T]) IsNil() bool

func (*AtomicPtr[T]) Reset

func (a *AtomicPtr[T]) Reset()

func (*AtomicPtr[T]) Set

func (a *AtomicPtr[T]) Set(v *T)

type AtomicPtrSlice

type AtomicPtrSlice[T any] struct {
	// contains filtered or unexported fields
}

AtomicPtrSlice exposes a slice of a pointer type in a race-free manner.

func (*AtomicPtrSlice[T]) Append

func (a *AtomicPtrSlice[T]) Append(input ...*T)

func (*AtomicPtrSlice[T]) Get

func (a *AtomicPtrSlice[T]) Get(index int) *T

func (*AtomicPtrSlice[T]) Len

func (a *AtomicPtrSlice[T]) Len() int

func (*AtomicPtrSlice[T]) Reset

func (a *AtomicPtrSlice[T]) Reset()

type AtomicPtrStack

type AtomicPtrStack[T any] struct {
	// contains filtered or unexported fields
}

AtomicPtrStack exposes a slice of a pointer type in a race-free manner. The interface is just enough to replace the set.Set usage in our previous tests.

func (*AtomicPtrStack[T]) Add

func (a *AtomicPtrStack[T]) Add(input *T)

func (*AtomicPtrStack[T]) All added in v1.6.6

func (a *AtomicPtrStack[T]) All() iter.Seq[*T]

All returns an iterator over all values in the stack NOTE: This pops the values from the stack

func (*AtomicPtrStack[T]) Len

func (a *AtomicPtrStack[T]) Len() int

func (*AtomicPtrStack[T]) Pop

func (a *AtomicPtrStack[T]) Pop() *T

func (*AtomicPtrStack[T]) Reset

func (a *AtomicPtrStack[T]) Reset()

type AuxiliaryTokenBehavior added in v1.5.0

type AuxiliaryTokenBehavior struct {
	AuxiliaryTokenDoBehavior MockedFunction[AuxiliaryTokenDoInput, *http.Response]
}

type AuxiliaryTokenDoInput added in v1.5.0

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

type AuxiliaryTokenServer added in v1.5.0

type AuxiliaryTokenServer struct {
	AuxiliaryTokenBehavior
	Token azcore.AccessToken
}

func NewAuxiliaryTokenServer added in v1.5.0

func NewAuxiliaryTokenServer(token string, expiresOn time.Time, refreshOn time.Time) *AuxiliaryTokenServer

NewAuxiliaryTokenServer creates a new AuxiliaryTokenServer with the given token.

func (*AuxiliaryTokenServer) Do added in v1.5.0

func (*AuxiliaryTokenServer) Reset added in v1.5.0

func (c *AuxiliaryTokenServer) Reset()

Reset must be called between tests otherwise tests will pollute each other.

func (*AuxiliaryTokenServer) SetToken added in v1.5.0

func (c *AuxiliaryTokenServer) SetToken(token string, expiresOn time.Time, refreshOn time.Time)

type AzureResourceGraphAPI

type AzureResourceGraphAPI struct {
	AzureResourceGraphBehavior
	// contains filtered or unexported fields
}

func NewAzureResourceGraphAPI added in v0.6.2

func NewAzureResourceGraphAPI(resourceGroup string, virtualMachinesAPI *VirtualMachinesAPI, networkInterfacesAPI *NetworkInterfacesAPI) *AzureResourceGraphAPI

func (*AzureResourceGraphAPI) Reset

func (c *AzureResourceGraphAPI) Reset()

Reset must be called between tests otherwise tests will pollute each other.

type AzureResourceGraphBehavior

type AzureResourceGraphBehavior struct {
	AzureResourceGraphResourcesBehavior MockedFunction[AzureResourceGraphResourcesInput, armresourcegraph.ClientResourcesResponse]
	VirtualMachinesAPI                  *VirtualMachinesAPI
	NetworkInterfacesAPI                *NetworkInterfacesAPI
	ResourceGroup                       string
}

type AzureResourceGraphResourcesInput

type AzureResourceGraphResourcesInput struct {
	Query   armresourcegraph.QueryRequest
	Options *armresourcegraph.ClientResourcesOptions
}

type CommunityGalleryImageVersionsAPI

type CommunityGalleryImageVersionsAPI struct {
	ImageVersions AtomicPtrSlice[armcompute.CommunityGalleryImageVersion]
}

TODO: no ability to simulate errors on the Pager.

func (*CommunityGalleryImageVersionsAPI) NewListPager

NewListPager returns a new pager to return the next page of CommunityGalleryImageVersionsClientListResponse

func (*CommunityGalleryImageVersionsAPI) Reset

type ListLocationsInput added in v1.6.2

type ListLocationsInput struct {
	SubscriptionID string
	Options        *armsubscriptions.ClientListLocationsOptions
}

type LoadBalancersAPI

type LoadBalancersAPI struct {
	LoadBalancersBehavior
}

func (*LoadBalancersAPI) Get

func (*LoadBalancersAPI) Reset

func (api *LoadBalancersAPI) Reset()

Reset must be called between tests otherwise tests will pollute each other.

type LoadBalancersBehavior

type LoadBalancersBehavior struct {
	LoadBalancers sync.Map
}

type MockHandler

type MockHandler[T any] struct {
	// contains filtered or unexported fields
}

MockHandler returns a pre-defined result or error.

func (MockHandler[T]) Done

func (h MockHandler[T]) Done() bool

Done returns true if the LRO has reached a terminal state. TrivialHandler is always done.

func (MockHandler[T]) Poll

func (h MockHandler[T]) Poll(context.Context) (*http.Response, error)

Poll fetches the latest state of the LRO.

func (MockHandler[T]) Result

func (h MockHandler[T]) Result(_ context.Context, result *T) error

Result is called once the LRO has reached a terminal state. It populates the out parameter with the result of the operation.

type MockedFunction

type MockedFunction[I any, O any] struct {
	Output          AtomicPtr[O]      // Output to return on call to this function
	CalledWithInput AtomicPtrStack[I] // Stack used to keep track of passed input to this function
	Error           AtomicError       // Error to return a certain number of times defined by custom error options
	// contains filtered or unexported fields
}

func (*MockedFunction[I, O]) Calls

func (m *MockedFunction[I, O]) Calls() int

func (*MockedFunction[I, O]) FailedCalls

func (m *MockedFunction[I, O]) FailedCalls() int

func (*MockedFunction[I, O]) Invoke

func (m *MockedFunction[I, O]) Invoke(input *I, defaultTransformer func(*I) (O, error)) (O, error)

func (*MockedFunction[I, O]) Reset

func (m *MockedFunction[I, O]) Reset()

Reset must be called between tests otherwise tests will pollute each other.

func (*MockedFunction[I, O]) SuccessfulCalls

func (m *MockedFunction[I, O]) SuccessfulCalls() int

type MockedLRO

type MockedLRO[I any, O any] struct {
	MockedFunction[I, O]
	BeginError AtomicError // Error to return a certain number of times defined by custom error options (for Begin)
}

func (*MockedLRO[I, O]) Calls

func (m *MockedLRO[I, O]) Calls() int

func (*MockedLRO[I, O]) FailedCalls

func (m *MockedLRO[I, O]) FailedCalls() int

func (*MockedLRO[I, O]) Invoke

func (m *MockedLRO[I, O]) Invoke(input *I, defaultTransformer func(*I) (*O, error)) (*runtime.Poller[O], error)

func (*MockedLRO[I, O]) Reset

func (m *MockedLRO[I, O]) Reset()

Reset must be called between tests otherwise tests will pollute each other.

func (*MockedLRO[I, O]) SuccessfulCalls

func (m *MockedLRO[I, O]) SuccessfulCalls() int

type NetworkInterfaceCreateOrUpdateInput

type NetworkInterfaceCreateOrUpdateInput struct {
	ResourceGroupName string
	InterfaceName     string
	Interface         armnetwork.Interface
	Options           *armnetwork.InterfacesClientBeginCreateOrUpdateOptions
}

type NetworkInterfaceDeleteInput

type NetworkInterfaceDeleteInput struct {
	ResourceGroupName, InterfaceName string
}

type NetworkInterfaceUpdateTagsInput added in v1.6.2

type NetworkInterfaceUpdateTagsInput struct {
	ResourceGroupName string
	InterfaceName     string
	Tags              armnetwork.TagsObject
	Options           *armnetwork.InterfacesClientUpdateTagsOptions
}

type NetworkInterfacesAPI

type NetworkInterfacesAPI struct {
	// instance.NetworkInterfacesAPI
	NetworkInterfacesBehavior
}

func (*NetworkInterfacesAPI) BeginDelete

func (*NetworkInterfacesAPI) Get

func (*NetworkInterfacesAPI) Reset

func (c *NetworkInterfacesAPI) Reset()

Reset must be called between tests otherwise tests will pollute each other.

func (*NetworkInterfacesAPI) UpdateTags added in v1.6.2

type NetworkInterfacesBehavior

type NetworkInterfacesBehavior struct {
	NetworkInterfacesCreateOrUpdateBehavior MockedLRO[NetworkInterfaceCreateOrUpdateInput, armnetwork.InterfacesClientCreateOrUpdateResponse]
	NetworkInterfacesDeleteBehavior         MockedLRO[NetworkInterfaceDeleteInput, armnetwork.InterfacesClientDeleteResponse]
	NetworkInterfacesUpdateTagsBehavior     MockedFunction[NetworkInterfaceUpdateTagsInput, armnetwork.InterfacesClientUpdateTagsResponse]
	NetworkInterfaces                       sync.Map
}

type NetworkSecurityGroupAPI added in v1.5.0

type NetworkSecurityGroupAPI struct {
	NetworkSecurityGroupBevhavior
}

func (*NetworkSecurityGroupAPI) Get added in v1.5.0

Get implements networksecuritygroup.API.

func (*NetworkSecurityGroupAPI) NewListPager added in v1.5.0

NewListPager implements networksecuritygroup.API.

func (*NetworkSecurityGroupAPI) Reset added in v1.5.0

func (api *NetworkSecurityGroupAPI) Reset()

Reset must be called between tests otherwise tests will pollute each other.

type NetworkSecurityGroupBevhavior added in v1.5.0

type NetworkSecurityGroupBevhavior struct {
	NSGs sync.Map
}

type NodeBootstrappingAPI added in v1.5.0

type NodeBootstrappingAPI struct {
	NodeBootstrappingBehavior
	SimulateDown bool
}

NodeBootstrappingAPI implements a fake version of the imagefamily.types.NodeBootstrappingAPI for testing purposes.

func (*NodeBootstrappingAPI) Get added in v1.5.0

Get implements the NodeBootstrappingAPI interface for testing

func (*NodeBootstrappingAPI) Reset added in v1.6.6

func (n *NodeBootstrappingAPI) Reset()

Reset must be called between tests otherwise tests will pollute each other.

type NodeBootstrappingBehavior added in v1.6.6

type NodeBootstrappingBehavior struct {
	NodeBootstrappingGetBehavior MockedFunction[NodeBootstrappingGetInput, types.NodeBootstrapping]
}

type NodeBootstrappingGetInput added in v1.6.6

type NodeBootstrappingGetInput struct {
	Params *models.ProvisionValues
}

type NodeImageVersionsAPI added in v0.7.1

type NodeImageVersionsAPI struct {
	// OverrideNodeImageVersions allows tests to override the default static data
	// When nil, the default NodeImageVersions slice is used
	OverrideNodeImageVersions []types.NodeImageVersion
	// Error allows tests to simulate API errors.
	// If Error is set to non-nil, it will take precedence over other fake data
	Error error
}

func (*NodeImageVersionsAPI) List added in v0.7.1

func (*NodeImageVersionsAPI) Reset added in v1.6.5

func (n *NodeImageVersionsAPI) Reset()

type PricingAPI

type PricingAPI struct {
	client.PricingAPI
	PricingBehavior
}

func (*PricingAPI) GetProductsPricePages

func (p *PricingAPI) GetProductsPricePages(_ context.Context, _ []*client.Filter, fn func(output *client.ProductsPricePage)) error

func (*PricingAPI) Reset

func (p *PricingAPI) Reset()

type PricingBehavior

type PricingBehavior struct {
	NextError         AtomicError
	ProductsPricePage AtomicPtr[client.ProductsPricePage]
}

type ResourceSKUsAPI

type ResourceSKUsAPI struct {
	Location string
	// skewer.ResourceClient
	Error error
}

func (*ResourceSKUsAPI) ListComplete

func (*ResourceSKUsAPI) Reset

func (s *ResourceSKUsAPI) Reset()

Reset must be called between tests otherwise tests will pollute each other.

type SubnetsAPI added in v1.6.2

type SubnetsAPI struct {
	GetFunc func(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, options *armnetwork.SubnetsClientGetOptions) (armnetwork.SubnetsClientGetResponse, error)
}

func (*SubnetsAPI) Get added in v1.6.2

func (s *SubnetsAPI) Get(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, options *armnetwork.SubnetsClientGetOptions) (armnetwork.SubnetsClientGetResponse, error)

func (*SubnetsAPI) Reset added in v1.6.2

func (s *SubnetsAPI) Reset()

type SubscriptionsAPI added in v1.6.2

type SubscriptionsAPI struct {
	SubscriptionsAPIBehavior
}

func NewSubscriptionsAPI added in v1.6.2

func NewSubscriptionsAPI() (*SubscriptionsAPI, error)

func (*SubscriptionsAPI) NewListLocationsPager added in v1.6.2

func (*SubscriptionsAPI) Reset added in v1.6.2

func (api *SubscriptionsAPI) Reset()

type SubscriptionsAPIBehavior added in v1.6.2

type SubscriptionsAPIBehavior struct {
	NewListLocationsPagerBehavior MockedFunction[ListLocationsInput, armsubscriptions.ClientListLocationsResponse]
	Locations                     sync.Map
	UseFakeData                   bool
}

type VirtualMachineCreateOrUpdateInput

type VirtualMachineCreateOrUpdateInput struct {
	ResourceGroupName string
	VMName            string
	VM                armcompute.VirtualMachine
	Options           *armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions
}

type VirtualMachineDeleteInput

type VirtualMachineDeleteInput struct {
	ResourceGroupName string
	VMName            string
	Options           *armcompute.VirtualMachinesClientBeginDeleteOptions
}

type VirtualMachineExtensionCreateOrUpdateInput

type VirtualMachineExtensionCreateOrUpdateInput struct {
	ResourceGroupName           string
	VirtualMachineName          string
	VirtualMachineExtensionName string
	VirtualMachineExtension     armcompute.VirtualMachineExtension
	Options                     *armcompute.VirtualMachineExtensionsClientBeginCreateOrUpdateOptions
}

type VirtualMachineExtensionUpdateInput added in v1.6.2

type VirtualMachineExtensionUpdateInput struct {
	ResourceGroupName             string
	VirtualMachineName            string
	VirtualMachineExtensionName   string
	VirtualMachineExtensionUpdate armcompute.VirtualMachineExtensionUpdate
	Options                       *armcompute.VirtualMachineExtensionsClientBeginUpdateOptions
}

type VirtualMachineExtensionsAPI

type VirtualMachineExtensionsAPI struct {
	// instance.VirtualMachineExtensionsAPI
	VirtualMachineExtensionsBehavior
}

func (*VirtualMachineExtensionsAPI) BeginUpdate added in v1.6.2

func (*VirtualMachineExtensionsAPI) Reset

func (c *VirtualMachineExtensionsAPI) Reset()

Reset must be called between tests otherwise tests will pollute each other.

type VirtualMachineExtensionsBehavior

type VirtualMachineExtensionsBehavior struct {
	VirtualMachineExtensionsCreateOrUpdateBehavior MockedLRO[VirtualMachineExtensionCreateOrUpdateInput, armcompute.VirtualMachineExtensionsClientCreateOrUpdateResponse]
	VirtualMachineExtensionsUpdateBehavior         MockedLRO[VirtualMachineExtensionUpdateInput, armcompute.VirtualMachineExtensionsClientUpdateResponse]
	Extensions                                     sync.Map
}

type VirtualMachineGetInput

type VirtualMachineGetInput struct {
	ResourceGroupName string
	VMName            string
	Options           *armcompute.VirtualMachinesClientGetOptions
}

type VirtualMachineUpdateInput

type VirtualMachineUpdateInput struct {
	ResourceGroupName string
	VMName            string
	Updates           armcompute.VirtualMachineUpdate
	Options           *armcompute.VirtualMachinesClientBeginUpdateOptions
}

type VirtualMachinesAPI

type VirtualMachinesAPI struct {
	// TODO: document the implications of embedding vs. not embedding the interface here
	// instance.VirtualMachinesAPI // - this is the interface we are mocking.
	VirtualMachinesBehavior
	AuxiliaryTokenPolicy *auth.AuxiliaryTokenPolicy
}

func (*VirtualMachinesAPI) Get

func (*VirtualMachinesAPI) Reset

func (c *VirtualMachinesAPI) Reset()

Reset must be called between tests otherwise tests will pollute each other.

func (*VirtualMachinesAPI) UseAuxiliaryTokenPolicy added in v1.5.0

func (c *VirtualMachinesAPI) UseAuxiliaryTokenPolicy() error

UseAuxiliaryTokenPolicy simulates AuxiliaryTokenPolicy.Do() method being called at the beginning of each API call This is useful for testing scenarios where the auxiliary token is required for the API call to succeed. If the AuxiliaryTokenPolicy is not set (USE_SIG: false), this method does nothing and returns nil.

Jump to

Keyboard shortcuts

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