Documentation ¶
Index ¶
- Constants
- func CleanupOIDCBucketObjects(log logr.Logger, s3Client *s3.S3, bucketName, issuerURL string)
- func CorrelateDaemonSet(ds *appsv1.DaemonSet, nodePool *hyperv1.NodePool, dsName string)
- 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 EnsureAPIBudget(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func EnsureAllContainersHavePullPolicyIfNotPresent(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 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 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 EnsureNodeCommunication(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func EnsureNodeCountMatchesNodePoolReplicas(t *testing.T, ctx context.Context, hostClient, guestClient crclient.Client, ...)
- func EnsureNodesLabelsAndTaints(t *testing.T, nodePool hyperv1.NodePool, nodes []corev1.Node)
- func EnsureOAuthWithIdentityProvider(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func EnsureOnlyRequestServingPodsOnRequestServingNodes(t *testing.T, ctx context.Context, client crclient.Client)
- func EnsurePSANotPrivileged(t *testing.T, ctx context.Context, guestClient crclient.Client)
- func EnsurePodsWithEmptyDirPVsHaveSafeToEvictAnnotations(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 GetClient() (crclient.Client, error)
- func GetConfig() (*rest.Config, error)
- func GetIAMClient(awsCreds, awsRegion string) iamiface.IAMAPI
- func GetKMSKeyArn(awsCreds, awsRegion, alias string) (*string, error)
- func GetS3Client(awsCreds, awsRegion string) *s3.S3
- func GetUserForToken(config *restclient.Config, token string) (*userv1.User, error)
- 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 RunCommandInPod(ctx context.Context, c crclient.Client, component, namespace string, ...) (string, error)
- func SetupReqServingClusterNodePools(ctx context.Context, t *testing.T, ...) []*hyperv1.NodePool
- 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 ValidateMetrics(t *testing.T, ctx context.Context, hc *hyperv1.HostedCluster, ...)
- func ValidatePrivateCluster(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func ValidatePublicCluster(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func WaitForConditionsOnHostedControlPlane(t *testing.T, ctx context.Context, client crclient.Client, ...)
- 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, error)
- func WaitForImageRollout(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func WaitForNReadyNodes(t *testing.T, ctx context.Context, client crclient.Client, n int32, ...) []corev1.Node
- func WaitForNReadyNodesByNodePool(t *testing.T, ctx context.Context, client crclient.Client, n int32, ...) []corev1.Node
- func WaitForNodePoolConditionsNotToBePresent(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func WaitForNodePoolDesiredNodes(t *testing.T, ctx context.Context, client crclient.Client, ...)
- func WaitForNodePoolVersion(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, ...)
- type DefaultRemoteExecutor
- type NameGenerator
- type PodExecOptions
- type PrometheusResponse
- type RemoteExecutor
- type StreamOptions
Constants ¶
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 ¶
This section is empty.
Functions ¶
func CleanupOIDCBucketObjects ¶ added in v0.1.4
func CorrelateDaemonSet ¶
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 EnsureAPIBudget ¶
func EnsureAllReqServingPodsLandOnReqServingNodes ¶ added in v0.1.16
func EnsureGuestWebhooksValidated ¶ added in v0.1.10
func EnsureHCPPodsAffinitiesAndTolerations ¶ added in v0.1.16
func EnsureNetworkPolicies ¶ added in v0.1.10
func EnsureNoCrashingPods ¶
func EnsureNoHCPPodsLandOnDefaultNode ¶ added in v0.1.17
func EnsureNodeCommunication ¶
func EnsureNodesLabelsAndTaints ¶ added in v0.1.10
func EnsureOAuthWithIdentityProvider ¶ added in v0.1.2
func EnsureOnlyRequestServingPodsOnRequestServingNodes ¶ added in v0.1.16
func EnsurePSANotPrivileged ¶ added in v0.1.10
func EnsurePodsWithEmptyDirPVsHaveSafeToEvictAnnotations ¶ added in v0.1.10
func EnsureSATokenNotMountedUnlessNecessary ¶ added in v0.1.19
func GetIAMClient ¶ added in v0.1.4
func GetKMSKeyArn ¶
func GetS3Client ¶ added in v0.1.4
func GetUserForToken ¶ added in v0.1.2
func NewHypershiftTest ¶ added in v0.1.10
func NewPrometheusClient ¶ added in v0.1.6
func NewPrometheusClient(ctx context.Context) (prometheusv1.API, error)
func RunCommandInPod ¶ added in v0.1.10
func SetupReqServingClusterNodePools ¶ added in v0.1.17
func TearDownNodePools ¶ added in v0.1.17
func UpdateObject ¶ added in v0.1.6
func ValidateMetrics ¶ added in v0.1.10
func ValidateMetrics(t *testing.T, ctx context.Context, 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 *core.CreateOptions)
func ValidatePublicCluster ¶ added in v0.1.10
func ValidatePublicCluster(t *testing.T, ctx context.Context, client crclient.Client, hostedCluster *hyperv1.HostedCluster, clusterOpts *core.CreateOptions)
func WaitForGuestClient ¶
func WaitForGuestKubeConfig ¶
func WaitForImageRollout ¶
func WaitForNReadyNodes ¶
func WaitForNodePoolConditionsNotToBePresent ¶
func WaitForNodePoolConditionsNotToBePresent(t *testing.T, ctx context.Context, client crclient.Client, nodePool *hyperv1.NodePool, conditions ...string)
WaitForNodePoolConditionsNotToBePresent blocks until the given conditions are not present in the NodePool.
func WaitForNodePoolDesiredNodes ¶ added in v0.1.6
func WaitForNodePoolVersion ¶
func WaitForNodePoolVersion(t *testing.T, ctx context.Context, client crclient.Client, nodePool *hyperv1.NodePool, version string)
WaitForNodePoolVersion blocks until the NodePool status indicates the given version. If the context is closed before the version is observed, the given test will get an error.
func WaitForOAuthRouteReady ¶ added in v0.1.2
func WaitForOAuthToken ¶ added in v0.1.2
func WaitForOauthConfig ¶ added in v0.1.6
Types ¶
type DefaultRemoteExecutor ¶
type DefaultRemoteExecutor struct{}
DefaultRemoteExecutor is the standard implementation of remote command execution
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 PodExecOptions ¶
type PodExecOptions struct { StreamOptions Command []string PodName string Namespace string ContainerName string Executor RemoteExecutor Config *restclient.Config }
PodExecOptions declare the arguments accepted by the Exec command
func (*PodExecOptions) Run ¶
func (p *PodExecOptions) Run() 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 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 RemoteExecutor ¶
type RemoteExecutor interface {
Execute(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 }