packages

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: Apache-2.0 Imports: 19 Imported by: 16

Documentation

Index

Constants

View Source
const (
	// BuiltinPackageDomain Specify the domain of the built-in package
	BuiltinPackageDomain = "kube"
	// K8sResourcePrefix Indicates that the definition comes from kubernetes
	K8sResourcePrefix = "io_k8s_api_"

	// ParseJSONSchemaErr describes the error that occurs when cue parses json
	ParseJSONSchemaErr ParseErrType = "parse json schema of k8s crds error"
)

Variables

This section is empty.

Functions

func IsCUEParseErr

func IsCUEParseErr(err error) bool

IsCUEParseErr returns true if the specified error is CUEParseError type.

Types

type CUEParseError

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

CUEParseError describes an error when CUE parse error

func (CUEParseError) Error

func (cueErr CUEParseError) Error() string

Error implements the Error interface.

type PackageDiscover

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

PackageDiscover defines the inner CUE packages loaded from K8s cluster

func NewPackageDiscover

func NewPackageDiscover(config *rest.Config) (*PackageDiscover, error)

NewPackageDiscover will create a PackageDiscover client with the K8s config file.

func (*PackageDiscover) Exist

Exist checks if the GVK exists in the built-in packages

func (*PackageDiscover) ImportBuiltinPackagesFor

func (pd *PackageDiscover) ImportBuiltinPackagesFor(bi *build.Instance)

ImportBuiltinPackagesFor will add KubeVela built-in packages into your CUE instance

func (*PackageDiscover) ImportPackagesAndBuildInstance

func (pd *PackageDiscover) ImportPackagesAndBuildInstance(bi *build.Instance) (inst *cue.Instance, err error)

ImportPackagesAndBuildInstance Combine import built-in packages and build cue template together to avoid data race nolint:staticcheck

func (*PackageDiscover) ImportPackagesAndBuildValue

func (pd *PackageDiscover) ImportPackagesAndBuildValue(bi *build.Instance) (val cue.Value, err error)

ImportPackagesAndBuildValue Combine import built-in packages and build cue template together to avoid data race

func (*PackageDiscover) ListPackageKinds

func (pd *PackageDiscover) ListPackageKinds() map[string][]VersionKind

ListPackageKinds list packages and their kinds

func (*PackageDiscover) RefreshKubePackagesFromCluster

func (pd *PackageDiscover) RefreshKubePackagesFromCluster() error

RefreshKubePackagesFromCluster will use K8s client to load/refresh all K8s open API as a reference kube package using in template

type ParseErrType

type ParseErrType string

ParseErrType represents the type of CUEParseError

type VersionKind

type VersionKind struct {
	DefinitionName string
	APIVersion     string
	Kind           string
}

VersionKind contains the resource metadata and reference name

Jump to

Keyboard shortcuts

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