Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReplaceOwningInventoryID ¶
func ReplaceOwningInventoryID(obj *unstructured.Unstructured, oldID, newID string) (bool, error)
ReplaceOwningInventoryID updates the object owning inventory annotation to the new ID when the owning inventory annotation is either empty or the old ID. It returns true if the annotation is updated.
func UpdateLabelsAndAnnotations ¶
func UpdateLabelsAndAnnotations(obj *unstructured.Unstructured, labels, annotations map[string]string) error
UpdateLabelsAndAnnotations updates .metadata.labels and .metadata.annotations fields of obj to use the passed in labels and annotations. It also updates the last-applied-configuration annotations.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the client to update object in the API server.
func NewClient ¶
func NewClient(d dynamic.Interface, mapper meta.RESTMapper) *Client
NewClient returns a client to get and update an object.
func (*Client) Get ¶
func (uc *Client) Get(ctx context.Context, meta object.ObjMetadata) (*unstructured.Unstructured, error)
Get fetches the requested object into the input obj using dynamic client
func (*Client) Update ¶
func (uc *Client) Update(ctx context.Context, meta object.ObjMetadata, obj *unstructured.Unstructured, options *metav1.UpdateOptions) error
Update updates an object using dynamic client
Click to show internal directories.
Click to hide internal directories.