Documentation
¶
Index ¶
- Variables
- func BuildToInfrastructureMapFunc(ctx context.Context, gvk schema.GroupVersionKind, c client.Client, ...) handler.MapFunc
- func CalculateCRDName(group, kind string) string
- func EnsureCredentialsSecret(ctx context.Context, client client.Client, build *buildv1.Build, ...) error
- func GetBuildByName(ctx context.Context, c client.Client, namespace, name string) (*buildv1.Build, error)
- func GetGVKMetadata(ctx context.Context, c client.Client, gvk schema.GroupVersionKind) (*metav1.PartialObjectMetadata, error)
- func GetOwnerBuild(ctx context.Context, c client.Client, obj metav1.ObjectMeta) (*buildv1.Build, error)
- func GetProvisionerByID(build *buildv1.Build, id string) (*buildv1.ProvisionerSpec, error)
- func GetSecretFromSecretReference(ctx context.Context, c client.Client, secretRef corev1.SecretReference) (*corev1.Secret, error)
- func HasPaused(o metav1.Object) bool
- func HasWatchLabel(o metav1.Object, labelValue string) bool
- func IsNil(i interface{}) bool
- func IsPaused(build *buildv1.Build, o metav1.Object) bool
- func UnstructuredUnmarshalField(obj *unstructured.Unstructured, v interface{}, fields ...string) error
- type KubeAwareAPIVersions
- type SSHCredentials
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoCluster is returned when the cluster // label could not be found on the object passed in. ErrNoCluster = fmt.Errorf("no %q label present", buildv1.BuildNameLabel) // ErrUnstructuredFieldNotFound determines that a field // in an unstructured object could not be found. ErrUnstructuredFieldNotFound = fmt.Errorf("field not found") )
Functions ¶
func BuildToInfrastructureMapFunc ¶
func BuildToInfrastructureMapFunc(ctx context.Context, gvk schema.GroupVersionKind, c client.Client, providerBuild client.Object) handler.MapFunc
BuildToInfrastructureMapFunc returns a handler.ToRequestsFunc that watches for Build events and returns reconciliation requests for an infrastructure provider object.
func CalculateCRDName ¶
CalculateCRDName generates a CRD name based on group and kind according to the naming conventions in the contract.
func EnsureCredentialsSecret ¶
func EnsureCredentialsSecret(ctx context.Context, client client.Client, build *buildv1.Build, creds SSHCredentials, provider string) error
EnsureCredentialsSecret ensures that the Build has a secret with the SSH credentials.
func GetBuildByName ¶
func GetBuildByName(ctx context.Context, c client.Client, namespace, name string) (*buildv1.Build, error)
GetBuildByName finds and return a Build object using the specified params.
func GetGVKMetadata ¶
func GetGVKMetadata(ctx context.Context, c client.Client, gvk schema.GroupVersionKind) (*metav1.PartialObjectMetadata, error)
GetGVKMetadata retrieves a CustomResourceDefinition metadata from the API server using partial object metadata.
This function is greatly more efficient than GetCRDWithContract and should be preferred in most cases.
func GetOwnerBuild ¶
func GetOwnerBuild(ctx context.Context, c client.Client, obj metav1.ObjectMeta) (*buildv1.Build, error)
GetOwnerBuild returns the Build object owning the current resource.
func GetProvisionerByID ¶
func GetSecretFromSecretReference ¶
func GetSecretFromSecretReference(ctx context.Context, c client.Client, secretRef corev1.SecretReference) (*corev1.Secret, error)
GetSecretFromSecretReference returns the secret data from the secret reference.
func HasWatchLabel ¶
HasWatchLabel returns true if the object has a label with the WatchLabel key matching the given value.
func IsNil ¶
func IsNil(i interface{}) bool
IsNil returns an error if the passed interface is equal to nil or if it has an interface value of nil.
func IsPaused ¶
IsPaused returns true if the Cluster is paused or the object has the `paused` annotation.
func UnstructuredUnmarshalField ¶
func UnstructuredUnmarshalField(obj *unstructured.Unstructured, v interface{}, fields ...string) error
UnstructuredUnmarshalField is a wrapper around json and unstructured objects to decode and copy a specific field value into an object.
Types ¶
type KubeAwareAPIVersions ¶
type KubeAwareAPIVersions []string
KubeAwareAPIVersions is a sortable slice of kube-like version strings.
Kube-like version strings are starting with a v, followed by a major version, optional "alpha" or "beta" strings followed by a minor version (e.g. v1, v2beta1). Versions will be sorted based on GA/alpha/beta first and then major and minor versions. e.g. v2, v1, v1beta2, v1beta1, v1alpha1.
func (KubeAwareAPIVersions) Len ¶
func (k KubeAwareAPIVersions) Len() int
func (KubeAwareAPIVersions) Less ¶
func (k KubeAwareAPIVersions) Less(i, j int) bool
func (KubeAwareAPIVersions) Swap ¶
func (k KubeAwareAPIVersions) Swap(i, j int)
Directories
¶
Path | Synopsis |
---|---|
Package annotations implements annotation helper functions.
|
Package annotations implements annotation helper functions. |
Package conversion implements conversion utilities.
|
Package conversion implements conversion utilities. |
Package predicates implements predicate utilities.
|
Package predicates implements predicate utilities. |