eventshub

package
v0.0.0-...-5fb93a7 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: Apache-2.0 Imports: 5 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 templates embed.FS

func main() {
	ctx := testlog.NewContext()
	files, err := manifest.ExecuteYAML(ctx, templates, nil,
		map[string]interface{}{
			"name":      "examplen",
			"namespace": "example",
		})
	if err != nil {
		panic(err)
	}

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

apiVersion: v1
kind: ServiceAccount
metadata:
  name: examplen
  namespace: example
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: examplen
  namespace: example
rules:
  - apiGroups: [ "" ]
    resources:
      - "pods"
    verbs:
      - "get"
      - "list"
  - apiGroups: [ "" ]
    resources:
      - "events"
    verbs:
      - "*"
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: examplen
  namespace: example
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: examplen
subjects:
  - kind: ServiceAccount
    name: examplen
    namespace: example

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Install

func Install(cfg map[string]interface{}) feature.StepFn

Install creates the necessary ServiceAccount, Role, RoleBinding for the eventshub. The resources are named according to the current namespace defined in the environment.

Types

This section is empty.

Jump to

Keyboard shortcuts

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