Documentation ¶
Index ¶
- Constants
- Variables
- func CheckEnvVars(want []corev1.EnvVar, have []corev1.EnvVar, includes bool) []error
- func ConditionExistsWithStatusAndReason(client *Clientset, conditionType string, ...) []error
- func CreateOrUpdateSecret(name string, namespace string, data map[string]string) (*corev1.Secret, error)
- func DeleteCompletely(getObject func() (metav1.Object, error), ...) error
- func DeployImageRegistry(logger Logger, client *Clientset, cr *imageregistryapiv1.Config) error
- func DisableCVOForOperator(logger Logger, client *Clientset) error
- func DumpClusterProxyResource(logger Logger, client *Clientset)
- func DumpImageRegistryDeployment(logger Logger, client *Clientset)
- func DumpImageRegistryResource(logger Logger, client *Clientset)
- func DumpObject(logger Logger, prefix string, obj interface{})
- func DumpOperatorDeployment(logger Logger, client *Clientset)
- func DumpOperatorLogs(logger Logger, client *Clientset)
- func DumpPodLogs(logger Logger, podLogs PodSetLogs)
- func DumpYAML(logger Logger, prefix string, obj interface{})
- func EnsureExternalRegistryHostnamesAreSet(t *testing.T, client *Clientset, wantedHostnames []string)
- func EnsureExternalRoutesExist(t *testing.T, client *Clientset, wantedRoutes []string)
- func MustDeployImageRegistry(t *testing.T, client *Clientset, cr *imageregistryapiv1.Config)
- func MustEnsureClusterOperatorStatusIsNormal(t *testing.T, client *Clientset)
- func MustEnsureClusterOperatorStatusIsSet(t *testing.T, client *Clientset) *configapiv1.ClusterOperator
- func MustEnsureDefaultExternalRegistryHostnameIsSet(t *testing.T, client *Clientset)
- func MustEnsureDefaultExternalRouteExists(t *testing.T, client *Clientset)
- func MustEnsureImageRegistryIsAvailable(t *testing.T, client *Clientset)
- func MustEnsureImageRegistryIsProcessed(t *testing.T, client *Clientset) *imageregistryapiv1.Config
- func MustEnsureInternalRegistryHostnameIsSet(t *testing.T, client *Clientset)
- func MustEnsureNodeCADaemonSetIsAvailable(t *testing.T, client *Clientset)
- func MustEnsureOperatorIsNotHotLooping(t *testing.T, client *Clientset)
- func MustEnsureServiceCAConfigMap(t *testing.T, client *Clientset)
- func MustFollowPodLog(t *testing.T, pod corev1.Pod) (<-chan string, <-chan error)
- func MustRemoveImageRegistry(t *testing.T, client *Clientset)
- func RemoveImageRegistry(logger Logger, client *Clientset) error
- func ResetClusterProxyConfig(client *Clientset) error
- func ResetResourceProxyConfig(client *Clientset) error
- func SetClusterProxyConfig(proxyConfig openshiftapiv1.ProxySpec, client *Clientset) error
- func SetResourceProxyConfig(proxyConfig imageregistryapiv1.ImageRegistryConfigProxy, client *Clientset) error
- func StopDeployment(logger Logger, client *Clientset, ...) error
- func WaitForNewRegistryDeployment(client *Clientset, currentGeneration int64) (*kappsapiv1.Deployment, error)
- func WaitForNewRegistryOperatorDeployment(client *Clientset, currentGeneration int64) (*kappsapiv1.Deployment, error)
- func WaitForNodeCADaemonSet(client *Clientset) (*appsv1.DaemonSet, error)
- func WaitForRegistryDeployment(client *Clientset) (*kappsapiv1.Deployment, error)
- func WaitForRegistryOperatorDeployment(client *Clientset) (*kappsapiv1.Deployment, error)
- type Clientset
- type ConditionStatus
- type ContainerLog
- type ImageRegistryConditions
- type Logger
- type PodLog
- type PodSetLogs
Constants ¶
const ( OperatorDeploymentNamespace = "openshift-image-registry" OperatorDeploymentName = "cluster-image-registry-operator" )
const (
ClusterVersionName = "version"
)
Variables ¶
var (
AsyncOperationTimeout = 5 * time.Minute
)
Functions ¶
func CheckEnvVars ¶
func ConditionExistsWithStatusAndReason ¶
func ConditionExistsWithStatusAndReason(client *Clientset, conditionType string, conditionStatus operatorapi.ConditionStatus, conditionReason string) []error
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(logger Logger, client *Clientset, cr *imageregistryapiv1.Config) error
func DisableCVOForOperator ¶
func DumpClusterProxyResource ¶
DumpClusterProxyResource prints out the cluster proxy configuration
func DumpObject ¶
DumpObject prints the object to the test log.
func DumpOperatorDeployment ¶
func DumpOperatorLogs ¶
func DumpPodLogs ¶
func DumpPodLogs(logger Logger, podLogs PodSetLogs)
func MustDeployImageRegistry ¶
func MustDeployImageRegistry(t *testing.T, client *Clientset, cr *imageregistryapiv1.Config)
func MustEnsureClusterOperatorStatusIsSet ¶
func MustEnsureClusterOperatorStatusIsSet(t *testing.T, client *Clientset) *configapiv1.ClusterOperator
func MustEnsureImageRegistryIsProcessed ¶
func MustEnsureImageRegistryIsProcessed(t *testing.T, client *Clientset) *imageregistryapiv1.Config
func MustFollowPodLog ¶
MustFollowPodLog 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 calls t.Fatal while if a failure happens during pods log read the error is sent back to the caller through an error channel.
func MustRemoveImageRegistry ¶
func RemoveImageRegistry ¶
func ResetClusterProxyConfig ¶
ResetClusterProxyConfig patches the cluster proxy resource to contain an empty proxy configuration
func ResetResourceProxyConfig ¶
ResetResourceProxyConfig patches the image registry resource to contain an empty proxy configuration
func SetClusterProxyConfig ¶
func SetClusterProxyConfig(proxyConfig openshiftapiv1.ProxySpec, client *Clientset) error
SetClusterProxyConfig patches the cluster proxy resource to contain the provided proxy configuration
func SetResourceProxyConfig ¶
func SetResourceProxyConfig(proxyConfig imageregistryapiv1.ImageRegistryConfigProxy, client *Clientset) error
SetResourceProxyConfig patches the image registry resource to contain the provided proxy configuration
func StopDeployment ¶
func WaitForNewRegistryDeployment ¶
func WaitForNewRegistryDeployment(client *Clientset, currentGeneration int64) (*kappsapiv1.Deployment, error)
func WaitForNewRegistryOperatorDeployment ¶
func WaitForNewRegistryOperatorDeployment(client *Clientset, currentGeneration int64) (*kappsapiv1.Deployment, error)
func WaitForNodeCADaemonSet ¶
func WaitForRegistryDeployment ¶
func WaitForRegistryDeployment(client *Clientset) (*kappsapiv1.Deployment, error)
func WaitForRegistryOperatorDeployment ¶
func WaitForRegistryOperatorDeployment(client *Clientset) (*kappsapiv1.Deployment, error)
Types ¶
type Clientset ¶
type Clientset struct { clientcorev1.CoreV1Interface clientappsv1.AppsV1Interface clientconfigv1.ConfigV1Interface clientimageregistryv1.ImageregistryV1Interface clientroutev1.RouteV1Interface clientstoragev1.StorageV1Interface }
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(client *Clientset, namespace string, labelSelector *metav1.LabelSelector) (PodSetLogs, error)
func GetOperatorLogs ¶
func GetOperatorLogs(client *Clientset) (PodSetLogs, error)