Documentation
¶
Index ¶
- Constants
- Variables
- func AtLeast(t *testing.T, version semver.Version)
- func CPOAtLeast(t *testing.T, version semver.Version, hc *hyperv1.HostedCluster)
- func ChangeClientForKeycloakExtOIDC(t *testing.T, ctx context.Context, clientCfg *rest.Config, ...) crclient.Client
- func ChangeUserForKeycloakExtOIDC(t *testing.T, ctx context.Context, clientCfg *rest.Config, ...) *rest.Config
- func CleanupOIDCBucketObjects(log logr.Logger, s3Client *s3.S3, bucketName, issuerURL string)
- func CleanupSharedOIDCProvider(opts *Options, log logr.Logger)
- func CorrelateDaemonSet(ds *appsv1.DaemonSet, nodePool *hyperv1.NodePool, dsName string)
- func CreateKubeletConfigVerifierDaemonSet(ctx context.Context, guestClient crclient.Client, dsImage string) error
- func DeleteNamespace(t *testing.T, ctx context.Context, client crclient.Client, namespace string) error
- func DestroyOIDCProvider(log logr.Logger, iamClient iamiface.IAMAPI, issuerURL string)
- func EnsureAPIUX(t *testing.T, ctx context.Context, hostClient crclient.Client, ...)
- func EnsureAdmissionPolicies(t *testing.T, ctx context.Context, mgmtClient crclient.Client, ...)
- func EnsureAllContainersHavePullPolicyIfNotPresent(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func EnsureAllContainersHaveTerminationMessagePolicyFallbackToLogsOnError(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func EnsureAllReqServingPodsLandOnReqServingNodes(t *testing.T, ctx context.Context, client crclient.Client)
- func EnsureAllRoutesUseHCPRouter(t *testing.T, ctx context.Context, hostClient crclient.Client, ...)
- func EnsureAppLabel(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func EnsureCNOOperatorConfiguration(t *testing.T, ctx context.Context, mgmtClient crclient.Client, ...)
- func EnsureConsoleCapabilityDisabled(ctx context.Context, t *testing.T, g Gomega, clients *GuestClients)
- func EnsureCustomLabels(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func EnsureCustomTolerations(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func EnsureDefaultSecurityGroupTags(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func EnsureFeatureGateStatus(t *testing.T, ctx context.Context, guestClient crclient.Client)
- func EnsureGlobalPullSecret(t *testing.T, ctx context.Context, mgmtClient crclient.Client, ...) error
- func EnsureGuestWebhooksValidated(t *testing.T, ctx context.Context, guestClient crclient.Client)
- func EnsureHCPContainersHaveResourceRequests(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func EnsureHCPPodsAffinitiesAndTolerations(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func EnsureImageRegistryCapabilityDisabled(ctx context.Context, t *testing.T, g Gomega, clients *GuestClients)
- func EnsureIngressCapabilityDisabled(ctx context.Context, t *testing.T, clients *GuestClients, ...)
- func EnsureInsightsCapabilityDisabled(ctx context.Context, t *testing.T, g Gomega, clients *GuestClients)
- func EnsureKubeAPIDNSNameCustomCert(t *testing.T, ctx context.Context, mgmtClient crclient.Client, ...)
- func EnsureKubeAPIServerAllowedCIDRs(t *testing.T, ctx context.Context, mgmtClient crclient.Client, ...)
- func EnsureMachineDeploymentGeneration(t *testing.T, ctx context.Context, hostClient crclient.Client, ...)
- func EnsureNetworkPolicies(t *testing.T, ctx context.Context, c crclient.Client, ...)
- func EnsureNoCrashingPods(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func EnsureNoHCPPodsLandOnDefaultNode(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func EnsureNoPodsWithTooHighPriority(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func EnsureNoRapidDeploymentRollouts(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func EnsureNodeCommunication(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func EnsureNodeCountMatchesNodePoolReplicas(t *testing.T, ctx context.Context, hostClient, guestClient crclient.Client, ...)
- func EnsureNodeTuningCapabilityDisabled(ctx context.Context, t *testing.T, clients *GuestClients, ...)
- func EnsureNodesLabelsAndTaints(t *testing.T, nodePool hyperv1.NodePool, nodes []corev1.Node)
- func EnsureNodesRuntime(t *testing.T, nodes []corev1.Node)
- func EnsureOAPIMountsTrustBundle(t *testing.T, ctx context.Context, mgmtClient crclient.Client, ...)
- func EnsureOAuthWithIdentityProvider(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func EnsureOnlyRequestServingPodsOnRequestServingNodes(t *testing.T, ctx context.Context, client crclient.Client)
- func EnsureOpenshiftSamplesCapabilityDisabled(ctx context.Context, t *testing.T, g Gomega, clients *GuestClients)
- func EnsurePSANotPrivileged(t *testing.T, ctx context.Context, guestClient crclient.Client)
- func EnsurePayloadArchSetCorrectly(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func EnsurePodsWithEmptyDirPVsHaveSafeToEvictAnnotations(t *testing.T, ctx context.Context, hostClient crclient.Client, hcpNs string)
- func EnsureReadOnlyRootFilesystem(t *testing.T, ctx context.Context, hostClient crclient.Client, hcpNs string)
- func EnsureSATokenNotMountedUnlessNecessary(t *testing.T, ctx context.Context, c crclient.Client, ...)
- func EnsureSecretEncryptedUsingKMS(t *testing.T, ctx context.Context, hostedCluster *hyperv1.HostedCluster, ...)
- func EnsureSecretEncryptedUsingKMSV1(t *testing.T, ctx context.Context, hostedCluster *hyperv1.HostedCluster, ...)
- func EnsureSecretEncryptedUsingKMSV2(t *testing.T, ctx context.Context, hostedCluster *hyperv1.HostedCluster, ...)
- func EnsureSecurityContextUID(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func EventuallyObject[T client.Object](t *testing.T, ctx context.Context, objective string, ...)
- func EventuallyObjects[T client.Object](t *testing.T, ctx context.Context, objective string, ...)
- func GenerateCustomCertificate(dnsNames []string, validity time.Duration) ([]byte, []byte, error)
- func GetClient() (crclient.Client, error)
- func GetClientConfigForKeycloakOIDCUser(clientCfg *rest.Config, authConfig *ExtOIDCConfig, tokenCacheDir string) *rest.Config
- func GetConfig() (*rest.Config, error)
- func GetCustomKubeconfigClients(t *testing.T, ctx context.Context, client crclient.Client, ...) (*kubeclient.Clientset, crclient.Client)
- func GetDefaultSecurityGroup(awsCreds, awsRegion, sgID string) (*ec2.SecurityGroup, error)
- func GetFakeClient(objects ...crclient.Object) crclient.Client
- func GetGuestKubeconfigHost(t *testing.T, ctx context.Context, client crclient.Client, ...) (string, error)
- func GetHyperShiftOperatorImage(ctx context.Context, client crclient.Client, ...) (string, error)
- func GetIAMClient(awsCreds, awsRegion string) iamiface.IAMAPI
- func GetKMSKeyArn(awsCreds, awsRegion, alias string) (*string, error)
- func GetKubeletConfigVerifierLogs(ctx context.Context, guestClient crclient.Client) (map[string]string, error)
- func GetMetricsFromPod(ctx context.Context, c crclient.Client, ...) (map[string]*dto.MetricFamily, error)
- func GetS3Client(awsCreds, awsRegion string) *s3.S3
- func GetUserForToken(config *restclient.Config, token string) (*userv1.User, error)
- func GinkgoAtLeast(version semver.Version)
- func HasFieldInCRDSchema(ctx context.Context, client crclient.Client, crdName, fieldPath string) (bool, error)
- func InstallHyperShiftOperator(ctx context.Context, opts HyperShiftOperatorInstallOptions) error
- func IsExternalOIDCCluster(t *testing.T, ctx context.Context, clientCfg *rest.Config) (bool, error)
- func IsGreaterThanOrEqualTo(version semver.Version) bool
- func IsLessThan(version semver.Version) bool
- func NewHypershiftTest(t *testing.T, ctx context.Context, test hypershiftTestFunc) *hypershiftTest
- func NewLogr(t *testing.T) logr.Logger
- func NewPrometheusClient(ctx context.Context) (prometheusv1.API, error)
- func NoticePreemptionOrFailedScheduling(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func PutRolePolicy(awsCreds, awsRegion, roleARN string, policy string) (func() error, error)
- func RunCommandInPod(ctx context.Context, c crclient.Client, component, namespace string, ...) (string, error)
- func SetReleaseImageVersion(ctx context.Context, latestReleaseImage string, pullSecretFile string) error
- func SetReleaseVersionFromHostedCluster(ctx context.Context, hostedCluster *hyperv1.HostedCluster) error
- func SetupReqServingClusterNodePools(ctx context.Context, t *testing.T, ...) []*hyperv1.NodePool
- func SetupSharedOIDCProvider(opts *Options, artifactDir string) error
- func TearDownNodePools(ctx context.Context, t *testing.T, kubeconfigPath string, ...)
- func UpdateObject[T crclient.Object](t *testing.T, ctx context.Context, client crclient.Client, original T, ...) error
- func ValidateAuthenticationSpec(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func ValidateConfigurationStatus(t *testing.T, ctx context.Context, mgmtClient crclient.Client, ...)
- func ValidateHostedClusterConditions(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func ValidateMetricPresence(t *testing.T, mf map[string]*dto.MetricFamily, ...) bool
- func ValidateMetrics(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func ValidatePrivateCluster(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func ValidatePublicCluster(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func VerifyKubeletConfigWithDaemonSet(t *testing.T, ctx context.Context, guestClient crclient.Client, dsImage string)
- func WaitForConditionsOnHostedControlPlane(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func WaitForControlPlaneComponentRollout(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func WaitForCustomKubeconfig(t *testing.T, ctx context.Context, client crclient.Client, ...) []byte
- func WaitForGuestClient(t *testing.T, ctx context.Context, client crclient.Client, ...) crclient.Client
- func WaitForGuestKubeConfig(t *testing.T, ctx context.Context, client crclient.Client, ...) []byte
- func WaitForGuestKubeconfigHostResolutionUpdate(t *testing.T, ctx context.Context, uri string, ...)
- func WaitForGuestKubeconfigHostUpdate(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func WaitForGuestRestConfig(t *testing.T, ctx context.Context, client crclient.Client, ...) *rest.Config
- func WaitForImageRollout(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func WaitForKubeletConfigVerifierDaemonSet(ctx context.Context, guestClient crclient.Client) error
- func WaitForNReadyNodes(t *testing.T, ctx context.Context, client crclient.Client, n int32, ...) []corev1.Node
- func WaitForNReadyNodesWithOptions(t *testing.T, ctx context.Context, client crclient.Client, n int32, ...) []corev1.Node
- func WaitForNodePoolConfigUpdateComplete(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func WaitForNodePoolDesiredNodes(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func WaitForOAuthRouteReady(t *testing.T, ctx context.Context, client crclient.Client, ...) *routev1.Route
- func WaitForOAuthToken(t *testing.T, ctx context.Context, oauthRoute *routev1.Route, ...) string
- func WaitForOauthConfig(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func WaitForReadyNodesByLabels(t *testing.T, ctx context.Context, client crclient.Client, ...) []corev1.Node
- func WaitForReadyNodesByNodePool(t *testing.T, ctx context.Context, client crclient.Client, ...) []corev1.Node
- type Condition
- type ConfigurableClusterOptions
- type DefaultRemoteExecutor
- type EventuallyOption
- type EventuallyOptions
- type ExtOIDCConfig
- type GuestClients
- type HyperShiftOperatorInstallOptions
- type KubeVirtInfra
- func (k KubeVirtInfra) ComposeOVNKLayer2NAD(namespace string) (client.Object, error)
- func (k KubeVirtInfra) CreateOVNKLayer2NAD(namespace string) error
- func (k KubeVirtInfra) Ctx() context.Context
- func (k KubeVirtInfra) DiscoverClient() (crclient.Client, error)
- func (k KubeVirtInfra) HostedCluster() *hyperv1.HostedCluster
- func (k KubeVirtInfra) MGMTClient() crclient.Client
- func (k KubeVirtInfra) NADName() string
- func (k KubeVirtInfra) Namespace() string
- type NameGenerator
- type NodePoolPollOption
- type NodePoolPollOptions
- type Options
- func (o *Options) Complete() error
- func (o *Options) DefaultAWSOptions() hypershiftaws.RawCreateOptions
- func (o *Options) DefaultAzureOptions() azure.RawCreateOptions
- func (o *Options) DefaultClusterOptions(t *testing.T) PlatformAgnosticOptions
- func (o *Options) DefaultKubeVirtOptions() kubevirt.RawCreateOptions
- func (o *Options) DefaultNoneOptions() none.RawCreateOptions
- func (p *Options) DefaultOpenStackOptions() hypershiftopenstack.RawCreateOptions
- func (o *Options) DefaultPowerVSOptions() powervs.RawCreateOptions
- func (o *Options) Validate() error
- type PlatformAgnosticOptions
- type PodExecOptions
- type Predicate
- type PrometheusResponse
- type ProviderType
- type RemoteExecutor
- type StreamOptions
Constants ¶
const ( ProviderAzure ProviderType = "azure" ProviderKeycloak ProviderType = "keycloak" ExternalOIDCUIDExpressionPrefix = "testuid-" ExternalOIDCUIDExpressionSubfix = "-uidtest" ExternalOIDCExtraKeyBar = "extratest.openshift.com/bar" ExternalOIDCExtraKeyBarValueExpression = "extra-test-mark" ExternalOIDCExtraKeyFoo = "extratest.openshift.com/foo" ExternalOIDCExtraKeyFooValueExpression = "claims.email" // This is a variable, not a string literal )
const ( KubeletConfigVerifierDaemonSetName = "kubelet-config-verifier" KubeletConfigVerifierNamespace = "kube-system" NodePullSecretPath = "/var/lib/kubelet/config.json" )
const (
DefaultCIBaseDomain = "origin-ci-int-aws.dev.rhcloud.com"
)
const ( // Metrics // TODO (jparrill): We need to separate the metrics.go from the main pkg in the hypershift-operator. // Delete these references when it's done and import it from there HypershiftOperatorInfoName = "hypershift_operator_info" )
const OAuthServerConfigKey = "config.yaml"
Variables ¶
var ( // y-stream versions supported by e2e in main Version421 = semver.MustParse("4.21.0") Version420 = semver.MustParse("4.20.0") Version419 = semver.MustParse("4.19.0") Version418 = semver.MustParse("4.18.0") Version417 = semver.MustParse("4.17.0") Version416 = semver.MustParse("4.16.0") Version415 = semver.MustParse("4.15.0") Version414 = semver.MustParse("4.14.0") )
Functions ¶
func CPOAtLeast ¶ added in v0.1.56
func ChangeClientForKeycloakExtOIDC ¶ added in v0.1.66
func ChangeClientForKeycloakExtOIDC(t *testing.T, ctx context.Context, clientCfg *rest.Config, authConfig *ExtOIDCConfig) crclient.Client
ChangeClientForKeycloakExtOIDC changes the guest client using a keycloak user config
func ChangeUserForKeycloakExtOIDC ¶ added in v0.1.66
func ChangeUserForKeycloakExtOIDC(t *testing.T, ctx context.Context, clientCfg *rest.Config, authConfig *ExtOIDCConfig) *rest.Config
ChangeUserForKeycloakExtOIDC changes the user of current CLI session for a Keycloak external OIDC cluster
func CleanupOIDCBucketObjects ¶ added in v0.1.4
func CleanupSharedOIDCProvider ¶ added in v0.1.70
func CorrelateDaemonSet ¶
func CreateKubeletConfigVerifierDaemonSet ¶ added in v0.1.66
func CreateKubeletConfigVerifierDaemonSet(ctx context.Context, guestClient crclient.Client, dsImage string) error
CreateKubeletConfigVerifierDaemonSet creates a DaemonSet that verifies the config.json file on all nodes of the cluster, comparing it with the cluster's pull secret
func DeleteNamespace ¶
func DeleteNamespace(t *testing.T, ctx context.Context, client crclient.Client, namespace string) error
DeleteNamespace deletes and finalizes the given namespace, logging any failures along the way.
func DestroyOIDCProvider ¶ added in v0.1.4
func EnsureAPIUX ¶ added in v0.1.43
func EnsureAdmissionPolicies ¶ added in v0.1.44
func EnsureAllContainersHaveTerminationMessagePolicyFallbackToLogsOnError ¶ added in v0.1.60
func EnsureAllReqServingPodsLandOnReqServingNodes ¶ added in v0.1.16
func EnsureAppLabel ¶ added in v0.1.66
func EnsureCNOOperatorConfiguration ¶ added in v0.1.67
func EnsureCNOOperatorConfiguration(t *testing.T, ctx context.Context, mgmtClient crclient.Client, guestClient crclient.Client, hostedCluster *hyperv1.HostedCluster)
EnsureCNOOperatorConfiguration tests that changes to the CNO operator configuration on the HostedCluster are properly reflected in the hosted cluster's API and that the CNO doesn't report any errors via HCP conditions.
func EnsureConsoleCapabilityDisabled ¶ added in v0.1.64
func EnsureConsoleCapabilityDisabled(ctx context.Context, t *testing.T, g Gomega, clients *GuestClients)
EnsureConsoleCapabilityDisabled validates the expectations for when ConsoleCapability is Disabled
func EnsureCustomLabels ¶ added in v0.1.52
func EnsureCustomTolerations ¶ added in v0.1.55
func EnsureDefaultSecurityGroupTags ¶ added in v0.1.64
func EnsureDefaultSecurityGroupTags(t *testing.T, ctx context.Context, client crclient.Client, hostedCluster *hyperv1.HostedCluster, clusterOpts PlatformAgnosticOptions)
func EnsureFeatureGateStatus ¶ added in v0.1.69
NOTE: This function assumes that it is not called in the middle of a version rollout i.e. It expects that the first entry in ClusterVersion history is Completed
func EnsureGlobalPullSecret ¶ added in v0.1.66
func EnsureGuestWebhooksValidated ¶ added in v0.1.10
func EnsureHCPPodsAffinitiesAndTolerations ¶ added in v0.1.16
func EnsureImageRegistryCapabilityDisabled ¶ added in v0.1.58
func EnsureImageRegistryCapabilityDisabled(ctx context.Context, t *testing.T, g Gomega, clients *GuestClients)
EnsureImageRegistryCapabilityDisabled validates the expectations for when ImageRegistryCapability is Disabled
func EnsureIngressCapabilityDisabled ¶ added in v0.1.66
func EnsureIngressCapabilityDisabled(ctx context.Context, t *testing.T, clients *GuestClients, mgmtClient crclient.Client, hostedCluster *hyperv1.HostedCluster)
EnsureIngressCapabilityDisabled validates the expectations for when IngressCapability is Disabled
func EnsureInsightsCapabilityDisabled ¶ added in v0.1.63
func EnsureInsightsCapabilityDisabled(ctx context.Context, t *testing.T, g Gomega, clients *GuestClients)
EnsureInsightsCapabilityDisabled validates the expectations for when InsightsCapability is Disabled
func EnsureKubeAPIDNSNameCustomCert ¶ added in v0.1.58
func EnsureKubeAPIServerAllowedCIDRs ¶ added in v0.1.66
func EnsureNetworkPolicies ¶ added in v0.1.10
func EnsureNoCrashingPods ¶
func EnsureNoHCPPodsLandOnDefaultNode ¶ added in v0.1.17
func EnsureNoRapidDeploymentRollouts ¶ added in v0.1.53
func EnsureNodeCommunication ¶
func EnsureNodeTuningCapabilityDisabled ¶ added in v0.1.66
func EnsureNodeTuningCapabilityDisabled(ctx context.Context, t *testing.T, clients *GuestClients, mgmtClient crclient.Client, hostedCluster *hyperv1.HostedCluster)
EnsureNodeTuningCapabilityDisabled validates the expectations for when NodeTuningCapability is Disabled
func EnsureNodesLabelsAndTaints ¶ added in v0.1.10
func EnsureNodesRuntime ¶ added in v0.1.51
EnsureNodesRuntime ensures that all nodes in the NodePool have the expected runtime handlers. This is only supported on 4.18+ when the default runtime is changed to crun.
func EnsureOAPIMountsTrustBundle ¶ added in v0.1.40
func EnsureOAuthWithIdentityProvider ¶ added in v0.1.2
func EnsureOnlyRequestServingPodsOnRequestServingNodes ¶ added in v0.1.16
func EnsureOpenshiftSamplesCapabilityDisabled ¶ added in v0.1.60
func EnsureOpenshiftSamplesCapabilityDisabled(ctx context.Context, t *testing.T, g Gomega, clients *GuestClients)
EnsureOpenshiftSamplesCapabilityDisabled validates the expectations for when OpenShiftSamplesCapability is Disabled
func EnsurePSANotPrivileged ¶ added in v0.1.10
func EnsurePayloadArchSetCorrectly ¶ added in v0.1.48
func EnsurePodsWithEmptyDirPVsHaveSafeToEvictAnnotations ¶ added in v0.1.10
func EnsureReadOnlyRootFilesystem ¶ added in v0.1.67
func EnsureSATokenNotMountedUnlessNecessary ¶ added in v0.1.19
func EnsureSecretEncryptedUsingKMSV1 ¶ added in v0.1.43
func EnsureSecretEncryptedUsingKMSV2 ¶ added in v0.1.43
func EnsureSecurityContextUID ¶ added in v0.1.66
func EnsureSecurityContextUID(t *testing.T, ctx context.Context, client crclient.Client, hostedCluster *hyperv1.HostedCluster)
EnsureSecurityContextUID validates that all pods in the control plane namespace have the expected SecurityContext UID. TestCreateClusterDefaultSecurityContextUID ensures uniqueness across namespaces.
func EventuallyObject ¶ added in v0.1.38
func EventuallyObject[T client.Object](t *testing.T, ctx context.Context, objective string, getter func(context.Context) (T, error), predicates []Predicate[T], options ...EventuallyOption)
EventuallyObject polls until the predicate is fulfilled on the object.
func EventuallyObjects ¶ added in v0.1.38
func EventuallyObjects[T client.Object](t *testing.T, ctx context.Context, objective string, getter func(context.Context) ([]T, error), groupPredicates []Predicate[[]T], predicates []Predicate[T], options ...EventuallyOption)
EventuallyObjects polls until the predicate is fulfilled on each of a set of objects.
func GenerateCustomCertificate ¶ added in v0.1.58
GenerateCustomCertificate generates a self-signed certificate for the given DNS names
func GetClientConfigForKeycloakOIDCUser ¶ added in v0.1.66
func GetClientConfigForKeycloakOIDCUser(clientCfg *rest.Config, authConfig *ExtOIDCConfig, tokenCacheDir string) *rest.Config
GetClientConfigForKeycloakOIDCUser gets a client config for an external OIDC cluster
func GetCustomKubeconfigClients ¶ added in v0.1.58
func GetDefaultSecurityGroup ¶ added in v0.1.64
func GetDefaultSecurityGroup(awsCreds, awsRegion, sgID string) (*ec2.SecurityGroup, error)
func GetFakeClient ¶ added in v0.1.70
func GetGuestKubeconfigHost ¶ added in v0.1.40
func GetHyperShiftOperatorImage ¶ added in v0.1.54
func GetHyperShiftOperatorImage(ctx context.Context, client crclient.Client, opts HyperShiftOperatorInstallOptions) (string, error)
GetHyperShiftOperatorImage returns the current rolled-out image of the HyperShift operator
func GetIAMClient ¶ added in v0.1.4
func GetKMSKeyArn ¶
func GetKubeletConfigVerifierLogs ¶ added in v0.1.66
func GetKubeletConfigVerifierLogs(ctx context.Context, guestClient crclient.Client) (map[string]string, error)
GetKubeletConfigVerifierLogs gets logs from all pods of the kubelet config verifier DaemonSet
func GetMetricsFromPod ¶ added in v0.1.69
func GetMetricsFromPod(ctx context.Context, c crclient.Client, componentName, containerName, namespaceName, port string) (map[string]*dto.MetricFamily, error)
GetMetricsFromPod exec curl command in a pod metrics endpoint and return metric values if any Requires curl to be installed in the container
func GetS3Client ¶ added in v0.1.4
func GetUserForToken ¶ added in v0.1.2
func GinkgoAtLeast ¶ added in v0.1.70
func HasFieldInCRDSchema ¶ added in v0.1.70
func HasFieldInCRDSchema(ctx context.Context, client crclient.Client, crdName, fieldPath string) (bool, error)
HasFieldInCRDSchema checks if a field path exists in the CRD schema by recursively traversing the JSONSchemaProps. The fieldPath should be dot-separated (e.g., "spec.platform.gcp").
func InstallHyperShiftOperator ¶ added in v0.1.54
func InstallHyperShiftOperator(ctx context.Context, opts HyperShiftOperatorInstallOptions) error
InstallHyperShiftOperator generates and applies the manifests needed to install the HyperShift Operator starting with the all the HyperShift CRDs. It will wait for the HyperShift Operator to be ready before it returns.
func IsExternalOIDCCluster ¶ added in v0.1.66
IsExternalOIDCCluster checks if the cluster is using external OIDC.
func IsGreaterThanOrEqualTo ¶ added in v0.1.64
func IsLessThan ¶ added in v0.1.48
func NewHypershiftTest ¶ added in v0.1.10
func NewPrometheusClient ¶ added in v0.1.6
func NewPrometheusClient(ctx context.Context) (prometheusv1.API, error)
func PutRolePolicy ¶ added in v0.1.66
func RunCommandInPod ¶ added in v0.1.10
func SetReleaseImageVersion ¶ added in v0.1.48
func SetReleaseVersionFromHostedCluster ¶ added in v0.1.70
func SetReleaseVersionFromHostedCluster(ctx context.Context, hostedCluster *hyperv1.HostedCluster) error
func SetupReqServingClusterNodePools ¶ added in v0.1.17
func SetupSharedOIDCProvider ¶ added in v0.1.70
setup a shared OIDC provider to be used by all HostedClusters
func TearDownNodePools ¶ added in v0.1.17
func UpdateObject ¶ added in v0.1.6
func ValidateAuthenticationSpec ¶ added in v0.1.66
func ValidateAuthenticationSpec(t *testing.T, ctx context.Context, client crclient.Client, hostedCluster *hyperv1.HostedCluster, config *ExtOIDCConfig)
ValidateAuthenticationSpec validates the external OIDC configuration and the expected HostedCluster authentication configuration before running the test
func ValidateConfigurationStatus ¶ added in v0.1.69
func ValidateConfigurationStatus(t *testing.T, ctx context.Context, mgmtClient crclient.Client, guestClient crclient.Client, hostedCluster *hyperv1.HostedCluster)
ValidateConfigurationStatus validates that the HCP and HC configuration status matches the Authentication resource status from the hosted cluster
func ValidateHostedClusterConditions ¶ added in v0.1.64
func ValidateMetricPresence ¶ added in v0.1.69
func ValidateMetricPresence(t *testing.T, mf map[string]*dto.MetricFamily, query, labelKey, labelValue, metricName string, areMetricsExpectedToBePresent bool) bool
ValidateMetricPresence checks if a metric meets the expected presence criteria Returns true if validation passes, false otherwise
func ValidateMetrics ¶ added in v0.1.10
func ValidateMetrics(t *testing.T, ctx context.Context, client crclient.Client, hc *hyperv1.HostedCluster, metricsNames []string, areMetricsExpectedToBePresent bool)
Verifies that the given metrics are defined for the given hosted cluster if areMetricsExpectedToBePresent is set to true. Verifies that the given metrics are not defined otherwise.
func ValidatePrivateCluster ¶ added in v0.1.10
func ValidatePrivateCluster(t *testing.T, ctx context.Context, client crclient.Client, hostedCluster *hyperv1.HostedCluster, clusterOpts *PlatformAgnosticOptions)
func ValidatePublicCluster ¶ added in v0.1.10
func ValidatePublicCluster(t *testing.T, ctx context.Context, client crclient.Client, hostedCluster *hyperv1.HostedCluster, clusterOpts *PlatformAgnosticOptions)
func VerifyKubeletConfigWithDaemonSet ¶ added in v0.1.66
func VerifyKubeletConfigWithDaemonSet(t *testing.T, ctx context.Context, guestClient crclient.Client, dsImage string)
VerifyKubeletConfigWithDaemonSet implements complete verification using DaemonSet
func WaitForControlPlaneComponentRollout ¶ added in v0.1.68
func WaitForCustomKubeconfig ¶ added in v0.1.58
func WaitForCustomKubeconfig(t *testing.T, ctx context.Context, client crclient.Client, hostedCluster *hyperv1.HostedCluster) []byte
WaitForCustomKubeconfig waits for a KAS custom kubeconfig to be published for the given HostedCluster.
func WaitForGuestClient ¶
func WaitForGuestKubeConfig ¶
func WaitForGuestKubeconfigHostResolutionUpdate ¶ added in v0.1.56
func WaitForGuestKubeconfigHostUpdate ¶ added in v0.1.40
func WaitForGuestRestConfig ¶ added in v0.1.66
func WaitForImageRollout ¶
func WaitForKubeletConfigVerifierDaemonSet ¶ added in v0.1.66
WaitForKubeletConfigVerifierDaemonSet waits for the DaemonSet to be ready
func WaitForNReadyNodes ¶
func WaitForNReadyNodesWithOptions ¶ added in v0.1.40
func WaitForNodePoolConfigUpdateComplete ¶ added in v0.1.51
func WaitForNodePoolDesiredNodes ¶ added in v0.1.6
func WaitForOAuthRouteReady ¶ added in v0.1.2
func WaitForOAuthToken ¶ added in v0.1.2
func WaitForOauthConfig ¶ added in v0.1.6
func WaitForReadyNodesByLabels ¶ added in v0.1.54
func WaitForReadyNodesByNodePool ¶ added in v0.1.40
Types ¶
type Condition ¶ added in v0.1.38
type Condition struct {
Type string
Status metav1.ConditionStatus
Reason string
Message string
}
Condition is a generic structure required to adapt all the different concrete condition types into one.
func Conditions ¶ added in v0.1.38
Conditions extracts conditions from the item and adapts them to the generic wrapper.
type ConfigurableClusterOptions ¶ added in v0.1.54
type ConfigurableClusterOptions struct {
AWSCredentialsFile string
AWSEndpointAccess string
AWSKmsKeyAlias string
AWSMultiArch bool
AWSOidcS3BucketName string
Annotations stringMapVar
AzureCredentialsFile string
AzureManagedIdentitiesFile string
AzureIssuerURL string
AzureMultiArch bool
AzureServiceAccountTokenIssuerKeyPath string
AzureDataPlaneIdentities string
AzureWorkloadIdentitiesFile string
AzureEncryptionKeyID string
AzureKMSUserAssignedCredsSecretName string
OpenStackCredentialsFile string
OpenStackCACertFile string
AzureLocation string
AzureMarketplaceOffer string
AzureMarketplacePublisher string
AzureMarketplaceSKU string
AzureMarketplaceVersion string
BaseDomain string
ClusterCIDR stringSliceVar
ControlPlaneOperatorImage string
EtcdStorageClass string
ExternalDNSDomain string
KubeVirtContainerDiskImage string
KubeVirtInfraKubeconfigFile string
KubeVirtInfraNamespace string
KubeVirtNodeCores uint
KubeVirtNodeMemory string
KubeVirtRootVolumeSize uint
KubeVirtRootVolumeVolumeMode string
NetworkType string
NodePoolReplicas int
OpenStackExternalNetworkID string
OpenStackNodeAvailabilityZone string
OpenStackNodeFlavor string
OpenStackNodeImageName string
OpenStackDNSNameservers stringSliceVar
PowerVSCloudConnection string
PowerVSCloudInstanceID string
PowerVSMemory int
PowerVSPER bool
PowerVSProcType hyperv1.PowerVSNodePoolProcType
PowerVSProcessors string
PowerVSRegion string
PowerVSResourceGroup string
PowerVSSysType string
PowerVSTransitGateway string
PowerVSTransitGatewayLocation string
PowerVSVPC string
PowerVSVpcRegion string
PowerVSZone string
PullSecretFile string
Region string
SSHKeyFile string
ServiceCIDR stringSliceVar
Zone stringSliceVar
}
type DefaultRemoteExecutor ¶
type DefaultRemoteExecutor struct{}
DefaultRemoteExecutor is the standard implementation of remote command execution
type EventuallyOption ¶ added in v0.1.38
type EventuallyOption func(*EventuallyOptions)
EventuallyOption configures a
func WithDelayedStart ¶ added in v0.1.38
func WithDelayedStart() EventuallyOption
WithDelayedStart configures the asynchronous assertion to start immediately.
func WithFilteredConditionDump ¶ added in v0.1.38
func WithFilteredConditionDump(matchers ...Condition) EventuallyOption
WithFilteredConditionDump configures the asynchronous assertion to only dump the specified conditions.
func WithInterval ¶ added in v0.1.38
func WithInterval(interval time.Duration) EventuallyOption
WithInterval sets the polling interval.
func WithTimeout ¶ added in v0.1.38
func WithTimeout(timeout time.Duration) EventuallyOption
WithTimeout sets the polling timeout.
func WithoutConditionDump ¶ added in v0.1.38
func WithoutConditionDump() EventuallyOption
WithoutConditionDump configures the asynchronous assertion to dump conditions on failure.
type EventuallyOptions ¶ added in v0.1.38
type EventuallyOptions struct {
// contains filtered or unexported fields
}
EventuallyOptions configure asynchronous assertion behavior.
type ExtOIDCConfig ¶ added in v0.1.66
type ExtOIDCConfig struct {
ExternalOIDCProvider ProviderType
OIDCProviderName string
CliClientID string
ConsoleClientID string
IssuerURL string
GroupPrefix string
UserPrefix string
ConsoleClientSecretName string
ConsoleClientSecretValue string
// format: “user1:psw1,user2:psw2”, it is used for keycloak oidc
TestUsers string
// for oidcProviders.issuer.issuerCertificateAuthority
IssuerCAConfigmapName string
IssuerCABundleFile string
}
func GetExtOIDCConfig ¶ added in v0.1.66
func GetExtOIDCConfig(provider, cliClientID, consoleClientID, issuerURL, consoleSecret, issuerCABundleFile, testUsers string) *ExtOIDCConfig
func (*ExtOIDCConfig) GetAuthenticationConfig ¶ added in v0.1.66
func (config *ExtOIDCConfig) GetAuthenticationConfig() *configv1.AuthenticationSpec
type GuestClients ¶ added in v0.1.60
type GuestClients struct {
CfgClient *configv1client.Clientset
KubeClient *kubeclient.Clientset
}
func InitGuestClients ¶ added in v0.1.60
func InitGuestClients(ctx context.Context, t *testing.T, g Gomega, mgtClient crclient.Client, hostedCluster *hyperv1.HostedCluster) *GuestClients
InitGuestClients initializes the Kubernetes and OpenShift config clients for the guest cluster
type HyperShiftOperatorInstallOptions ¶ added in v0.1.54
type HyperShiftOperatorInstallOptions struct {
AWSOidcS3BucketName string
AWSOidcS3Credentials string
AWSOidcS3Region string
AWSPrivateCredentialsFile string
AWSPrivateRegion string
EnableCIDebugOutput bool
ExternalDNSCredentials string
ExternalDNSDomain string
ExternalDNSDomainFilter string
ExternalDNSProvider string
HyperShiftOperatorLatestImage string
PlatformMonitoring string
PrivatePlatform string
EnableSizeTagging bool
EnableDedicatedRequestServingIsolation bool
EnableCPOOverrides bool
EnableEtcdRecovery bool
DryRun bool
DryRunDir string
}
type KubeVirtInfra ¶ added in v0.1.32
type KubeVirtInfra struct {
// contains filtered or unexported fields
}
func NewKubeVirtInfra ¶ added in v0.1.32
func NewKubeVirtInfra(ctx context.Context, mgmtClient crclient.Client, hostedCluster *hyperv1.HostedCluster) KubeVirtInfra
func (KubeVirtInfra) ComposeOVNKLayer2NAD ¶ added in v0.1.32
func (k KubeVirtInfra) ComposeOVNKLayer2NAD(namespace string) (client.Object, error)
func (KubeVirtInfra) CreateOVNKLayer2NAD ¶ added in v0.1.32
func (k KubeVirtInfra) CreateOVNKLayer2NAD(namespace string) error
func (KubeVirtInfra) Ctx ¶ added in v0.1.32
func (k KubeVirtInfra) Ctx() context.Context
func (KubeVirtInfra) DiscoverClient ¶ added in v0.1.32
func (k KubeVirtInfra) DiscoverClient() (crclient.Client, error)
func (KubeVirtInfra) HostedCluster ¶ added in v0.1.32
func (k KubeVirtInfra) HostedCluster() *hyperv1.HostedCluster
func (KubeVirtInfra) MGMTClient ¶ added in v0.1.32
func (k KubeVirtInfra) MGMTClient() crclient.Client
func (KubeVirtInfra) NADName ¶ added in v0.1.32
func (k KubeVirtInfra) NADName() string
func (KubeVirtInfra) Namespace ¶ added in v0.1.32
func (k KubeVirtInfra) Namespace() string
type NameGenerator ¶
type NameGenerator interface {
// GenerateName generates a valid name from the base name, adding a random suffix to the
// the base. If base is valid, the returned name must also be valid. The generator is
// responsible for knowing the maximum valid name length.
GenerateName(base string) string
}
NameGenerator generates names for objects. Some backends may have more information available to guide selection of new names and this interface hides those details.
var SimpleNameGenerator NameGenerator = simpleNameGenerator{}
SimpleNameGenerator is a generator that returns the name plus a random suffix of five alphanumerics when a name is requested. The string is guaranteed to not exceed the length of a standard Kubernetes name (63 characters)
type NodePoolPollOption ¶ added in v0.1.40
type NodePoolPollOption func(*NodePoolPollOptions)
func WithClientOptions ¶ added in v0.1.40
func WithClientOptions(clientOpts ...crclient.ListOption) NodePoolPollOption
func WithCollectionPredicates ¶ added in v0.1.40
func WithCollectionPredicates(predicates ...Predicate[[]*corev1.Node]) NodePoolPollOption
func WithPredicates ¶ added in v0.1.40
func WithPredicates(predicates ...Predicate[*corev1.Node]) NodePoolPollOption
func WithSuffix ¶ added in v0.1.40
func WithSuffix(suffix string) NodePoolPollOption
type NodePoolPollOptions ¶ added in v0.1.40
type NodePoolPollOptions struct {
// contains filtered or unexported fields
}
type Options ¶ added in v0.1.54
type Options struct {
LatestReleaseImage string
PreviousReleaseImage string
N4MinorReleaseImage string
N3MinorReleaseImage string
N2MinorReleaseImage string
N1MinorReleaseImage string
IsRunningInCI bool
ArtifactDir string
// BeforeApply is a function passed to the CLI create command giving the test
// code an opportunity to inspect or mutate the resources the CLI will create
// before they're applied.
BeforeApply func(client.Object) `json:"-"`
Platform hyperv1.PlatformType
PlatformRaw string
ConfigurableClusterOptions ConfigurableClusterOptions
AdditionalTags stringSliceVar
IssuerURL string
ServiceAccountSigningKey []byte
// If set, the CreateCluster test will create a cluster with request serving
// isolation topology.
RequestServingIsolation bool
// If testing request serving isolation topology, we need a kubeconfig to the
// parent of the management cluster, name and namespace of the management cluster
// so we can create additional nodepools for it.
ManagementParentKubeconfig string
ManagementClusterNamespace string
ManagementClusterName string
// If set, the UpgradeControlPlane test will upgrade control plane without
// reconciling PKI.
DisablePKIReconciliation bool
HyperShiftOperatorLatestImage string
// This is used in tests which include the HyperShift Operator as part of
// the test such as the UpgradeHyperShiftOperatorTest
HOInstallationOptions HyperShiftOperatorInstallOptions
// RunUpgradeTest is set to run HyperShift Operator upgrade test
RunUpgradeTest bool
// external oidc for authentication in spec.configurations
ExternalOIDCProvider string
ExternalOIDCCliClientID string
ExternalOIDCConsoleClientID string
ExternalOIDCIssuerURL string
ExternalOIDCConsoleSecret string
ExternalOIDCCABundleFile string
ExternalOIDCTestUsers string
}
Options are global test options applicable to all scenarios.
func (*Options) Complete ¶ added in v0.1.54
Complete is intended to be called after flags have been bound and sets up additional contextual defaulting.
func (*Options) DefaultAWSOptions ¶ added in v0.1.54
func (o *Options) DefaultAWSOptions() hypershiftaws.RawCreateOptions
func (*Options) DefaultAzureOptions ¶ added in v0.1.54
func (o *Options) DefaultAzureOptions() azure.RawCreateOptions
func (*Options) DefaultClusterOptions ¶ added in v0.1.54
func (o *Options) DefaultClusterOptions(t *testing.T) PlatformAgnosticOptions
func (*Options) DefaultKubeVirtOptions ¶ added in v0.1.54
func (o *Options) DefaultKubeVirtOptions() kubevirt.RawCreateOptions
func (*Options) DefaultNoneOptions ¶ added in v0.1.54
func (o *Options) DefaultNoneOptions() none.RawCreateOptions
func (*Options) DefaultOpenStackOptions ¶ added in v0.1.54
func (p *Options) DefaultOpenStackOptions() hypershiftopenstack.RawCreateOptions
func (*Options) DefaultPowerVSOptions ¶ added in v0.1.54
func (o *Options) DefaultPowerVSOptions() powervs.RawCreateOptions
type PlatformAgnosticOptions ¶ added in v0.1.38
type PlatformAgnosticOptions struct {
core.RawCreateOptions
NonePlatform none.RawCreateOptions
AWSPlatform aws.RawCreateOptions
KubevirtPlatform kubevirt.RawCreateOptions
AzurePlatform azure.RawCreateOptions
PowerVSPlatform powervs.RawCreateOptions
OpenStackPlatform openstack.RawCreateOptions
ExtOIDCConfig *ExtOIDCConfig
}
type PodExecOptions ¶
type PodExecOptions struct {
StreamOptions
Command []string
PodName string
Namespace string
ContainerName string
Timeout time.Duration
Executor RemoteExecutor
Config *restclient.Config
}
PodExecOptions declare the arguments accepted by the Exec command
func (*PodExecOptions) Run ¶
func (p *PodExecOptions) Run(ctx context.Context) error
Run executes a validated remote execution against a pod.
func (*PodExecOptions) Validate ¶
func (p *PodExecOptions) Validate() error
Validate checks that the provided exec options are specified.
type Predicate ¶ added in v0.1.38
Predicate evaluates an object. Return whether the object in question matches your predicate, the reasons why or why not, and whether an error occurred. If determining that an object does not match a predicate, a message is required. Returning an error is fatal to the asynchronous assertion using this predicate.
type PrometheusResponse ¶ added in v0.1.6
type PrometheusResponse struct {
Data prometheusResponseData `json:"data"`
}
PrometheusResponse is used to contain prometheus query results
func RunQueryAtTime ¶ added in v0.1.6
type ProviderType ¶ added in v0.1.66
type ProviderType string
type RemoteExecutor ¶
type RemoteExecutor interface {
Execute(ctx context.Context, method string, url *url.URL, config *restclient.Config, stdin io.Reader, stdout, stderr io.Writer, tty bool) error
}
RemoteExecutor defines the interface accepted by the Exec command - provided for test stubbing
type StreamOptions ¶
type StreamOptions struct {
Stdin bool
TTY bool
genericclioptions.IOStreams
}