cue.dev/x/crd/fluxcd.io@v0.9.0

image/v1/ImageUpdateAutomation.cue raw

  1package v1
  2
  3import (
  4	"time"
  5	"strings"
  6)
  7
  8// ImageUpdateAutomation is the Schema for the imageupdateautomations API
  9#ImageUpdateAutomation: {
 10	_embeddedResource
 11
 12	// APIVersion defines the versioned schema of this representation of an object.
 13	// Servers should convert recognized schemas to the latest internal value, and
 14	// may reject unrecognized values.
 15	// More info:
 16	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
 17	apiVersion?: string
 18
 19	// Kind is a string value representing the REST resource this object represents.
 20	// Servers may infer this from the endpoint the client submits requests to.
 21	// Cannot be updated.
 22	// In CamelCase.
 23	// More info:
 24	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
 25	kind?:     string
 26	metadata?: {}
 27
 28	// ImageUpdateAutomationSpec defines the desired state of ImageUpdateAutomation
 29	spec?: {
 30		// GitSpec contains all the git-specific definitions. This is
 31		// technically optional, but in practice mandatory until there are
 32		// other kinds of source allowed.
 33		git?: {
 34			// Checkout gives the parameters for cloning the git repository,
 35			// ready to make changes. If not present, the `spec.ref` field from the
 36			// referenced `GitRepository` or its default will be used.
 37			checkout?: {
 38				// Reference gives a branch, tag or commit to clone from the Git
 39				// repository.
 40				ref!: {
 41					// Branch to check out, defaults to 'master' if no other field is defined.
 42					branch?: string
 43
 44					// Commit SHA to check out, takes precedence over all reference fields.
 45					//
 46					// This can be combined with Branch to shallow clone the branch, in which
 47					// the commit is expected to exist.
 48					commit?: string
 49
 50					// Name of the reference to check out; takes precedence over Branch, Tag and SemVer.
 51					//
 52					// It must be a valid Git reference: https://git-scm.com/docs/git-check-ref-format#_description
 53					// Examples: "refs/heads/main", "refs/tags/v0.1.0", "refs/pull/420/head",
 54					// "refs/merge-requests/1/head"
 55					name?: string
 56
 57					// SemVer tag expression to check out, takes precedence over Tag.
 58					semver?: string
 59
 60					// Tag to check out, takes precedence over Branch.
 61					tag?: string
 62				}
 63			}
 64
 65			// Commit specifies how to commit to the git repository.
 66			commit!: {
 67				// Author gives the email and optionally the name to use as the
 68				// author of commits.
 69				author!: {
 70					// Email gives the email to provide when making a commit.
 71					email!: string
 72
 73					// Name gives the name to provide when making a commit.
 74					name?: string
 75				}
 76
 77				// MessageTemplate provides a template for the commit message,
 78				// into which will be interpolated the details of the change made.
 79				// Note: The `Updated` template field has been removed. Use `Changed` instead.
 80				messageTemplate?: string
 81
 82				// MessageTemplateValues provides additional values to be available to the
 83				// templating rendering.
 84				messageTemplateValues?: [string]: string
 85
 86				// SigningKey provides the option to sign commits with an OpenPGP or
 87				// SSH signing key, referenced from a Secret. See SigningKey.
 88				signingKey?: {
 89					// SecretRef references a Secret containing the signing key. For type
 90					// 'gpg', the Secret must contain a 'git.asc' (ASCII-armored OpenPGP
 91					// keypair) and may contain a 'passphrase'. For type 'ssh', the Secret
 92					// must contain an 'identity' (an SSH private key in any format
 93					// golang.org/x/crypto/ssh.ParsePrivateKey accepts; typically the
 94					// OpenSSH format produced by 'ssh-keygen') and may contain a 'password'
 95					// (the key's passphrase). The SSH conventions match the GitRepository
 96					// SSH transport-auth Secret format, allowing a single Secret to serve
 97					// both transport and signing when the ImageUpdateAutomation lives in
 98					// the same namespace as the GitRepository.
 99					//
100					// The Secret itself must live in the same namespace as the
101					// ImageUpdateAutomation.
102					//
103					// Supported SSH key algorithms: ed25519, ecdsa-sha2-nistp256/384/521,
104					// and rsa (>= 2048-bit).
105					secretRef!: {
106						// Name of the referent.
107						name!: string
108					}
109
110					// Type selects the signing-key format expected in the referenced
111					// Secret. When empty, the controller defaults to 'gpg'.
112					type?: "gpg" | "ssh"
113				}
114			}
115
116			// Push specifies how and where to push commits made by the
117			// automation. If missing, commits are pushed (back) to
118			// `.spec.checkout.branch` or its default.
119			push?: {
120				// Branch specifies that commits should be pushed to the branch
121				// named. The branch is created using `.spec.checkout.branch` as the
122				// starting point, if it doesn't already exist.
123				branch?: string
124
125				// Options specifies the push options that are sent to the Git
126				// server when performing a push operation. For details, see:
127				// https://git-scm.com/docs/git-push#Documentation/git-push.txt---push-optionltoptiongt
128				options?: [string]: string
129
130				// Refspec specifies the Git Refspec to use for a push operation.
131				// If both Branch and Refspec are provided, then the commit is pushed
132				// to the branch and also using the specified refspec.
133				// For more details about Git Refspecs, see:
134				// https://git-scm.com/book/en/v2/Git-Internals-The-Refspec
135				refspec?: string
136			}
137		}
138
139		// Interval gives an lower bound for how often the automation
140		// run should be attempted.
141		interval!: =~"^([0-9]+(\\.[0-9]+)?(ms|s|m|h))+$"
142
143		// PolicySelector allows to filter applied policies based on labels.
144		// By default includes all policies in namespace.
145		policySelector?: {
146			// matchExpressions is a list of label selector requirements. The requirements are ANDed.
147			matchExpressions?: [...{
148				// key is the label key that the selector applies to.
149				key!: string
150
151				// operator represents a key's relationship to a set of values.
152				// Valid operators are In, NotIn, Exists and DoesNotExist.
153				operator!: string
154
155				// values is an array of string values. If the operator is In or NotIn,
156				// the values array must be non-empty. If the operator is Exists or DoesNotExist,
157				// the values array must be empty. This array is replaced during a strategic
158				// merge patch.
159				values?: [...string]
160			}]
161
162			// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
163			// map is equivalent to an element of matchExpressions, whose key field is "key", the
164			// operator is "In", and the values array contains only "value". The requirements are ANDed.
165			matchLabels?: [string]: string
166		}
167
168		// SourceRef refers to the resource giving access details
169		// to a git repository.
170		sourceRef!: {
171			// API version of the referent.
172			apiVersion?: string
173
174			// Kind of the referent.
175			kind!: "GitRepository"
176
177			// Name of the referent.
178			name!: string
179
180			// Namespace of the referent, defaults to the namespace of the Kubernetes
181			// resource object that contains the reference.
182			namespace?: string
183		}
184
185		// Suspend tells the controller to not run this automation, until
186		// it is unset (or set to false). Defaults to false.
187		suspend?: bool
188
189		// Update gives the specification for how to update the files in
190		// the repository. This can be left empty, to use the default
191		// value.
192		update?: {
193			// Path to the directory containing the manifests to be updated.
194			// Defaults to 'None', which translates to the root path
195			// of the GitRepositoryRef.
196			path?: string
197
198			// Strategy names the strategy to be used.
199			strategy?: "Setters"
200		}
201	}
202
203	// ImageUpdateAutomationStatus defines the observed state of ImageUpdateAutomation
204	status?: {
205		conditions?: [...{
206			// lastTransitionTime is the last time the condition transitioned from one status to another.
207			// This should be when the underlying condition changed. If that is not known,
208			// then using the time when the API field changed is acceptable.
209			lastTransitionTime!: time.Time
210
211			// message is a human readable message indicating details about the transition.
212			// This may be an empty string.
213			message!: strings.MaxRunes(
214				32768,
215			)
216
217			// observedGeneration represents the .metadata.generation that the condition was set based upon.
218			// For instance, if .metadata.generation is currently 12, but the
219			// .status.conditions[x].observedGeneration is 9, the condition is out of date
220			// with respect to the current state of the instance.
221			observedGeneration?: int64 & int & >=0
222
223			// reason contains a programmatic identifier indicating the reason for the
224			// condition's last transition.
225			// Producers of specific condition types may define expected values and meanings for this field,
226			// and whether the values are considered a guaranteed API.
227			// The value should be a CamelCase string.
228			// This field may not be empty.
229			reason!: strings.MaxRunes(
230				1024,
231			) &
232			strings.MinRunes(
233				1,
234			) &
235			=~"^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$"
236
237			// status of the condition, one of True, False, Unknown.
238			status!: "True" | "False" | "Unknown"
239
240			// type of condition in CamelCase or in foo.example.com/CamelCase.
241			type!: strings.MaxRunes(
242				316,
243			) &
244			=~"^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$"
245		}]
246
247		// LastAutomationRunTime records the last time the controller ran
248		// this automation through to completion (even if no updates were
249		// made).
250		lastAutomationRunTime?: time.Time
251
252		// LastHandledReconcileAt holds the value of the most recent
253		// reconcile request value, so a change of the annotation value
254		// can be detected.
255		lastHandledReconcileAt?: string
256
257		// LastPushCommit records the SHA1 of the last commit made by the
258		// controller, for this automation object
259		lastPushCommit?: string
260
261		// LastPushTime records the time of the last pushed change.
262		lastPushTime?:       time.Time
263		observedGeneration?: int64 & int
264
265		// ObservedPolicies is the list of observed ImagePolicies that were
266		// considered by the ImageUpdateAutomation update process.
267		observedPolicies?: [string]: {
268			// Digest is the image's digest.
269			digest?: string
270
271			// Name is the bare image's name.
272			name!: string
273
274			// Tag is the image's tag.
275			tag!: string
276		}
277
278		// ObservedSourceRevision is the last observed source revision. This can be
279		// used to determine if the source has been updated since last observation.
280		observedSourceRevision?: string
281	}
282
283	_embeddedResource: {
284		apiVersion!: string
285		kind!:       string
286		metadata?:   {...}
287	}
288	apiVersion: "image.toolkit.fluxcd.io/v1"
289	kind:       "ImageUpdateAutomation"
290	metadata!: {
291		name!:      string
292		namespace!: string
293		labels?: [string]:      string
294		annotations?: [string]: string
295		...
296	}
297}