Documentation
¶
Overview ¶
Example ¶
package main import ( "os" "knative.dev/reconciler-test/pkg/manifest" ) func main() { images := map[string]string{} cfg := map[string]interface{}{ "name": "foo", "namespace": "bar", "role": "baz", "matchLabels": "whomp", } files, err := manifest.ExecuteLocalYAML(images, cfg) if err != nil { panic(err) } manifest.OutputYAML(os.Stdout, files) }
Output: apiVersion: v1 kind: ServiceAccount metadata: name: foo namespace: bar --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: foo subjects: - kind: ServiceAccount name: foo namespace: bar roleRef: kind: ClusterRole name: baz apiGroup: rbac.authorization.k8s.io
Example (AddressableResolver) ¶
package main import ( "os" "knative.dev/eventing/test/rekt/resources/account_role" "knative.dev/reconciler-test/pkg/manifest" ) func main() { images := map[string]string{} cfg := map[string]interface{}{ "name": "foo", "namespace": "bar", } account_role.AsAddressableResolver(cfg) files, err := manifest.ExecuteLocalYAML(images, cfg) if err != nil { panic(err) } manifest.OutputYAML(os.Stdout, files) }
Output: apiVersion: v1 kind: ServiceAccount metadata: name: foo namespace: bar --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: addressable-resolver-collector-foo aggregationRule: clusterRoleSelectors: - matchLabels: duck.knative.dev/addressable: "true" rules: [] --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: foo subjects: - kind: ServiceAccount name: foo namespace: bar roleRef: kind: ClusterRole name: addressable-resolver-collector-foo apiGroup: rbac.authorization.k8s.io
Example (ChannelableManipulator) ¶
package main import ( "os" "knative.dev/eventing/test/rekt/resources/account_role" "knative.dev/reconciler-test/pkg/manifest" ) func main() { images := map[string]string{} cfg := map[string]interface{}{ "name": "foo", "namespace": "bar", } account_role.AsChannelableManipulator(cfg) files, err := manifest.ExecuteLocalYAML(images, cfg) if err != nil { panic(err) } manifest.OutputYAML(os.Stdout, files) }
Output: apiVersion: v1 kind: ServiceAccount metadata: name: foo namespace: bar --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: channelable-manipulator-collector-foo aggregationRule: clusterRoleSelectors: - matchLabels: duck.knative.dev/channelable: "true" rules: [] --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: foo subjects: - kind: ServiceAccount name: foo namespace: bar roleRef: kind: ClusterRole name: channelable-manipulator-collector-foo apiGroup: rbac.authorization.k8s.io
Example (MatchLabel) ¶
package main import ( "os" "knative.dev/reconciler-test/pkg/manifest" ) func main() { images := map[string]string{} cfg := map[string]interface{}{ "name": "foo", "namespace": "bar", "role": "baz", "matchLabel": "whomp", } files, err := manifest.ExecuteLocalYAML(images, cfg) if err != nil { panic(err) } manifest.OutputYAML(os.Stdout, files) }
Output: apiVersion: v1 kind: ServiceAccount metadata: name: foo namespace: bar --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: baz aggregationRule: clusterRoleSelectors: - matchLabels: whomp: "true" rules: [] --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: foo subjects: - kind: ServiceAccount name: foo namespace: bar roleRef: kind: ClusterRole name: baz apiGroup: rbac.authorization.k8s.io
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsAddressableResolver ¶
func AsAddressableResolver(cfg map[string]interface{})
func AsChannelableManipulator ¶
func AsChannelableManipulator(cfg map[string]interface{})
func Install ¶
Install will create a channelable-manipulator bound service account, augmented with the config fn options.
func WithRoleMatchLabel ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.