Documentation
¶
Index ¶
- Constants
- func ClusterUpdateMatchingHostedClusterSpec() v1beta1.HostedClusterSpec
- func ExternalAuthUpdateMatchingHostedClusterSpec() v1beta1.HostedClusterSpec
- func ExternalAuthUpdateMatchingOIDCProvider() configv1.OIDCProvider
- func MustParseTime(s string) time.Time
- func NewExternalAuthUpdateTestExternalAuth(mutate ...func(*coreapi.HCPOpenShiftClusterExternalAuth)) *coreapi.HCPOpenShiftClusterExternalAuth
- func NewHostedClusterReadDesire(t *testing.T, hostedCluster *v1beta1.HostedCluster, ...) *kubeapplierapi.ReadDesire
- type ClusterTestFixture
- type ExternalAuthTestFixture
- func (f *ExternalAuthTestFixture) NewCluster() *coreapi.HCPOpenShiftCluster
- func (f *ExternalAuthTestFixture) NewExternalAuth() *coreapi.HCPOpenShiftClusterExternalAuth
- func (f *ExternalAuthTestFixture) NewOperation(request cosmosstorageutils.OperationRequest) *coreapi.Operation
- func (f *ExternalAuthTestFixture) OperationKey() controllerutils.OperationKey
- type NodePoolTestFixture
- func (f *NodePoolTestFixture) NewCluster() *coreapi.HCPOpenShiftCluster
- func (f *NodePoolTestFixture) NewNodePool() *coreapi.HCPOpenShiftClusterNodePool
- func (f *NodePoolTestFixture) NewNodePoolVersionController(conditions []metav1.Condition) *coreapi.Controller
- func (f *NodePoolTestFixture) NewOperation(request cosmosstorageutils.OperationRequest) *coreapi.Operation
- func (f *NodePoolTestFixture) NewServiceProviderNodePool() *coreapi.ServiceProviderNodePool
- func (f *NodePoolTestFixture) OperationKey() controllerutils.OperationKey
Constants ¶
const ( TestSubscriptionID = "00000000-0000-0000-0000-000000000000" TestResourceGroupName = "test-rg" TestClusterName = "test-cluster" TestNodePoolName = "test-nodepool" TestExternalAuthName = "test-external-auth" TestClusterServiceIDStr = "/api/clusters_mgmt/v1/clusters/abc123" TestNodePoolIDStr = "/api/aro_hcp/v1alpha1/clusters/abc123/node_pools/test-nodepool" TestExternalAuthIDStr = "/api/clusters_mgmt/v1/clusters/abc123/external_auth_config/external_auths/ea123" TestBreakGlassCredentialIDStr = "/api/clusters_mgmt/v1/clusters/abc123/break_glass_credentials/bgc123" TestOperationName = "test-operation-id" TestTenantID = "11111111-1111-1111-1111-111111111111" TestAzureLocation = "eastus" TestClusterUID = "00000000-0000-0000-0000-000000000000" )
Common test constants
Variables ¶
This section is empty.
Functions ¶
func ClusterUpdateMatchingHostedClusterSpec ¶
func ClusterUpdateMatchingHostedClusterSpec() v1beta1.HostedClusterSpec
ClusterUpdateMatchingHostedClusterSpec returns a HostedCluster spec that matches the default cluster fixture for cluster update state calculation tests.
func ExternalAuthUpdateMatchingHostedClusterSpec ¶
func ExternalAuthUpdateMatchingHostedClusterSpec() v1beta1.HostedClusterSpec
ExternalAuthUpdateMatchingHostedClusterSpec returns a HostedCluster spec that matches NewExternalAuthUpdateTestExternalAuth for external auth update state calculation tests.
func ExternalAuthUpdateMatchingOIDCProvider ¶
func ExternalAuthUpdateMatchingOIDCProvider() configv1.OIDCProvider
ExternalAuthUpdateMatchingOIDCProvider returns an OIDCProvider that matches NewExternalAuthUpdateTestExternalAuth for external auth update state calculation tests.
func MustParseTime ¶
MustParseTime parses a time string in RFC3339 format and panics on error. Use for test constants to make date values more readable.
func NewExternalAuthUpdateTestExternalAuth ¶
func NewExternalAuthUpdateTestExternalAuth(mutate ...func(*coreapi.HCPOpenShiftClusterExternalAuth)) *coreapi.HCPOpenShiftClusterExternalAuth
NewExternalAuthUpdateTestExternalAuth returns an external auth whose properties match ExternalAuthUpdateMatchingOIDCProvider for external auth update state calculation tests.
func NewHostedClusterReadDesire ¶
func NewHostedClusterReadDesire(t *testing.T, hostedCluster *v1beta1.HostedCluster, conditions ...metav1.Condition) *kubeapplierapi.ReadDesire
NewHostedClusterReadDesire builds a kube-applier ReadDesire fixture wrapping the given HostedCluster. When no conditions are supplied it defaults to a successful observation. Shared across the resource operations test packages.
Types ¶
type ClusterTestFixture ¶
type ClusterTestFixture struct {
ClusterResourceID *azcorearm.ResourceID
OperationID *azcorearm.ResourceID
CosmosOperationResourceID *azcorearm.ResourceID
ClusterInternalID metadataapi.InternalID
}
ClusterTestFixture contains common test objects for cluster operations
func NewClusterTestFixture ¶
func NewClusterTestFixture() *ClusterTestFixture
func (*ClusterTestFixture) NewCluster ¶
func (f *ClusterTestFixture) NewCluster(createdAt *time.Time) *coreapi.HCPOpenShiftCluster
func (*ClusterTestFixture) NewOperation ¶
func (f *ClusterTestFixture) NewOperation(request cosmosstorageutils.OperationRequest) *coreapi.Operation
func (*ClusterTestFixture) OperationKey ¶
func (f *ClusterTestFixture) OperationKey() controllerutils.OperationKey
type ExternalAuthTestFixture ¶
type ExternalAuthTestFixture struct {
ClusterResourceID *azcorearm.ResourceID
ExternalAuthResourceID *azcorearm.ResourceID
OperationID *azcorearm.ResourceID
CosmosOperationResourceID *azcorearm.ResourceID
ClusterInternalID metadataapi.InternalID
ExternalAuthInternalID metadataapi.InternalID
}
ExternalAuthTestFixture contains common test objects for external auth operations
func NewExternalAuthTestFixture ¶
func NewExternalAuthTestFixture() *ExternalAuthTestFixture
func (*ExternalAuthTestFixture) NewCluster ¶
func (f *ExternalAuthTestFixture) NewCluster() *coreapi.HCPOpenShiftCluster
func (*ExternalAuthTestFixture) NewExternalAuth ¶
func (f *ExternalAuthTestFixture) NewExternalAuth() *coreapi.HCPOpenShiftClusterExternalAuth
func (*ExternalAuthTestFixture) NewOperation ¶
func (f *ExternalAuthTestFixture) NewOperation(request cosmosstorageutils.OperationRequest) *coreapi.Operation
func (*ExternalAuthTestFixture) OperationKey ¶
func (f *ExternalAuthTestFixture) OperationKey() controllerutils.OperationKey
type NodePoolTestFixture ¶
type NodePoolTestFixture struct {
ClusterResourceID *azcorearm.ResourceID
NodePoolResourceID *azcorearm.ResourceID
OperationID *azcorearm.ResourceID
CosmosOperationResourceID *azcorearm.ResourceID
ClusterInternalID metadataapi.InternalID
NodePoolInternalID metadataapi.InternalID
}
NodePoolTestFixture contains common test objects for node pool operations
func NewNodePoolTestFixture ¶
func NewNodePoolTestFixture() *NodePoolTestFixture
func (*NodePoolTestFixture) NewCluster ¶
func (f *NodePoolTestFixture) NewCluster() *coreapi.HCPOpenShiftCluster
func (*NodePoolTestFixture) NewNodePool ¶
func (f *NodePoolTestFixture) NewNodePool() *coreapi.HCPOpenShiftClusterNodePool
func (*NodePoolTestFixture) NewNodePoolVersionController ¶
func (f *NodePoolTestFixture) NewNodePoolVersionController(conditions []metav1.Condition) *coreapi.Controller
func (*NodePoolTestFixture) NewOperation ¶
func (f *NodePoolTestFixture) NewOperation(request cosmosstorageutils.OperationRequest) *coreapi.Operation
func (*NodePoolTestFixture) NewServiceProviderNodePool ¶
func (f *NodePoolTestFixture) NewServiceProviderNodePool() *coreapi.ServiceProviderNodePool
func (*NodePoolTestFixture) OperationKey ¶
func (f *NodePoolTestFixture) OperationKey() controllerutils.OperationKey