Skip to content

Commit

Permalink
Update CUE schemas to Flux v2.3 APIs
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Prodan <[email protected]>
  • Loading branch information
stefanprodan committed May 12, 2024
1 parent 8ce688e commit f3be53a
Show file tree
Hide file tree
Showing 4 changed files with 309 additions and 180 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Code generated by timoni. DO NOT EDIT.

//timoni:generate timoni vendor crd -f https://github.com/fluxcd/flux2/releases/download/v2.1.1/install.yaml
//timoni:generate timoni vendor crd -f https://github.com/fluxcd/kustomize-controller/releases/download/v1.3.0/kustomize-controller.crds.yaml

package v1

Expand All @@ -9,16 +9,21 @@ import "strings"
// Kustomization is the Schema for the kustomizations API.
#Kustomization: {
// APIVersion defines the versioned schema of this representation
// of an object. Servers should convert recognized schemas to the
// latest internal value, and may reject unrecognized values.
// of an object.
// Servers should convert recognized schemas to the latest
// internal value, and
// may reject unrecognized values.
// More info:
// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
apiVersion: "kustomize.toolkit.fluxcd.io/v1"

// Kind is a string value representing the REST resource this
// object represents. Servers may infer this from the endpoint
// the client submits requests to. Cannot be updated. In
// CamelCase. More info:
// object represents.
// Servers may infer this from the endpoint the client submits
// requests to.
// Cannot be updated.
// In CamelCase.
// More info:
// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
kind: "Kustomization"
metadata!: {
Expand All @@ -37,16 +42,20 @@ import "strings"
}

// KustomizationSpec defines the configuration to calculate the
// desired state from a Source using Kustomize.
// desired state
// from a Source using Kustomize.
spec!: #KustomizationSpec
}

// KustomizationSpec defines the configuration to calculate the
// desired state from a Source using Kustomize.
// desired state
// from a Source using Kustomize.
#KustomizationSpec: {
// CommonMetadata specifies the common labels and annotations that
// are applied to all resources. Any existing label or annotation
// will be overridden if its key matches a common one.
// are
// applied to all resources. Any existing label or annotation will
// be
// overridden if its key matches a common one.
commonMetadata?: {
// Annotations to be added to the object's metadata.
annotations?: {
Expand Down Expand Up @@ -75,7 +84,8 @@ import "strings"

// DependsOn may contain a meta.NamespacedObjectReference slice
// with references to Kustomization resources that must be ready
// before this Kustomization can be reconciled.
// before this
// Kustomization can be reconciled.
dependsOn?: [...{
// Name of the referent.
name: string
Expand All @@ -85,8 +95,8 @@ import "strings"
namespace?: string
}]

// Force instructs the controller to recreate resources when
// patching fails due to an immutable field change.
// Force instructs the controller to recreate resources
// when patching fails due to an immutable field change.
force?: bool | *false

// A list of resources to be included in the health assessment.
Expand All @@ -108,11 +118,11 @@ import "strings"

// Images is a list of (image name, new name, new tag or digest)
// for changing image names, tags or digests. This can also be
// achieved with a patch, but this operator is simpler to
// specify.
// achieved with a
// patch, but this operator is simpler to specify.
images?: [...{
// Digest is the value used to replace the original image tag. If
// digest is present NewTag value is ignored.
// Digest is the value used to replace the original image tag.
// If digest is present NewTag value is ignored.
digest?: string

// Name is a tag-less image name.
Expand All @@ -125,19 +135,25 @@ import "strings"
newTag?: string
}]

// The interval at which to reconcile the Kustomization. This
// interval is approximate and may be subject to jitter to ensure
// The interval at which to reconcile the Kustomization.
// This interval is approximate and may be subject to jitter to
// ensure
// efficient use of resources.
interval: =~"^([0-9]+(\\.[0-9]+)?(ms|s|m|h))+$"
kubeConfig?: {
// SecretRef holds the name of a secret that contains a key with
// the kubeconfig file as the value. If no key is set, the key
// will default to 'value'. It is recommended that the kubeconfig
// is self-contained, and the secret is regularly updated if
// credentials such as a cloud-access-token expire. Cloud
// specific `cmd-path` auth helpers will not function without
// adding binaries and credentials to the Pod that is responsible
// for reconciling Kubernetes resources.
// will default
// to 'value'.
// It is recommended that the kubeconfig is self-contained, and
// the secret
// is regularly updated if credentials such as a
// cloud-access-token expire.
// Cloud specific `cmd-path` auth helpers will not function
// without adding
// binaries and credentials to the Pod that is responsible for
// reconciling
// Kubernetes resources.
secretRef: {
// Key in the Secret, when not specified an
// implementation-specific default key is used.
Expand All @@ -148,12 +164,20 @@ import "strings"
}
}

// NamePrefix will prefix the names of all managed resources.
namePrefix?: strings.MaxRunes(200) & strings.MinRunes(1)

// NameSuffix will suffix the names of all managed resources.
nameSuffix?: strings.MaxRunes(200) & strings.MinRunes(1)

// Strategic merge and JSON patches, defined as inline YAML
// objects, capable of targeting objects based on kind, label and
// objects,
// capable of targeting objects based on kind, label and
// annotation selectors.
patches?: [...{
// Patch contains an inline StrategicMerge patch or an inline
// JSON6902 patch with an array of operation objects.
// JSON6902 patch with
// an array of operation objects.
patch: string

// Target points to the resources that the patch document should
Expand All @@ -165,15 +189,15 @@ import "strings"
// It matches with the resource annotations.
annotationSelector?: string

// Group is the API group to select resources from. Together with
// Version and Kind it is capable of unambiguously identifying
// and/or selecting resources.
// Group is the API group to select resources from.
// Together with Version and Kind it is capable of unambiguously
// identifying and/or selecting resources.
// https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md
group?: string

// Kind of the API Group to select resources from. Together with
// Group and Version it is capable of unambiguously identifying
// and/or selecting resources.
// Kind of the API Group to select resources from.
// Together with Group and Version it is capable of unambiguously
// identifying and/or selecting resources.
// https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md
kind?: string

Expand All @@ -189,51 +213,62 @@ import "strings"
// Namespace to select resources from.
namespace?: string

// Version of the API Group to select resources from. Together
// with Group and Kind it is capable of unambiguously identifying
// and/or selecting resources.
// Version of the API Group to select resources from.
// Together with Group and Kind it is capable of unambiguously
// identifying and/or selecting resources.
// https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md
version?: string
}
}]

// Path to the directory containing the kustomization.yaml file,
// or the set of plain YAMLs a kustomization.yaml should be
// generated for. Defaults to 'None', which translates to the
// root path of the SourceRef.
// or the
// set of plain YAMLs a kustomization.yaml should be generated
// for.
// Defaults to 'None', which translates to the root path of the
// SourceRef.
path?: string

// PostBuild describes which actions to perform on the YAML
// manifest generated by building the kustomize overlay.
// manifest
// generated by building the kustomize overlay.
postBuild?: {
// Substitute holds a map of key/value pairs. The variables
// defined in your YAML manifests that match any of the keys
// Substitute holds a map of key/value pairs.
// The variables defined in your YAML manifests that match any of
// the keys
// defined in the map will be substituted with the set value.
// Includes support for bash string replacement functions e.g.
// ${var:=default}, ${var:position} and
// Includes support for bash string replacement functions
// e.g. ${var:=default}, ${var:position} and
// ${var/substring/replacement}.
substitute?: {
[string]: string
}

// SubstituteFrom holds references to ConfigMaps and Secrets
// containing the variables and their values to be substituted in
// the YAML manifests. The ConfigMap and the Secret data keys
// represent the var names, and they must match the vars declared
// in the manifests for the substitution to happen.
// containing
// the variables and their values to be substituted in the YAML
// manifests.
// The ConfigMap and the Secret data keys represent the var names,
// and they
// must match the vars declared in the manifests for the
// substitution to
// happen.
substituteFrom?: [...{
// Kind of the values referent, valid values are ('Secret',
// 'ConfigMap').
kind: "Secret" | "ConfigMap"

// Name of the values referent. Should reside in the same
// namespace as the referring resource.
// namespace as the
// referring resource.
name: strings.MaxRunes(253) & strings.MinRunes(1)

// Optional indicates whether the referenced resource must exist,
// or whether to tolerate its absence. If true and the referenced
// resource is absent, proceed as if the resource was present but
// empty, without any variables defined.
// or whether to
// tolerate its absence. If true and the referenced resource is
// absent, proceed
// as if the resource was present but empty, without any variables
// defined.
optional?: bool | *false
}]
}
Expand All @@ -242,12 +277,14 @@ import "strings"
prune: bool

// The interval at which to retry a previously failed
// reconciliation. When not specified, the controller uses the
// KustomizationSpec.Interval value to retry failures.
// reconciliation.
// When not specified, the controller uses the
// KustomizationSpec.Interval
// value to retry failures.
retryInterval?: =~"^([0-9]+(\\.[0-9]+)?(ms|s|m|h))+$"

// The name of the Kubernetes service account to impersonate when
// reconciling this Kustomization.
// The name of the Kubernetes service account to impersonate
// when reconciling this Kustomization.
serviceAccountName?: string

// Reference of the source where the kustomization file is.
Expand All @@ -262,13 +299,15 @@ import "strings"
name: string

// Namespace of the referent, defaults to the namespace of the
// Kubernetes resource object that contains the reference.
// Kubernetes
// resource object that contains the reference.
namespace?: string
}

// This flag tells the controller to suspend subsequent kustomize
// executions, it does not apply to already started executions.
// Defaults to false.
// executions,
// it does not apply to already started executions. Defaults to
// false.
suspend?: bool

// TargetNamespace sets or overrides the namespace in the
Expand All @@ -280,7 +319,8 @@ import "strings"
timeout?: =~"^([0-9]+(\\.[0-9]+)?(ms|s|m|h))+$"

// Wait instructs the controller to check the health of all the
// reconciled resources. When enabled, the HealthChecks are
// ignored. Defaults to false.
// reconciled
// resources. When enabled, the HealthChecks are ignored. Defaults
// to false.
wait?: bool
}
Loading

0 comments on commit f3be53a

Please sign in to comment.