Documentation
¶
Overview ¶
Package executor performs identity-constrained server-side apply as an explicit service account.
Index ¶
- Constants
- type Client
- func (c *Client) Apply(ctx context.Context, p Participant, prepared *Prepared, phase string) (gone bool, err error)
- func (c *Client) Get(ctx context.Context, p Participant, sub string) (*unstructured.Unstructured, error)
- func (c *Client) List(ctx context.Context, t policy.Target, namespace string) ([]unstructured.Unstructured, error)
- func (c *Client) Prepare(_ context.Context, p Participant, step *api.ActionStep, data map[string]any) (*Prepared, error)
- type Factory
- type Interface
- type Participant
- type Prepared
Constants ¶
View Source
const MaxParticipants = 256
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Dynamic dynamic.Interface
Discovery discovery.DiscoveryInterface
FieldManager string
}
func (*Client) Apply ¶
func (c *Client) Apply(ctx context.Context, p Participant, prepared *Prepared, phase string) (gone bool, err error)
Apply never creates a resource. UID and resourceVersion preconditions protect deletion/recreation and concurrent writes, including subresource writes.
func (*Client) Get ¶
func (c *Client) Get(ctx context.Context, p Participant, sub string) (*unstructured.Unstructured, error)
type Factory ¶
func NewFactory ¶
func NewFactory(config *rest.Config, disc discovery.DiscoveryInterface) Factory
type Interface ¶
type Interface interface {
List(context.Context, policy.Target, string) ([]unstructured.Unstructured, error)
Get(context.Context, Participant, string) (*unstructured.Unstructured, error)
Prepare(context.Context, Participant, *api.ActionStep, map[string]any) (*Prepared, error)
Apply(context.Context, Participant, *Prepared, string) (bool, error)
}
type Participant ¶
type Participant struct {
Resource schema.GroupVersionResource `json:"resource"`
APIVersion string `json:"apiVersion"`
Kind string `json:"kind"`
Namespace string `json:"namespace"`
Name string `json:"name"`
UID types.UID `json:"uid"`
Action string `json:"action"`
Captured map[string]json.RawMessage `json:"captured,omitempty"`
Start *Prepared `json:"start,omitempty"`
End *Prepared `json:"end,omitempty"`
// Attempted is persisted before applying; a lost response still requires restore.
Attempted bool `json:"attempted,omitempty"`
Started bool `json:"started,omitempty"`
Finished bool `json:"finished,omitempty"`
}
func PrepareParticipant ¶
func PrepareParticipant(ctx context.Context, c Interface, target policy.Target, obj unstructured.Unstructured, a api.ResourceAction, w schedule.Window, now time.Time) (Participant, error)
Click to show internal directories.
Click to hide internal directories.