Documentation ¶
Overview ¶
Example (Full) ¶
package main import ( "os" "knative.dev/reconciler-test/pkg/manifest" ) func main() { images := map[string]string{} cfg := map[string]interface{}{ "name": "foo", "namespace": "bar", "brokerClass": "a-broker-class", "config": map[string]interface{}{ "kind": "cfgkind", "name": "cfgname", "apiVersion": "cfgapi", }, "delivery": map[string]interface{}{ "retry": "42", "backoffPolicy": "exponential", "backoffDelay": "2007-03-01T13:00:00Z/P1Y2M10DT2H30M", "deadLetterSink": map[string]interface{}{ "ref": map[string]string{ "kind": "deadkind", "name": "deadname", "apiVersion": "deadapi", }, "uri": "/extra/path", }, }, } files, err := manifest.ExecuteLocalYAML(images, cfg) if err != nil { panic(err) } manifest.OutputYAML(os.Stdout, files) }
Output: apiVersion: eventing.knative.dev/v1 kind: Broker metadata: name: foo namespace: bar annotations: eventing.knative.dev/broker.class: a-broker-class spec: config: kind: cfgkind namespace: bar name: cfgname apiVersion: cfgapi delivery: deadLetterSink: ref: kind: deadkind namespace: bar name: deadname apiVersion: deadapi uri: /extra/path retry: 42 backoffPolicy: exponential backoffDelay: "2007-03-01T13:00:00Z/P1Y2M10DT2H30M"
Example (Min) ¶
package main import ( "os" "knative.dev/reconciler-test/pkg/manifest" ) func main() { images := map[string]string{} cfg := map[string]interface{}{ "name": "foo", "namespace": "bar", "brokerName": "baz", } files, err := manifest.ExecuteLocalYAML(images, cfg) if err != nil { panic(err) } manifest.OutputYAML(os.Stdout, files) }
Output: apiVersion: eventing.knative.dev/v1 kind: Broker metadata: name: foo namespace: bar spec:
Index ¶
- Variables
- func Address(ctx context.Context, name string, timings ...time.Duration) (*apis.URL, error)
- func GVR() schema.GroupVersionResource
- func Install(name string, opts ...manifest.CfgFn) feature.StepFn
- func IsAddressable(name string, timings ...time.Duration) feature.StepFn
- func IsReady(name string, timing ...time.Duration) feature.StepFn
- func WithBrokerClass(class string) manifest.CfgFn
- func WithBrokerTemplateFiles(dir string) manifest.CfgFn
- func WithConfig(name string) manifest.CfgFn
- func WithEnvConfig() []manifest.CfgFn
- type EnvConfig
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var WithDeadLetterSink = delivery.WithDeadLetterSink
WithDeadLetterSink adds the dead letter sink related config to a Broker spec.
View Source
var WithRetry = delivery.WithRetry
WithRetry adds the retry related config to a Broker spec.
View Source
var WithTimeout = delivery.WithTimeout
WithTimeout adds the timeout related config to the config.
Functions ¶
func GVR ¶ added in v0.22.0
func GVR() schema.GroupVersionResource
func IsAddressable ¶
IsAddressable tests to see if a Broker becomes addressable within the time given.
func WithBrokerClass ¶
WithBrokerClass adds the broker class config to a Broker spec.
Example ¶
package main import ( "os" "knative.dev/eventing/test/rekt/resources/broker" "knative.dev/reconciler-test/pkg/manifest" ) func main() { images := map[string]string{} cfg := map[string]interface{}{ "name": "foo", "namespace": "bar", } broker.WithBrokerClass("a-broker-class")(cfg) files, err := manifest.ExecuteLocalYAML(images, cfg) if err != nil { panic(err) } manifest.OutputYAML(os.Stdout, files) }
Output: apiVersion: eventing.knative.dev/v1 kind: Broker metadata: name: foo namespace: bar annotations: eventing.knative.dev/broker.class: a-broker-class spec:
func WithBrokerTemplateFiles ¶ added in v0.22.0
func WithConfig ¶ added in v0.24.0
WithConfig adds the specified config map to the Broker spec.
Example ¶
package main import ( "os" "knative.dev/eventing/test/rekt/resources/broker" "knative.dev/reconciler-test/pkg/manifest" ) func main() { images := map[string]string{} cfg := map[string]interface{}{ "name": "foo", "namespace": "bar", } broker.WithConfig("my-funky-config")(cfg) files, err := manifest.ExecuteLocalYAML(images, cfg) if err != nil { panic(err) } manifest.OutputYAML(os.Stdout, files) }
Output: apiVersion: eventing.knative.dev/v1 kind: Broker metadata: name: foo namespace: bar spec: config: kind: ConfigMap namespace: bar name: my-funky-config apiVersion: v1
func WithEnvConfig ¶ added in v0.22.0
Types ¶
Click to show internal directories.
Click to hide internal directories.