Documentation
¶
Index ¶
- Constants
- func AddKCMComponentLabel(ctx context.Context, cl client.Client, o client.Object) (labelsUpdated bool, err error)
- func AddLabel(o client.Object, labelKey, labelValue string) (labelsUpdated bool)
- func AddOwnerReference(dependent, owner client.Object) (changed bool)
- func CheckAllSecretsExistInNamespace(ctx context.Context, cl client.Client, namespace string, names ...string) (exist bool, missingSecrets []string, err error)
- func CopySecret(ctx context.Context, cl client.Client, key client.ObjectKey, ...) error
- func CurrentNamespace() string
- func DetermineDefaultRepositoryType(templatesRepoURL string) (string, error)
- func EnsureDeleteAllOf(ctx context.Context, cl client.Client, gvk schema.GroupVersionKind, ...) error
- func HasLabel(obj client.Object, labelName string) bool
- func ReleaseNameFromVersion(version string) (string, error)
- func SetPredeclaredSecretsCondition(ctx context.Context, cl client.Client, base ObjectConditionGetter, ...) (changed bool, err error)
- func TemplatesChartFromReleaseName(releaseName string) string
- type ObjectConditionGetter
Constants ¶
const ( RegistryTypeOCI = "oci" RegistryTypeDefault = "default" )
const (
DefaultSystemNamespace = "kcm-system"
)
Variables ¶
This section is empty.
Functions ¶
func AddKCMComponentLabel ¶ added in v0.0.7
func AddKCMComponentLabel(ctx context.Context, cl client.Client, o client.Object) (labelsUpdated bool, err error)
AddKCMComponentLabel adds the common KCM component label with the kcm value to the given object and updates it if it is required.
func AddLabel ¶ added in v0.0.7
AddLabel adds the provided label key and value to the object if not presented or if the existing label value does not equal the given one. Returns an indication of whether it updated the labels of the object.
func AddOwnerReference ¶
func CheckAllSecretsExistInNamespace ¶ added in v1.1.0
func CheckAllSecretsExistInNamespace(ctx context.Context, cl client.Client, namespace string, names ...string) (exist bool, missingSecrets []string, err error)
CheckAllSecretsExistInNamespace returns positive if all of the Secrets with the given names exist in the given namespace. Empty names are ignored.
func CopySecret ¶ added in v1.1.0
func CopySecret(ctx context.Context, cl client.Client, key client.ObjectKey, toNamespace string) error
CopySecret copies a Secret with the given key to the given namespace.
func CurrentNamespace ¶
func CurrentNamespace() string
func EnsureDeleteAllOf ¶
func EnsureDeleteAllOf(ctx context.Context, cl client.Client, gvk schema.GroupVersionKind, opts *client.ListOptions) error
func HasLabel ¶ added in v0.3.0
HasLabel is a helper function to check for a specific label existence
func ReleaseNameFromVersion ¶
func SetPredeclaredSecretsCondition ¶ added in v1.1.0
func SetPredeclaredSecretsCondition(ctx context.Context, cl client.Client, base ObjectConditionGetter, eventFn func(runtime.Object, int64, string, string, ...any), namespace string, names ...string) (changed bool, err error)
SetPredeclaredSecretsCondition checks if all Secret objects with the given names in the given namespace exist. If one of the Secret objects does not exist, creates a new warning Event and returns error. In either case, sets the github.com/K0rdent/kcm/api/v1beta1.PredeclaredSecretsExistCondition condition with corresponding status.
Does nothing if all of the given names are empty.
Types ¶
type ObjectConditionGetter ¶ added in v1.1.0
ObjectConditionGetter is a common interface over sigs.k8s.io/controller-runtime/pkg/client.Object that can get a reference to a slice of k8s.io/apimachinery/pkg/apis/meta/v1.Condition to manipulate the object directly.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package pointer provides generic functions to work with pointers.
|
Package pointer provides generic functions to work with pointers. |