client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

Functions

func CheckServiceAccountForUpdate

func CheckServiceAccountForUpdate(current, updated *unstructured.Unstructured) (bool, error)

For ServiceAccount, check if name/namespace/labels/annotations change, then do update. or else, it creates secrets per time when do update.

func PrepareDeploymentForUpdate

func PrepareDeploymentForUpdate(current, updated *unstructured.Unstructured) error

func PrepareServiceForUpdate

func PrepareServiceForUpdate(current, updated *unstructured.Unstructured) error

Types

type Client

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

func NewClient

func NewClient(cfg *rest.Config, kclient kubernetes.Interface) *Client

func (*Client) ClientFor

func (c *Client) ClientFor(apiVersion, kind, namespace string) (*ResourceClient, error)

func (*Client) ClientForUnstructured

func (c *Client) ClientForUnstructured(u *unstructured.Unstructured) (*ResourceClient, error)

func (*Client) SetUpdateChecks

func (c *Client) SetUpdateChecks(checks []UpdateCheck)

func (*Client) SetUpdatePreparations

func (c *Client) SetUpdatePreparations(preparations []UpdatePreparation)

func (*Client) WithLogger

func (c *Client) WithLogger(logger log.Logger)

type ResourceClient

type ResourceClient struct {
	dynamic.ResourceInterface
	// contains filtered or unexported fields
}

func (*ResourceClient) UpdateWithCurrent

func (rc *ResourceClient) UpdateWithCurrent(ctx context.Context, current, updated *unstructured.Unstructured, subresources ...string) (*unstructured.Unstructured, error)

type UpdateCheck

type UpdateCheck interface {
	Check(current, updated *unstructured.Unstructured) (bool, error)
}

type UpdateCheckFunc

type UpdateCheckFunc func(current, updated *unstructured.Unstructured) (bool, error)

func (UpdateCheckFunc) Check

func (f UpdateCheckFunc) Check(current, updated *unstructured.Unstructured) (bool, error)

type UpdatePreparation

type UpdatePreparation interface {
	Prepare(current, updated *unstructured.Unstructured) error
}

type UpdatePreparationFunc

type UpdatePreparationFunc func(current, updated *unstructured.Unstructured) error

func (UpdatePreparationFunc) Prepare

func (f UpdatePreparationFunc) Prepare(current, updated *unstructured.Unstructured) error

Jump to

Keyboard shortcuts

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