crd

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractSecrets

func ExtractSecrets(componentName string, schema Schema, spec map[string]interface{}) (map[string]string, error)

func Fetch

func Fetch(configDir, version string) (string, error)

Fetch downloads the release version of TriggerMesh CRDs for specified version.

func ListSources

func ListSources(crdFile string) ([]string, error)

ListSources returns the list of resources of the "source" API group from CRD.

func ListTargets

func ListTargets(crdFile string) ([]string, error)

ListTargets returns the list of resources of the "target" API group from CRD.

Types

type CRD

type CRD struct {
	APIVersion string `yaml:"apiVersion"`
	Kind       string `yaml:"kind"`
	Metadata   struct {
		Name        string `yaml:"name"`
		Annotations struct {
			EventTypes string `yaml:"registry.knative.dev/eventTypes"`
		} `yaml:"annotations"`
	} `yaml:"metadata"`
	Spec struct {
		Group string `yaml:"group"`
		Scope string `yaml:"scope"`
		Names struct {
			Kind       string   `yaml:"kind"`
			Plural     string   `yaml:"plural"`
			Categories []string `yaml:"categories"`
		} `yaml:"names"`
		Versions []struct {
			Name         string `yaml:"name"`
			Served       bool   `yaml:"served"`
			Storage      bool   `yaml:"storage"`
			Subresources struct {
				Status struct {
				} `yaml:"status"`
			} `yaml:"subresources"`
			Schema struct {
				OpenAPIV3Schema struct {
					Properties struct {
						Spec map[string]interface{} `yaml:"spec"`
					} `yaml:"properties"`
				} `yaml:"openAPIV3Schema"`
			} `yaml:"schema"`
		} `yaml:"versions"`
	} `yaml:"spec"`
}

func GetResourceCRD

func GetResourceCRD(resource, path string) (CRD, error)

type EventTypes

type EventTypes []struct {
	Type string `json:"type"`
}

type Property

type Property struct {
	Required    bool
	Typ         string
	Description string
}

type Schema

type Schema struct {
	// contains filtered or unexported fields
}

func GetSchema

func GetSchema(schema map[string]interface{}) (*Schema, error)

func (*Schema) GetAttributesCompletion

func (s *Schema) GetAttributesCompletion(path ...string) (bool, map[string]Property)

GetAttributesCompletion returns the completion options for requested schema path.

func (*Schema) Process

func (s *Schema) Process(spec map[string]interface{}) (map[string]interface{}, error)

func (*Schema) Validate

func (s *Schema) Validate(spec map[string]interface{}) error

Jump to

Keyboard shortcuts

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