Documentation ¶
Index ¶
- Constants
- Variables
- func Annotate(obj *unstructured.Unstructured, key, val string) *unstructured.Unstructured
- func DemoDeployment() *appsv1.Deployment
- func GetFreePort() (int, error)
- func HelmHook(obj *unstructured.Unstructured, hookType string) *unstructured.Unstructured
- func Hook(obj *unstructured.Unstructured, hookType v1alpha1.HookType) *unstructured.Unstructured
- func NewCRD() *unstructured.Unstructured
- func NewDeployment() *unstructured.Unstructured
- func NewFakeConfigMap() *apiv1.ConfigMap
- func NewFakeProjLister(objects ...runtime.Object) applister.AppProjectNamespaceLister
- func NewFakeSecret(policy ...string) *apiv1.Secret
- func NewHook(hookType v1alpha1.HookType) *unstructured.Unstructured
- func NewPod() *unstructured.Unstructured
- func NewService() *unstructured.Unstructured
- func StartInformer(informer cache.SharedIndexInformer) context.CancelFunc
- func WaitForPortListen(addr string, timeout time.Duration) error
Constants ¶
View Source
const ( FakeArgoCDNamespace = "fake-argocd-ns" FakeDestNamespace = "fake-dest-ns" FakeClusterURL = "https://fake-cluster:443" )
Variables ¶
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 Annotate ¶ added in v1.1.2
func Annotate(obj *unstructured.Unstructured, key, val string) *unstructured.Unstructured
func DemoDeployment ¶
func DemoDeployment() *appsv1.Deployment
func GetFreePort ¶ added in v0.11.0
GetFreePort finds an available free port on the OS
func HelmHook ¶ added in v1.1.2
func HelmHook(obj *unstructured.Unstructured, hookType string) *unstructured.Unstructured
func Hook ¶ added in v1.1.2
func Hook(obj *unstructured.Unstructured, hookType v1alpha1.HookType) *unstructured.Unstructured
func NewCRD ¶ added in v1.2.4
func NewCRD() *unstructured.Unstructured
func NewDeployment ¶ added in v0.11.0
func NewDeployment() *unstructured.Unstructured
func NewFakeConfigMap ¶ added in v0.11.1
func NewFakeProjLister ¶ added in v0.11.1
func NewFakeProjLister(objects ...runtime.Object) applister.AppProjectNamespaceLister
func NewFakeSecret ¶ added in v0.11.1
func NewHook ¶ added in v1.1.0
func NewHook(hookType v1alpha1.HookType) *unstructured.Unstructured
DEPRECATED use `Hook(NewPod())` or similar instead
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
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.