Documentation ¶
Index ¶
- Variables
- func Apply(ctx context.Context, c client.Client, obj *unstructured.Unstructured, ...) (patched *unstructured.Unstructured, err error)
- func GetAnnotation(obj AnnotationHolder, key string) string
- func GetLabel(obj LabelHolder, key string) string
- func GetUnstructured(ctx context.Context, c client.Client, gvk schema.GroupVersionKind, ...) (*unstructured.Unstructured, error)
- func IsGVKEqual(a, b schema.GroupVersionKind) bool
- func ListClusterTemplatesByType(ctx context.Context, c client.Client, tmplTypes []string) ([]cosmov1alpha1.ClusterTemplate, error)
- func ListTemplateObjects(ctx context.Context, c client.Client) ([]cosmov1alpha1.TemplateObject, error)
- func ListTemplateObjectsByType(ctx context.Context, c client.Client, tmplTypes []string) ([]cosmov1alpha1.TemplateObject, error)
- func ListTemplatesByType(ctx context.Context, c client.Client, tmplTypes []string) ([]cosmov1alpha1.Template, error)
- func LooseDeepEqual(xObj, yObj Comparable, opts ...DeepEqualOption) bool
- func PodStatusReason(pod corev1.Pod) string
- func RemoveDynamicFields(obj Comparable)
- func SetAnnotation(obj AnnotationHolder, key, value string)
- type AnnotationHolder
- type ClientMock
- func (c *ClientMock) Clear()
- func (c *ClientMock) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error
- func (c *ClientMock) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error
- func (c *ClientMock) DeleteAllOf(ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption) error
- func (c *ClientMock) Get(ctx context.Context, key client.ObjectKey, obj client.Object, ...) error
- func (c *ClientMock) IsCallingFrom(f interface{}) bool
- func (c *ClientMock) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error
- func (c *ClientMock) Patch(ctx context.Context, obj client.Object, patch client.Patch, ...) error
- func (c *ClientMock) SetCreateError(caller interface{}, retErr error)
- func (c *ClientMock) SetDeleteAllOfError(caller interface{}, retErr error)
- func (c *ClientMock) SetDeleteError(caller interface{}, retErr error)
- func (c *ClientMock) SetGetError(caller interface{}, retErr error)
- func (c *ClientMock) SetListError(caller interface{}, retErr error)
- func (c *ClientMock) SetPatchError(caller interface{}, retErr error)
- func (c *ClientMock) SetUpdateError(caller interface{}, retErr error)
- func (c *ClientMock) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error
- type Comparable
- type DeepEqualOption
- type LabelHolder
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DeploymentGVK = schema.GroupVersionKind{ Group: appsv1.GroupName, Version: "v1", Kind: "Deployment", } ServiceGVK = schema.GroupVersionKind{ Group: corev1.GroupName, Version: "v1", Kind: "Service", } )
Functions ¶
func Apply ¶
func Apply(ctx context.Context, c client.Client, obj *unstructured.Unstructured, fieldManager string, dryrun, force bool) (patched *unstructured.Unstructured, err error)
func GetAnnotation ¶
func GetAnnotation(obj AnnotationHolder, key string) string
func GetLabel ¶
func GetLabel(obj LabelHolder, key string) string
func GetUnstructured ¶
func GetUnstructured(ctx context.Context, c client.Client, gvk schema.GroupVersionKind, name, namespace string) (*unstructured.Unstructured, error)
func IsGVKEqual ¶
func IsGVKEqual(a, b schema.GroupVersionKind) bool
func ListClusterTemplatesByType ¶ added in v0.6.0
func ListClusterTemplatesByType(ctx context.Context, c client.Client, tmplTypes []string) ([]cosmov1alpha1.ClusterTemplate, error)
func ListTemplateObjects ¶ added in v0.6.0
func ListTemplateObjects(ctx context.Context, c client.Client) ([]cosmov1alpha1.TemplateObject, error)
func ListTemplateObjectsByType ¶ added in v0.6.0
func ListTemplateObjectsByType(ctx context.Context, c client.Client, tmplTypes []string) ([]cosmov1alpha1.TemplateObject, error)
func ListTemplatesByType ¶
func LooseDeepEqual ¶
func LooseDeepEqual(xObj, yObj Comparable, opts ...DeepEqualOption) bool
LooseDeepEqual deep equal objects without dynamic values
func PodStatusReason ¶
func RemoveDynamicFields ¶
func RemoveDynamicFields(obj Comparable)
func SetAnnotation ¶
func SetAnnotation(obj AnnotationHolder, key, value string)
Types ¶
type AnnotationHolder ¶
type ClientMock ¶ added in v0.6.0
type ClientMock struct { client.Client GetMock func(ctx context.Context, key client.ObjectKey, obj client.Object, opts ...client.GetOption) (mocked bool, err error) ListMock func(ctx context.Context, list client.ObjectList, opts ...client.ListOption) (mocked bool, err error) CreateMock func(ctx context.Context, obj client.Object, opts ...client.CreateOption) (mocked bool, err error) DeleteMock func(ctx context.Context, obj client.Object, opts ...client.DeleteOption) (mocked bool, err error) UpdateMock func(ctx context.Context, obj client.Object, opts ...client.UpdateOption) (mocked bool, err error) PatchMock func(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption) (mocked bool, err error) DeleteAllOfMock func(ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption) (mocked bool, err error) }
func NewClientMock ¶ added in v0.6.0
func NewClientMock(c client.Client) ClientMock
func (*ClientMock) Clear ¶ added in v0.6.0
func (c *ClientMock) Clear()
func (*ClientMock) Create ¶ added in v0.6.0
func (c *ClientMock) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error
func (*ClientMock) Delete ¶ added in v0.6.0
func (c *ClientMock) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error
func (*ClientMock) DeleteAllOf ¶ added in v0.6.0
func (c *ClientMock) DeleteAllOf(ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption) error
func (*ClientMock) IsCallingFrom ¶ added in v0.6.0
func (c *ClientMock) IsCallingFrom(f interface{}) bool
func (*ClientMock) List ¶ added in v0.6.0
func (c *ClientMock) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error
func (*ClientMock) Patch ¶ added in v0.6.0
func (c *ClientMock) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption) error
func (*ClientMock) SetCreateError ¶ added in v0.6.0
func (c *ClientMock) SetCreateError(caller interface{}, retErr error)
func (*ClientMock) SetDeleteAllOfError ¶ added in v0.6.0
func (c *ClientMock) SetDeleteAllOfError(caller interface{}, retErr error)
func (*ClientMock) SetDeleteError ¶ added in v0.6.0
func (c *ClientMock) SetDeleteError(caller interface{}, retErr error)
func (*ClientMock) SetGetError ¶ added in v0.6.0
func (c *ClientMock) SetGetError(caller interface{}, retErr error)
func (*ClientMock) SetListError ¶ added in v0.6.0
func (c *ClientMock) SetListError(caller interface{}, retErr error)
func (*ClientMock) SetPatchError ¶ added in v0.6.0
func (c *ClientMock) SetPatchError(caller interface{}, retErr error)
func (*ClientMock) SetUpdateError ¶ added in v0.6.0
func (c *ClientMock) SetUpdateError(caller interface{}, retErr error)
func (*ClientMock) Update ¶ added in v0.6.0
func (c *ClientMock) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error
type Comparable ¶
type Comparable interface { runtime.Object SetGroupVersionKind(gvk schema.GroupVersionKind) GetManagedFields() []metav1.ManagedFieldsEntry SetManagedFields(managedFields []metav1.ManagedFieldsEntry) SetResourceVersion(resourceVersion string) }
type DeepEqualOption ¶
type DeepEqualOption interface {
Apply(x, y Comparable)
}
func WithFixGVK ¶
func WithFixGVK(scheme *runtime.Scheme) DeepEqualOption
func WithPrintDiff ¶
func WithPrintDiff(w io.Writer) DeepEqualOption
Click to show internal directories.
Click to hide internal directories.