Documentation ¶
Index ¶
- Constants
- Variables
- func AreClusterOperatorsHealthy(cos []configv1.ClusterOperator) error
- func CheckAbsenceOfOperatorPods(te TestEnv)
- func CheckEnvVars(te TestEnv, want []corev1.EnvVar, have []corev1.EnvVar, includes bool)
- func CheckEnvVarsAreNotSet(te TestEnv, got []corev1.EnvVar, names []string)
- func CheckPodsAreNotRestarted(te TestEnv, labels labels.Selector)
- func ConditionExistsWithStatusAndReason(te TestEnv, conditionType string, conditionStatus operatorapi.ConditionStatus, ...)
- func CreateOrUpdateSecret(ctx context.Context, name string, namespace string, data map[string]string) (*corev1.Secret, error)
- func DeleteCompletely(getObject func() (metav1.Object, error), ...) error
- func DeployImageRegistry(te TestEnv, spec *imageregistryapiv1.ImageRegistrySpec)
- func DisableCVOForOperator(te TestEnv)
- func DumpClusterProxyResource(te TestEnv)
- func DumpImagePrunerResource(logger Logger, client *Clientset)
- func DumpImageRegistryDeployment(te TestEnv)
- func DumpImageRegistryResource(te TestEnv)
- func DumpNodeCADaemonSet(te TestEnv)
- func DumpObject(logger Logger, prefix string, obj interface{})
- func DumpOperatorDeployment(te TestEnv)
- func DumpOperatorLogs(ctx context.Context, te TestEnv)
- func DumpPodLogs(logger Logger, podLogs PodSetLogs)
- func DumpYAML(logger Logger, prefix string, obj interface{})
- func EncodeX509Certificate(cert *x509.Certificate) []byte
- func EnsureClusterOperatorStatusIsNormal(te TestEnv)
- func EnsureClusterOperatorStatusIsSet(te TestEnv) *configapiv1.ClusterOperator
- func EnsureDefaultExternalRegistryHostnameIsSet(te TestEnv)
- func EnsureDefaultExternalRouteExists(te TestEnv)
- func EnsureExternalRegistryHostnamesAreSet(te TestEnv, wantedHostnames []string)
- func EnsureExternalRoutesExist(t *testing.T, client *Clientset, wantedRoutes []string)
- func EnsureInternalRegistryHostnameIsSet(te TestEnv)
- func EnsureNodeCADaemonSetIsAvailable(te TestEnv)
- func EnsureOperatorIsNotHotLooping(te TestEnv)
- func EnsureServiceCAConfigMap(te TestEnv)
- func FlagExistsWithValue(args []string, flag string, value string) error
- func FollowPodLog(client *Clientset, pod corev1.Pod) (<-chan string, <-chan error, error)
- func GenerateX509Certificate(hostname string, caCert *x509.Certificate, caPrivateKey *rsa.PrivateKey) ([]byte, []byte, error)
- func GenerateX509RootCA() (*x509.Certificate, *rsa.PrivateKey, error)
- func GetImageRegistryDeployment(te TestEnv) *appsv1.Deployment
- func IsClusterOperatorHealthy(co *configv1.ClusterOperator) error
- func MarshalJSON(patch interface{}) []byte
- func PlatformHasDefaultStorage(te TestEnv) bool
- func PlatformIsOneOf(te TestEnv, platforms []configv1.PlatformType) bool
- func PrunerConditionExistsWithStatusAndReason(te TestEnv, conditionType string, conditionStatus operatorapi.ConditionStatus, ...)
- func RemoveImageRegistry(te TestEnv)
- func ResetClusterProxyConfig(te TestEnv)
- func ResetResourceProxyConfig(te TestEnv)
- func SetClusterProxyConfig(te TestEnv, proxyConfig openshiftapiv1.ProxySpec)
- func SetResourceProxyConfig(te TestEnv, proxyConfig imageregistryapiv1.ImageRegistryConfigProxy)
- func StopDeployment(te TestEnv, namespace, name string)
- func TeardownImageRegistry(te TestEnv)
- func TeardownImageRegistryWithTimeoutIncrement(te TestEnv, timeoutIncrement time.Duration)
- func WaitForNodeCADaemonSet(client *Clientset) (*appsv1.DaemonSet, error)
- func WaitForRegistryDeployment(client *Clientset) (*kappsapiv1.Deployment, error)
- func WaitUntilClusterOperatorsAreHealthy(te TestEnv, interval, timeout time.Duration)
- func WaitUntilDeploymentIsRolledOut(te TestEnv, namespace, name string)
- func WaitUntilFinalized(obj metav1.Object, getObject func() (metav1.Object, error)) error
- func WaitUntilImageRegistryConfigIsProcessed(te TestEnv) *imageregistryapiv1.Config
- func WaitUntilImageRegistryIsAvailable(te TestEnv)
- type Clientset
- type ConditionStatus
- type ContainerLog
- type ImageRegistryConditions
- type JSONPatch
- type Logger
- type PodLog
- type PodSetLogs
- func GetLogsByLabelSelector(ctx context.Context, client *Clientset, namespace string, ...) (PodSetLogs, error)
- func GetLogsForPod(ctx context.Context, client *Clientset, namespace string, podName string) (PodSetLogs, error)
- func GetOperatorLogs(ctx context.Context, client *Clientset) (PodSetLogs, error)
- type TestEnv
Constants ¶
const ( OperatorDeploymentNamespace = "openshift-image-registry" OperatorDeploymentName = "cluster-image-registry-operator" )
const (
ClusterVersionName = "version"
)
Variables ¶
var AsyncOperationTimeout = 5 * time.Minute
AsyncOperationTimeout is how long we want to wait for asynchronous operations to complete. ForeverTestTimeout is not long enough to create several replicas and get them available on a slow machine.
Functions ¶
func AreClusterOperatorsHealthy ¶
func AreClusterOperatorsHealthy(cos []configv1.ClusterOperator) error
func CheckAbsenceOfOperatorPods ¶
func CheckAbsenceOfOperatorPods(te TestEnv)
func CheckEnvVars ¶
func CheckEnvVarsAreNotSet ¶
func ConditionExistsWithStatusAndReason ¶
func ConditionExistsWithStatusAndReason(te TestEnv, conditionType string, conditionStatus operatorapi.ConditionStatus, conditionReason string)
func CreateOrUpdateSecret ¶
func DeleteCompletely ¶
func DeleteCompletely(getObject func() (metav1.Object, error), deleteObject func(metav1.DeleteOptions) error) error
DeleteCompletely sends a delete request and waits until the resource and its dependents are deleted.
func DeployImageRegistry ¶
func DeployImageRegistry(te TestEnv, spec *imageregistryapiv1.ImageRegistrySpec)
func DisableCVOForOperator ¶
func DisableCVOForOperator(te TestEnv)
func DumpClusterProxyResource ¶
func DumpClusterProxyResource(te TestEnv)
DumpClusterProxyResource prints out the cluster proxy configuration
func DumpImagePrunerResource ¶
func DumpImageRegistryDeployment ¶
func DumpImageRegistryDeployment(te TestEnv)
func DumpImageRegistryResource ¶
func DumpImageRegistryResource(te TestEnv)
func DumpNodeCADaemonSet ¶
func DumpNodeCADaemonSet(te TestEnv)
func DumpObject ¶
DumpObject prints the object to the test log.
func DumpOperatorDeployment ¶
func DumpOperatorDeployment(te TestEnv)
func DumpOperatorLogs ¶
func DumpPodLogs ¶
func DumpPodLogs(logger Logger, podLogs PodSetLogs)
func EncodeX509Certificate ¶
func EncodeX509Certificate(cert *x509.Certificate) []byte
func EnsureClusterOperatorStatusIsNormal ¶
func EnsureClusterOperatorStatusIsNormal(te TestEnv)
func EnsureClusterOperatorStatusIsSet ¶
func EnsureClusterOperatorStatusIsSet(te TestEnv) *configapiv1.ClusterOperator
func EnsureDefaultExternalRegistryHostnameIsSet ¶
func EnsureDefaultExternalRegistryHostnameIsSet(te TestEnv)
func EnsureDefaultExternalRouteExists ¶
func EnsureDefaultExternalRouteExists(te TestEnv)
func EnsureInternalRegistryHostnameIsSet ¶
func EnsureInternalRegistryHostnameIsSet(te TestEnv)
func EnsureNodeCADaemonSetIsAvailable ¶
func EnsureNodeCADaemonSetIsAvailable(te TestEnv)
func EnsureOperatorIsNotHotLooping ¶
func EnsureOperatorIsNotHotLooping(te TestEnv)
func EnsureServiceCAConfigMap ¶
func EnsureServiceCAConfigMap(te TestEnv)
func FollowPodLog ¶
FollowPodLog attaches to the pod log stream, reads it until the pod is dead or an error happens while reading.
If an error happens when fetching pod's Stream() this function returns immediately. If a failure happens during pods log read the error is sent back to the caller through an error channel.
func GenerateX509Certificate ¶
func GenerateX509Certificate(hostname string, caCert *x509.Certificate, caPrivateKey *rsa.PrivateKey) ([]byte, []byte, error)
func GenerateX509RootCA ¶
func GenerateX509RootCA() (*x509.Certificate, *rsa.PrivateKey, error)
func GetImageRegistryDeployment ¶
func GetImageRegistryDeployment(te TestEnv) *appsv1.Deployment
func IsClusterOperatorHealthy ¶
func IsClusterOperatorHealthy(co *configv1.ClusterOperator) error
func MarshalJSON ¶
func MarshalJSON(patch interface{}) []byte
func PlatformIsOneOf ¶
func PlatformIsOneOf(te TestEnv, platforms []configv1.PlatformType) bool
func PrunerConditionExistsWithStatusAndReason ¶
func PrunerConditionExistsWithStatusAndReason(te TestEnv, conditionType string, conditionStatus operatorapi.ConditionStatus, conditionReason string)
func RemoveImageRegistry ¶
func RemoveImageRegistry(te TestEnv)
func ResetClusterProxyConfig ¶
func ResetClusterProxyConfig(te TestEnv)
ResetClusterProxyConfig patches the cluster proxy resource to contain an empty proxy configuration
func ResetResourceProxyConfig ¶
func ResetResourceProxyConfig(te TestEnv)
ResetResourceProxyConfig patches the image registry resource to contain an empty proxy configuration
func SetClusterProxyConfig ¶
func SetClusterProxyConfig(te TestEnv, proxyConfig openshiftapiv1.ProxySpec)
SetClusterProxyConfig patches the cluster proxy resource to contain the provided proxy configuration
func SetResourceProxyConfig ¶
func SetResourceProxyConfig(te TestEnv, proxyConfig imageregistryapiv1.ImageRegistryConfigProxy)
SetResourceProxyConfig patches the image registry resource to contain the provided proxy configuration
func StopDeployment ¶
func TeardownImageRegistry ¶
func TeardownImageRegistry(te TestEnv)
func WaitForNodeCADaemonSet ¶
func WaitForRegistryDeployment ¶
func WaitForRegistryDeployment(client *Clientset) (*kappsapiv1.Deployment, error)
func WaitUntilFinalized ¶
WaitUntilFinalized waits until obj is finalized. It expects getObject to return the up-to-date version of obj.
func WaitUntilImageRegistryConfigIsProcessed ¶
func WaitUntilImageRegistryConfigIsProcessed(te TestEnv) *imageregistryapiv1.Config
func WaitUntilImageRegistryIsAvailable ¶
func WaitUntilImageRegistryIsAvailable(te TestEnv)
Types ¶
type Clientset ¶
type Clientset struct { clientcorev1.CoreV1Interface clientappsv1.AppsV1Interface clientconfigv1.ConfigV1Interface clientimageregistryv1.ImageregistryV1Interface clientroutev1.RouteV1Interface clientstoragev1.StorageV1Interface clientbatchv1.BatchV1Interface clientcoordinationv1.CoordinationV1Interface ImageInterface imagev1.ImageV1Interface BuildInterface buildv1.BuildV1Interface MachineSetInterface machinev1beta1.MachineSetInterface }
Clientset is a set of Kubernetes clients.
func MustNewClientset ¶
func MustNewClientset(t *testing.T, kubeconfig *restclient.Config) *Clientset
MustNewClientset is like NewClienset but aborts the test if clienset cannot be constructed.
func NewClientset ¶
func NewClientset(kubeconfig *restclient.Config) (clientset *Clientset, err error)
NewClientset creates a set of Kubernetes clients. The default kubeconfig is used if not provided.
type ConditionStatus ¶
type ConditionStatus struct {
// contains filtered or unexported fields
}
func NewConditionStatus ¶
func NewConditionStatus(cond operatorapiv1.OperatorCondition) ConditionStatus
func (ConditionStatus) IsFalse ¶
func (cs ConditionStatus) IsFalse() bool
func (ConditionStatus) IsTrue ¶
func (cs ConditionStatus) IsTrue() bool
func (ConditionStatus) Reason ¶
func (cs ConditionStatus) Reason() string
func (ConditionStatus) String ¶
func (cs ConditionStatus) String() string
type ContainerLog ¶
type ContainerLog []string
type ImageRegistryConditions ¶
type ImageRegistryConditions struct { Available ConditionStatus Progressing ConditionStatus Degraded ConditionStatus Removed ConditionStatus }
func GetImageRegistryConditions ¶
func GetImageRegistryConditions(cr *imageregistryapiv1.Config) ImageRegistryConditions
func (ImageRegistryConditions) String ¶
func (c ImageRegistryConditions) String() string
type Logger ¶
type Logger interface {
Logf(string, ...interface{})
}
Logger is an interface to report events from tests. It is implemented by testing.T.
type PodLog ¶
type PodLog map[string]ContainerLog
type PodSetLogs ¶
func GetLogsByLabelSelector ¶
func GetLogsByLabelSelector(ctx context.Context, client *Clientset, namespace string, labelSelector *metav1.LabelSelector, previous bool) (PodSetLogs, error)
func GetLogsForPod ¶
func GetOperatorLogs ¶
func GetOperatorLogs(ctx context.Context, client *Clientset) (PodSetLogs, error)
type TestEnv ¶
type TestEnv interface { Client() *Clientset Failed() bool Log(a ...interface{}) Logf(format string, a ...interface{}) Error(a ...interface{}) Errorf(format string, a ...interface{}) Fatal(a ...interface{}) Fatalf(format string, a ...interface{}) }
func SetupAvailableImageRegistry ¶
func SetupAvailableImageRegistry(t *testing.T, spec *imageregistryapiv1.ImageRegistrySpec) TestEnv