test

package
v0.11.0-rc3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2019 License: Apache-2.0 Imports: 13 Imported by: 8

Documentation

Index

Constants

View Source
const (
	FakeArgoCDNamespace = "fake-argocd-ns"
	FakeDestNamespace   = "fake-dest-ns"
	FakeClusterURL      = "https://fake-cluster:443"
	TestAppInstanceName = "test-app-instance"
)

Variables

View Source
var (
	BuiltinPolicy string
)
View Source
var DeploymentManifest = []byte(`
{
  "apiVersion": "apps/v1",
  "kind": "Deployment",
  "metadata": {
    "name": "nginx-deployment",
    "labels": {
      "app": "nginx"
    }
  },
  "spec": {
    "replicas": 3,
    "selector": {
      "matchLabels": {
        "app": "nginx"
      }
    },
    "template": {
      "metadata": {
        "labels": {
          "app": "nginx"
        }
      },
      "spec": {
        "containers": [
          {
            "name": "nginx",
            "image": "nginx:1.15.4",
            "ports": [
              {
                "containerPort": 80
              }
            ]
          }
        ]
      }
    }
  }
}
`)
View Source
var PodManifest = []byte(`
{
  "apiVersion": "v1",
  "kind": "Pod",
  "metadata": {
    "name": "my-pod"
  },
  "spec": {
    "containers": [
      {
        "image": "nginx:1.7.9",
        "name": "nginx",
        "resources": {
          "requests": {
            "cpu": 0.2
          }
        }
      }
    ]
  }
}
`)
View Source
var ServiceManifest = []byte(`
{
  "apiVersion": "v1",
  "kind": "Service",
  "metadata": {
    "name": "my-service"
  },
  "spec": {
    "ports": [
      {
        "name": "http",
        "protocol": "TCP",
        "port": 80,
        "targetPort": 8080
      }
    ],
    "selector": {
      "app": "my-service"
    }
  }
}
`)

Functions

func DemoDeployment

func DemoDeployment() *appsv1.Deployment

func GetFreePort added in v0.11.0

func GetFreePort() (int, error)

GetFreePort finds an available free port on the OS

func NewDeployment added in v0.11.0

func NewDeployment() *unstructured.Unstructured

func NewPod added in v0.11.0

func NewPod() *unstructured.Unstructured

func NewService added in v0.11.0

func NewService() *unstructured.Unstructured

func StartInformer added in v0.11.0

func StartInformer(informer cache.SharedIndexInformer) context.CancelFunc

StartInformer is a helper to start an informer, wait for its cache to sync and return a cancel func

func WaitForPortListen added in v0.11.0

func WaitForPortListen(addr string, timeout time.Duration) error

WaitForPortListen waits until the given address is listening on the port

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL