k8s

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelWebhookName       = "webhook-name"
	LabelPullRequestNumber = "pull-request-number"
)

Variables

Set provides config and scheme. nolint: gochecknoglobals

Functions

func GVKToTypeMeta

func GVKToTypeMeta(gvk schema.GroupVersionKind) metav1.TypeMeta

func GetObject added in v1.0.0

func GetObject(ctx context.Context, reader client.Reader, scheme *runtime.Scheme, gvk schema.GroupVersionKind, key client.ObjectKey) (client.Object, error)

func LoadConfig

func LoadConfig(config Config) (*rest.Config, error)

func LoadDocuments added in v1.0.0

func LoadDocuments(path string) ([]map[string]interface{}, error)

func LoadObjects added in v1.0.0

func LoadObjects(scheme *runtime.Scheme, path string) (output []client.Object, err error)

func MapObjects added in v1.0.0

func MapObjects(input []client.Object, fn func(client.Object) error) ([]client.Object, error)

func NewEmptyObject added in v1.0.0

func NewEmptyObject(scheme *runtime.Scheme, gvk schema.GroupVersionKind) (client.Object, error)

func NewScheme

func NewScheme() (*runtime.Scheme, error)

func ToObject added in v1.0.0

func ToObject(scheme *runtime.Scheme, data interface{}) (client.Object, error)

func ToUnstructured added in v1.0.0

func ToUnstructured(data interface{}) (*unstructured.Unstructured, error)

Types

type Config

type Config struct {
	Namespace string `mapstructure:"namespace"`
	Config    string `mapstructure:"config"`
}

Jump to

Keyboard shortcuts

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