Documentation ¶
Index ¶
- Variables
- func CheckServiceAccountForUpdate(current, updated *unstructured.Unstructured) (bool, error)
- func PrepareDeploymentForUpdate(current, updated *unstructured.Unstructured) error
- func PrepareServiceForUpdate(current, updated *unstructured.Unstructured) error
- type Client
- func (c *Client) ClientFor(apiVersion, kind, namespace string) (*ResourceClient, error)
- func (c *Client) ClientForUnstructured(u *unstructured.Unstructured) (*ResourceClient, error)
- func (c *Client) SetUpdateChecks(checks []UpdateCheck)
- func (c *Client) SetUpdatePreparations(preparations []UpdatePreparation)
- func (c *Client) WithLogger(logger log.Logger)
- type ResourceClient
- type UpdateCheck
- type UpdateCheckFunc
- type UpdatePreparation
- type UpdatePreparationFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultUpdatePreparations = []UpdatePreparation{ UpdatePreparationFunc(PrepareServiceForUpdate), UpdatePreparationFunc(PrepareDeploymentForUpdate), } DefaultUpdateChecks = []UpdateCheck{ UpdateCheckFunc(CheckServiceAccountForUpdate), } )
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 (*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 ¶
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
Click to show internal directories.
Click to hide internal directories.