Documentation ¶
Overview ¶
Package contract provides support for the ClusterReconciler to handle with providers objects according to the Cluster API contract.
Index ¶
- func GetNestedRef(obj *unstructured.Unstructured, fields ...string) (*corev1.ObjectReference, error)
- func ObjToRef(obj client.Object) *corev1.ObjectReference
- func SetNestedRef(obj, refObj *unstructured.Unstructured, fields ...string) error
- type Bool
- type BootstrapConfigTemplateContract
- type BootstrapConfigTemplateTemplate
- type BootstrapContract
- type Duration
- type Int64
- type Metadata
- type Path
- type Ref
- type String
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetNestedRef ¶
func GetNestedRef(obj *unstructured.Unstructured, fields ...string) (*corev1.ObjectReference, error)
GetNestedRef returns the ref value from a nested field in an Unstructured object.
func ObjToRef ¶
func ObjToRef(obj client.Object) *corev1.ObjectReference
ObjToRef returns a reference to the given object.
func SetNestedRef ¶
func SetNestedRef(obj, refObj *unstructured.Unstructured, fields ...string) error
SetNestedRef sets the value of a nested field in an Unstructured to a reference to the refObj provided.
Types ¶
type Bool ¶
type Bool struct {
// contains filtered or unexported fields
}
Bool represents an accessor to an bool path value.
func (*Bool) Get ¶
func (b *Bool) Get(obj *unstructured.Unstructured) (*bool, error)
Get gets the bool value.
func (*Bool) Set ¶
func (b *Bool) Set(obj *unstructured.Unstructured, value bool) error
Set sets the bool value in the path.
type BootstrapConfigTemplateContract ¶
type BootstrapConfigTemplateContract struct{}
BootstrapConfigTemplateContract encodes information about the Cluster API contract for BootstrapConfigTemplate objects like KubeadmConfigTemplate, etc.
func BootstrapConfigTemplate ¶
func BootstrapConfigTemplate() *BootstrapConfigTemplateContract
BootstrapConfigTemplate provide access to the information about the Cluster API contract for BootstrapConfigTemplate objects.
func (*BootstrapConfigTemplateContract) Template ¶
func (c *BootstrapConfigTemplateContract) Template() *BootstrapConfigTemplateTemplate
Template provides access to the template.
type BootstrapConfigTemplateTemplate ¶
type BootstrapConfigTemplateTemplate struct{}
BootstrapConfigTemplateTemplate provides a helper struct for working with the template in an BootstrapConfigTemplate.
func (*BootstrapConfigTemplateTemplate) Metadata ¶
func (c *BootstrapConfigTemplateTemplate) Metadata() *Metadata
Metadata provides access to the metadata of a template.
type BootstrapContract ¶
type BootstrapContract struct{}
BootstrapContract encodes information about the Cluster API contract for bootstrap objects.
func Bootstrap ¶
func Bootstrap() *BootstrapContract
Bootstrap provide access to the information about the Cluster API contract for bootstrap objects.
func (*BootstrapContract) DataSecretName ¶
func (b *BootstrapContract) DataSecretName() *String
DataSecretName provide access to status.dataSecretName field in a bootstrap object.
func (*BootstrapContract) FailureMessage ¶
func (b *BootstrapContract) FailureMessage() *String
FailureMessage provides access to the status.failureMessage field in an bootstrap object. Note that this field is optional.
func (*BootstrapContract) FailureReason ¶
func (b *BootstrapContract) FailureReason() *String
FailureReason provides access to the status.failureReason field in an bootstrap object. Note that this field is optional.
func (*BootstrapContract) Ready ¶
func (b *BootstrapContract) Ready() *Bool
Ready provide access to status.ready field in a bootstrap object.
type Duration ¶
type Duration struct {
// contains filtered or unexported fields
}
Duration represents an accessor to a metav1.Duration path value.
func (*Duration) Get ¶
func (i *Duration) Get(obj *unstructured.Unstructured) (*metav1.Duration, error)
Get gets the metav1.Duration value.
func (*Duration) Set ¶
func (i *Duration) Set(obj *unstructured.Unstructured, value metav1.Duration) error
Set sets the metav1.Duration value in the path.
type Int64 ¶
type Int64 struct {
// contains filtered or unexported fields
}
Int64 represents an accessor to an int64 path value.
func (*Int64) Get ¶
func (i *Int64) Get(obj *unstructured.Unstructured) (*int64, error)
Get gets the int64 value.
func (*Int64) Set ¶
func (i *Int64) Set(obj *unstructured.Unstructured, value int64) error
Set sets the int64 value in the path.
type Metadata ¶
type Metadata struct {
// contains filtered or unexported fields
}
Metadata provides a helper struct for working with Metadata.
func (*Metadata) Get ¶
func (m *Metadata) Get(obj *unstructured.Unstructured) (*v1beta1.ObjectMeta, error)
Get gets the metadata object.
func (*Metadata) Set ¶
func (m *Metadata) Set(obj *unstructured.Unstructured, metadata *v1beta1.ObjectMeta) error
Set sets the metadata value. Note: We are blanking out empty label annotations, thus avoiding triggering infinite reconcile given that at json level label: {} or annotation: {} is different from no field, which is the corresponding value stored in etcd given that those fields are defined as omitempty.
type Path ¶
type Path []string
Path defines a how to access a field in an Unstructured object.
func (Path) IsParentOf ¶
IsParentOf check if one path is Parent of the other.
type Ref ¶
type Ref struct {
// contains filtered or unexported fields
}
Ref provide a helper struct for working with references in Unstructured objects.
func (*Ref) Get ¶
func (r *Ref) Get(obj *unstructured.Unstructured) (*corev1.ObjectReference, error)
Get gets the reference value from the Unstructured object.
func (*Ref) Set ¶
func (r *Ref) Set(obj, refObj *unstructured.Unstructured) error
Set sets the reference value in the Unstructured object.
type String ¶
type String struct {
// contains filtered or unexported fields
}
String represents an accessor to a string path value.
func (*String) Get ¶
func (s *String) Get(obj *unstructured.Unstructured) (*string, error)
Get gets the string value.
func (*String) Set ¶
func (s *String) Set(obj *unstructured.Unstructured, value string) error
Set sets the string value in the path.