flaker

package
v0.36.3 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Example
package main

import (
	"embed"
	"os"

	testlog "knative.dev/reconciler-test/pkg/logging"
	"knative.dev/reconciler-test/pkg/manifest"
)

//go:embed *.yaml
var yaml embed.FS

func main() {
	ctx := testlog.NewContext()
	images := map[string]string{
		"ko://knative.dev/eventing/test/test_images/event-flaker": "gcr.io/knative-samples/helloworld-go",
	}
	cfg := map[string]interface{}{
		"name":      "foo",
		"namespace": "bar",
		"sink":      "uri://to/a/sink",
	}

	files, err := manifest.ExecuteYAML(ctx, yaml, images, cfg)
	if err != nil {
		panic(err)
	}

	manifest.OutputYAML(os.Stdout, files)
}
Output:

apiVersion: v1
kind: Pod
metadata:
  name: foo
  namespace: bar
  labels:
    app: flaker-foo
spec:
  restartPolicy: "Never"
  containers:
    - name: flaker
      image: gcr.io/knative-samples/helloworld-go
      imagePullPolicy: "IfNotPresent"
      env:
        - name: "K_SINK"
          value: "uri://to/a/sink"
---
apiVersion: v1
kind: Service
metadata:
  name: foo
  namespace: bar
spec:
  selector:
    app: flaker-foo
  ports:
    - protocol: TCP
      port: 80
      targetPort: 8080

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsRef

func AsRef(name string) *duckv1.KReference

AsRef returns a KRef for a Service without namespace.

func Install

func Install(name, sink string) feature.StepFn

Install

Types

This section is empty.

Jump to

Keyboard shortcuts

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