Documentation ¶
Index ¶
- Constants
- Variables
- func HasOption(options []Option, option Option) bool
- func ResourceMessage(resource *unstructured.Unstructured) string
- type Bootstrapper
- func (b *Bootstrapper) Apply(resource *unstructured.Unstructured, gvr *schema.GroupVersionResource) error
- func (b *Bootstrapper) Destroy(resource *unstructured.Unstructured, gvr *schema.GroupVersionResource) error
- func (b *Bootstrapper) RunAction(action bootstrapAction, resources ...*unstructured.Unstructured) error
- type Client
- func (client *Client) Apply(resource *unstructured.Unstructured, gvr *schema.GroupVersionResource) error
- func (client *Client) Destroy(resource *unstructured.Unstructured, gvr *schema.GroupVersionResource) error
- func (client *Client) GetGroupVersionResource(gvk schema.GroupVersionKind) (*schema.GroupVersionResource, error)
- func (client *Client) WaitForDestroy(resource *unstructured.Unstructured, gvr *schema.GroupVersionResource) error
- func (client *Client) WaitForReady(resource *unstructured.Unstructured, gvr *schema.GroupVersionResource) error
- type Option
Constants ¶
const (
FieldManager = "platform-bootstrapper"
)
Variables ¶
var ( ErrCreateKubeClient = errors.New("unable to create kubernetes client") ErrCreateDiscoveryClient = errors.New("unable to create discovery client") ErrGetAPIResources = errors.New("unable to retrieve the api resources") ErrGetRESTMapping = errors.New("unable to retrieve rest mapping") ErrMissingResource = errors.New("unable to use nil resource") ErrMissingGroupVersionResource = errors.New("unable to use nil group version resource") )
Functions ¶
func ResourceMessage ¶
func ResourceMessage(resource *unstructured.Unstructured) string
ResourceMessage returns the string used for logging messages for resources.
Types ¶
type Bootstrapper ¶
Bootstrapper represents the object that is performing the bootstrapping process.
func NewBootstrapper ¶
func NewBootstrapper(client *Client, options ...Option) *Bootstrapper
NewBootstrapper returns a new instance of a bootstrapper object.
func (*Bootstrapper) Apply ¶
func (b *Bootstrapper) Apply(resource *unstructured.Unstructured, gvr *schema.GroupVersionResource) error
Apply runs the specific apply action for the bootstrapper.
func (*Bootstrapper) Destroy ¶
func (b *Bootstrapper) Destroy(resource *unstructured.Unstructured, gvr *schema.GroupVersionResource) error
Destroy runs the specific destroy action for the bootstrapper.
func (*Bootstrapper) RunAction ¶
func (b *Bootstrapper) RunAction(action bootstrapAction, resources ...*unstructured.Unstructured) error
RunAction runs a specific bootstrap action against a set of resources.
type Client ¶
type Client struct { Context context.Context Client *dynamic.DynamicClient Config *rest.Config API *restmapper.DeferredDiscoveryRESTMapper }
Client represents the boostrapper client which is used to interact with the Kubernetes API for bootstrapping resources.
func (*Client) Apply ¶
func (client *Client) Apply(resource *unstructured.Unstructured, gvr *schema.GroupVersionResource) error
Apply applies a particular resource to a cluster.
func (*Client) Destroy ¶
func (client *Client) Destroy(resource *unstructured.Unstructured, gvr *schema.GroupVersionResource) error
Destroy removes a particular resource from a cluster.
func (*Client) GetGroupVersionResource ¶
func (client *Client) GetGroupVersionResource(gvk schema.GroupVersionKind) (*schema.GroupVersionResource, error)
GetGroupVersionResource returns the GroupVersionResource object from a particular resource.
func (*Client) WaitForDestroy ¶
func (client *Client) WaitForDestroy(resource *unstructured.Unstructured, gvr *schema.GroupVersionResource) error
WaitForMissing waits for a particular resource to be missing.
func (*Client) WaitForReady ¶
func (client *Client) WaitForReady(resource *unstructured.Unstructured, gvr *schema.GroupVersionResource) error
WaitForReady waits for a particular resource to be ready.