Documentation
¶
Overview ¶
Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- func CreateKubeNamespace(baseName string, c kubernetes.Interface) (string, error)
- func CreateNamespace(name string, c kubernetes.Interface) (string, error)
- func DeleteKubeNamespace(c kubernetes.Interface, namespace string) error
- func Logs(pod *corev1.Pod) (string, error)
- func WaitForEndpoints(kubeClientSet kubernetes.Interface, timeout time.Duration, name, ns string, ...) error
- func WaitForKubeNamespaceNotExist(c kubernetes.Interface, namespace string) error
- func WaitForPodsDeleted(kubeClientSet kubernetes.Interface, timeout time.Duration, namespace string, ...) error
- func WaitForPodsReady(kubeClientSet kubernetes.Interface, timeout time.Duration, ...) error
- func WaitForSecret(kubeClientSet kubernetes.Interface, timeout time.Duration, name, ns string, ...) error
- type FakeHarbor
- type Framework
- func (f *Framework) AfterEach()
- func (f *Framework) BeforeEach()
- func (f *Framework) EnsureConfigMap(configMap *api.ConfigMap) (*api.ConfigMap, error)
- func (f *Framework) EnsureDeployment(deployment *appsv1.Deployment) *appsv1.Deployment
- func (f *Framework) EnsureSecret(secret *api.Secret) *api.Secret
- func (f *Framework) EnsureService(service *core.Service) *core.Service
Constants ¶
const ( // Poll how often to poll for conditions Poll = 2 * time.Second // DefaultTimeout time to wait for operations to complete DefaultTimeout = 90 * time.Second )
Variables ¶
var (
// KubectlPath defines the full path of the kubectl binary
KubectlPath = "/usr/local/bin/kubectl"
)
var RunID = uuid.NewUUID()
RunID unique identifier of the e2e run
Functions ¶
func CreateKubeNamespace ¶
func CreateKubeNamespace(baseName string, c kubernetes.Interface) (string, error)
CreateKubeNamespace creates a new namespace in the cluster
func CreateNamespace ¶
func CreateNamespace(name string, c kubernetes.Interface) (string, error)
CreateNamespace creates a new namespace in the cluster
func DeleteKubeNamespace ¶
func DeleteKubeNamespace(c kubernetes.Interface, namespace string) error
DeleteKubeNamespace deletes a namespace and all the objects inside
func WaitForEndpoints ¶
func WaitForEndpoints(kubeClientSet kubernetes.Interface, timeout time.Duration, name, ns string, expectedEndpoints int) error
WaitForEndpoints waits for a given amount of time until an endpoint contains.
func WaitForKubeNamespaceNotExist ¶
func WaitForKubeNamespaceNotExist(c kubernetes.Interface, namespace string) error
WaitForKubeNamespaceNotExist waits until a namespaces is not present in the cluster
func WaitForPodsDeleted ¶
func WaitForPodsDeleted(kubeClientSet kubernetes.Interface, timeout time.Duration, namespace string, opts metav1.ListOptions) error
WaitForPodsDeleted waits for a given amount of time until a group of Pods are deleted in the given namespace.
func WaitForPodsReady ¶
func WaitForPodsReady(kubeClientSet kubernetes.Interface, timeout time.Duration, expectedReplicas int, namespace string, opts metav1.ListOptions) error
WaitForPodsReady waits for a given amount of time until a group of Pods is running in the given namespace.
func WaitForSecret ¶
func WaitForSecret(kubeClientSet kubernetes.Interface, timeout time.Duration, name, ns string, expected map[string]string) error
WaitForSecret waits for a given amount of time until a secret exists
Types ¶
type FakeHarbor ¶
type FakeHarbor struct {
URL string
}
FakeHarbor ..
func (*FakeHarbor) EnsureUpdate ¶
func (f *FakeHarbor) EnsureUpdate(namespace string, info harbor.SystemInfoResponse, projects []harbor.Project, robots map[string][]harbor.Robot)
EnsureUpdate ..
type Framework ¶
type Framework struct { BaseName string // A Kubernetes and Service Catalog client KubeClientSet kubernetes.Interface KubeConfig *restclient.Config APIExtensionsClientSet apiextcs.Interface Harbor *FakeHarbor Namespace string }
Framework supports common operations used by e2e tests; it will keep a client & a namespace for you.
func NewDefaultFramework ¶
NewDefaultFramework makes a new framework and sets up a BeforeEach/AfterEach for you (you can write additional before/after each functions).
func (*Framework) AfterEach ¶
func (f *Framework) AfterEach()
AfterEach deletes the namespace, after reading its events.
func (*Framework) BeforeEach ¶
func (f *Framework) BeforeEach()
BeforeEach gets a client and makes a namespace.
func (*Framework) EnsureConfigMap ¶
EnsureConfigMap creates a ConfigMap object or returns it if it already exists.
func (*Framework) EnsureDeployment ¶
func (f *Framework) EnsureDeployment(deployment *appsv1.Deployment) *appsv1.Deployment
EnsureDeployment creates a Deployment object and retunrs it, throws error if it already exists.
func (*Framework) EnsureSecret ¶
EnsureSecret creates a Secret object or returns it if it already exists.