eventshub

package
v0.0.0-...-1351b60 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: Apache-2.0 Imports: 8 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.

func WithPullSecrets

func WithPullSecrets(ctx context.Context, t feature.T) manifest.CfgFn

Types

This section is empty.

Jump to

Keyboard shortcuts

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