validate

package
v1.24.1-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const HelmValuesFileDefaultDataKey = "values.yaml"

HelmValuesFileDefaultDataKey is the default data key to use when spec.helm.valuesFileRefs.dataKey is not specified.

Variables

View Source
var InvalidSyncCode = "1061"

InvalidSyncCode is the code for an invalid declared RootSync/RepoSync.

Functions

func AmbiguousGithubAppIDInSecret

func AmbiguousGithubAppIDInSecret(secretName string) status.Error

AmbiguousGithubAppIDInSecret reports that the GithubApp app/client ID is ambiguous in a secret.

func DeletionPropagationAnnotation

func DeletionPropagationAnnotation(syncObj client.Object, syncKind string) status.Error

DeletionPropagationAnnotation returns an Error if the user-specified deletion propagation annotation is invalid.

func GitSpec

func GitSpec(git *v1beta1.Git, syncKind string) status.Error

GitSpec validates the git specification.

func HelmNSAndDeployNS

func HelmNSAndDeployNS(syncKind string) status.Error

HelmNSAndDeployNS reports that a RootSync has both spec.helm.namespace and spec.helm.deployNamespace set, even though they are mutually exclusive

func HelmSpec

func HelmSpec(helm *v1beta1.HelmBase, syncKind string) status.Error

HelmSpec validates the Helm specification.

func HelmValuesConfigMapMustBeImmutable

func HelmValuesConfigMapMustBeImmutable(syncKind, cmName, cmNamespace string) status.Error

HelmValuesConfigMapMustBeImmutable reports that a referenced ConfigMap from RSync spec.helm.valuesFileRefs is not immutable.

func HelmValuesFileDataKeyOrDefault

func HelmValuesFileDataKeyOrDefault(key string) string

HelmValuesFileDataKeyOrDefault returns the key or the default if the key is empty.

func HelmValuesMissingConfigMap

func HelmValuesMissingConfigMap(syncKind string, err error) status.Error

HelmValuesMissingConfigMap reports that an RSync is referencing a ConfigMap that doesn't exist.

func HelmValuesMissingConfigMapKey

func HelmValuesMissingConfigMapKey(syncKind, cmName, cmNamespace, dataKey string) status.Error

HelmValuesMissingConfigMapKey reports that an RSync is missing spec.helm.valuesFileRefs.valuesFile

func IllegalHelmChartName

func IllegalHelmChartName(syncKind string) status.Error

IllegalHelmChartName reports that a RootSync/RepoSync declares an invalid helm chart name.

func IllegalSecretRef

func IllegalSecretRef(sourceType configsync.SourceType, syncKind string) status.Error

IllegalSecretRef reports that a RootSync/RepoSync declares an auth mode that doesn't allow SecretRefs does declare a SecretRef.

func InvalidAuthType

func InvalidAuthType(auth configsync.AuthType) status.Error

InvalidAuthType reports that the auth type is invalid.

func InvalidGCPSAEmail

func InvalidGCPSAEmail(sourceType configsync.SourceType, syncKind string) status.Error

InvalidGCPSAEmail reports that a RepoSync/RootSync Resource doesn't have the

correct gcp service account suffix.

func InvalidGitAuthType

func InvalidGitAuthType(syncKind string) status.Error

InvalidGitAuthType reports that a RootSync/RepoSync doesn't use one of the known auth methods.

func InvalidHelmAuthType

func InvalidHelmAuthType(syncKind string) status.Error

InvalidHelmAuthType reports that a RootSync/RepoSync doesn't use one of the known auth methods for Helm.

func InvalidOciAuthType

func InvalidOciAuthType(syncKind string) status.Error

InvalidOciAuthType reports that a RootSync/RepoSync doesn't use one of the known auth methods for OCI image.

func InvalidReconcilerName

func InvalidReconcilerName(reconcilerName, reasons string) status.Error

InvalidReconcilerName reports that the reconciler name is invalid

func InvalidRepoSyncNamespace

func InvalidRepoSyncNamespace() status.Error

InvalidRepoSyncNamespace reports that a RepoSync has an invalid namespace

func InvalidRootSyncNamespace

func InvalidRootSyncNamespace(namespace string) status.Error

InvalidRootSyncNamespace reports that a RootSync has an invalid namespace

func InvalidSecretName

func InvalidSecretName(secretName, reasons string) status.Error

InvalidSecretName reports that a secret name is invalid.

func InvalidSourceType

func InvalidSourceType(syncKind string) status.Error

InvalidSourceType reports that a RootSync/RepoSync doesn't use one of the supported source types.

func MissingGCPSAEmail

func MissingGCPSAEmail(sourceType configsync.SourceType, syncKind string) status.Error

MissingGCPSAEmail reports that a RepoSync/RootSync resource declares an auth mode that requires a GCPServiceAccountEmail, but does not do so.

func MissingGitRepo

func MissingGitRepo(syncKind string) status.Error

MissingGitRepo reports that a RootSync/RepoSync doesn't declare the git repo it is supposed to connect to.

func MissingGitSpec

func MissingGitSpec(syncKind string) status.Error

MissingGitSpec reports that a RootSync/RepoSync doesn't declare the git spec when spec.sourceType is set to `git`.

func MissingGithubAppIDInSecret

func MissingGithubAppIDInSecret(secretName string) status.Error

MissingGithubAppIDInSecret reports that a GithubApp app/client ID is missing in a secret.

func MissingHelmChart

func MissingHelmChart(syncKind string) status.Error

MissingHelmChart reports that a RootSync/RepoSync doesn't declare the Helm chart name it is supposed to rendering.

func MissingHelmRepo

func MissingHelmRepo(syncKind string) status.Error

MissingHelmRepo reports that a RootSync/RepoSync doesn't declare the Helm repository it is supposed to download chart from.

func MissingHelmSpec

func MissingHelmSpec(syncKind string) status.Error

MissingHelmSpec reports that a RootSync/RepoSync doesn't declare the Helm spec when spec.sourceType is set to `helm`.

func MissingHelmValuesFileRefsName

func MissingHelmValuesFileRefsName(syncKind string) status.Error

MissingHelmValuesFileRefsName reports that an RSync is missing spec.helm.valuesFileRefs.name

func MissingKeyInAuthSecret

func MissingKeyInAuthSecret(authType configsync.AuthType, key, secretName string) status.Error

MissingKeyInAuthSecret reports that a key is missing in an auth secret.

func MissingKeyInCACertSecret

func MissingKeyInCACertSecret(caCertSecretKey, caCertSecretRefName string) status.Error

MissingKeyInCACertSecret reports that a key is missing in a CA cert secret.

func MissingOciImage

func MissingOciImage(syncKind string) status.Error

MissingOciImage reports that a RootSync/RepoSync doesn't declare the OCI image it is supposed to connect to.

func MissingOciSpec

func MissingOciSpec(syncKind string) status.Error

MissingOciSpec reports that a RootSync/RepoSync doesn't declare the OCI spec when spec.sourceType is set to `oci`.

func MissingSecret

func MissingSecret(namespaceSecretName string) status.Error

MissingSecret reports that a secret was not found.

func MissingSecretRef

func MissingSecretRef(sourceType configsync.SourceType, syncKind string) status.Error

MissingSecretRef reports that a RootSync/RepoSync declares an auth mode that requires a SecretRef, but does not do so.

func NewDeletionPropagationAnnotationError

func NewDeletionPropagationAnnotationError(syncKind string) status.Error

NewDeletionPropagationAnnotationError returns an error for an invalid deletion propagation annotation.

func NoOpProxy

func NoOpProxy(syncKind string) status.Error

NoOpProxy reports that a RootSync/RepoSync declares a proxy, but the declaration would do nothing.

func OciSpec

func OciSpec(oci *v1beta1.Oci, syncKind string) status.Error

OciSpec validates the OCI specification.

func OverrideResourceQuantityNegative

func OverrideResourceQuantityNegative(fieldName, syncKind string) status.Error

OverrideResourceQuantityNegative reports that a RootSync needs `spec.override.roleRefs.namespace` when `spec.override.roleRefs.kind` is "Role".

func OverrideRoleRefNamespace

func OverrideRoleRefNamespace(syncKind string) status.Error

OverrideRoleRefNamespace reports that a RootSync needs `spec.override.roleRefs.namespace` when `spec.override.roleRefs.kind` is "Role".

func OverrideSpec

func OverrideSpec(override *v1beta1.OverrideSpec, syncKind string) status.Error

OverrideSpec validates the common Override specification.

func ReconcilerName

func ReconcilerName(reconcilerName string) status.Error

ReconcilerName validates the reconciler name.

func RepoSyncHelmSpec

func RepoSyncHelmSpec(helm *v1beta1.HelmRepoSync) status.Error

RepoSyncHelmSpec validates the RepoSync Helm specification.

func RepoSyncMetadata

func RepoSyncMetadata(rs *v1beta1.RepoSync) status.Error

RepoSyncMetadata validates name, namespace, and annotations.

func RepoSyncNNLengthExceeded

func RepoSyncNNLengthExceeded(length int) status.Error

RepoSyncNNLengthExceeded reports that the RootSync name and namespace exceeds the max length

func RepoSyncName

func RepoSyncName(rs *v1beta1.RepoSync) status.Error

RepoSyncName validates RepoSync NN length.

func RepoSyncOverrideSpec

func RepoSyncOverrideSpec(override *v1beta1.RepoSyncOverrideSpec) status.Error

RepoSyncOverrideSpec validates the RepoSync Override specification.

func RepoSyncSpec

func RepoSyncSpec(spec v1beta1.RepoSyncSpec) status.Error

RepoSyncSpec validates the RepoSync source specification.

func RootSyncHelmSpec

func RootSyncHelmSpec(helm *v1beta1.HelmRootSync) status.Error

RootSyncHelmSpec validates the RootSync Helm specification.

func RootSyncMetadata

func RootSyncMetadata(rs *v1beta1.RootSync) status.Error

RootSyncMetadata validates name, namespace, and annotations.

func RootSyncName

func RootSyncName(rs *v1beta1.RootSync) status.Error

RootSyncName validates the RootSync name length.

func RootSyncNameLengthExceeded

func RootSyncNameLengthExceeded(length int) status.Error

RootSyncNameLengthExceeded reports that the RootSync name exceeds the max length

func RootSyncOverrideSpec

func RootSyncOverrideSpec(override *v1beta1.RootSyncOverrideSpec) status.Error

RootSyncOverrideSpec validates the RootSync Override specification.

func RootSyncSpec

func RootSyncSpec(spec v1beta1.RootSyncSpec) status.Error

RootSyncSpec validates the RootSync source specification.

func ValuesFileRefs

func ValuesFileRefs(ctx context.Context, cl client.Client, syncKind, syncNamespace string, valuesFileRefs []v1beta1.ValuesFileRef) status.Error

ValuesFileRefs checks that the ConfigMaps specified by valuesFileRefs exist, are immutable, and have the provided data key.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL