kube

package
v0.0.0-...-91256e5 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: Apache-2.0 Imports: 83 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")
View Source
var ErrUpdateImmutable = errors.New("cannot update immutable. Use -force to delete and recreate")

Functions

func ErrImmutableRessource

func ErrImmutableRessource(attribute string, obj runtime.Object) error

func ErrsEqual

func ErrsEqual(errA, errB error) bool

ErrsEqual checks if two errors are equal.

func Eval

func Eval(name string, src, runCtx interface{}, env starlark.StringDict) (starlark.Value, *bufio.Scanner, error)

Eval executes src in its own Starlark thread and returns a resulting Starlark value and a scanner that can be used to read eval output produced with a "print" built-in.

func KubeNoop

func KubeNoop() starlark.StringDict

KubeNoop returns a new stringDict with noop methods.

func New

func New(
	addr string,
	d discovery.DiscoveryInterface,
	dynC dynamic.Interface,
	c *http.Client,
	config *rest.Config,
	dryRun, force, diff bool,
	diffFilters []string,
) starlark.StringDict

New returns a new StringDict.

func NewFake

func NewFake(force bool) (m starlark.StringDict, closeFn func(), err error)

NewFake returns a new fake kube module for testing. It takes a bool attribute to determine if the starkalrk.HasAttrs object should forcefully update resources

func NoOp

func NoOp(thread *starlark.Thread, f *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error)

func ValueFromJSON

func ValueFromJSON(v interface{}) (starlark.Value, error)

ValueFromJSON converts JSON value to starlark.Value.

func ValueFromNestedMap

func ValueFromNestedMap(m map[string]interface{}) (starlark.Value, error)

ValueFromNestedMap converts nested JSON map oject to starlark.Value.

Types

type DynamicClient

type DynamicClient interface {
	Apply(t *starlark.Thread, name string, namespace string, data *starlark.List) (starlark.Value, error)
}

DynamicClient used for applying dynamic resource manifests

type Module

type Module struct {
	Name  string
	Attrs starlark.StringDict
}

func (*Module) Attr

func (m *Module) Attr(name string) (starlark.Value, error)

Attr implements starlark.HasAttrs.Attr.

func (*Module) AttrNames

func (m *Module) AttrNames() []string

AttrNames implements starlark.HasAttrs.AttrNames.

func (*Module) Freeze

func (m *Module) Freeze()

Freeze implements starlark.Value.Freeze.

func (*Module) Hash

func (m *Module) Hash() (uint32, error)

Hash implements starlark.Value.Hash.

func (*Module) String

func (m *Module) String() string

String implements starlark.Value.String.

func (*Module) Truth

func (m *Module) Truth() starlark.Bool

Truth implements starlark.Value.Truth. Returns true if object is non-empty.

func (*Module) Type

func (m *Module) Type() string

Type implements starlark.Value.Type.

Jump to

Keyboard shortcuts

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