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

image/v1/ImageRepository.cue raw

  1package v1
  2
  3import (
  4	"list"
  5	"strings"
  6	"time"
  7)
  8
  9// ImageRepository is the Schema for the imagerepositories API
 10#ImageRepository: {
 11	_embeddedResource
 12
 13	// APIVersion defines the versioned schema of this representation of an object.
 14	// Servers should convert recognized schemas to the latest internal value, and
 15	// may reject unrecognized values.
 16	// More info:
 17	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
 18	apiVersion?: string
 19
 20	// Kind is a string value representing the REST resource this object represents.
 21	// Servers may infer this from the endpoint the client submits requests to.
 22	// Cannot be updated.
 23	// In CamelCase.
 24	// More info:
 25	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
 26	kind?:     string
 27	metadata?: {}
 28
 29	// ImageRepositorySpec defines the parameters for scanning an image
 30	// repository, e.g., `fluxcd/flux`.
 31	spec?: {
 32		// AccessFrom defines an ACL for allowing cross-namespace references
 33		// to the ImageRepository object based on the caller's namespace labels.
 34		accessFrom?: {
 35			// NamespaceSelectors is the list of namespace selectors to which this ACL applies.
 36			// Items in this list are evaluated using a logical OR operation.
 37			namespaceSelectors!: [...{
 38				// MatchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
 39				// map is equivalent to an element of matchExpressions, whose key field is "key", the
 40				// operator is "In", and the values array contains only "value". The requirements are ANDed.
 41				matchLabels?: [string]: string
 42			}]
 43		}
 44
 45		// CertSecretRef can be given the name of a Secret containing
 46		// either or both of
 47		//
 48		// - a PEM-encoded client certificate (`tls.crt`) and private
 49		// key (`tls.key`);
 50		// - a PEM-encoded CA certificate (`ca.crt`)
 51		//
 52		// and whichever are supplied, will be used for connecting to the
 53		// registry. The client cert and key are useful if you are
 54		// authenticating with a certificate; the CA cert is useful if
 55		// you are using a self-signed server certificate. The Secret must
 56		// be of type `Opaque` or `kubernetes.io/tls`.
 57		//
 58		// Note: Support for the `caFile`, `certFile` and `keyFile` keys has
 59		// been deprecated.
 60		certSecretRef?: {
 61			// Name of the referent.
 62			name!: string
 63		}
 64
 65		// ExclusionList is a list of regex strings used to exclude certain tags
 66		// from being stored in the database.
 67		exclusionList?: list.MaxItems(25) & [...string]
 68
 69		// Image is the name of the image repository
 70		image!: string
 71
 72		// Insecure allows connecting to a non-TLS HTTP container registry.
 73		insecure?: bool
 74
 75		// Interval is the length of time to wait between
 76		// scans of the image repository.
 77		interval!: =~"^([0-9]+(\\.[0-9]+)?(ms|s|m|h))+$"
 78
 79		// The provider used for authentication, can be 'aws', 'azure', 'gcp' or 'generic'.
 80		// When not specified, defaults to 'generic'.
 81		provider?: "generic" | "aws" | "azure" | "gcp"
 82
 83		// ProxySecretRef specifies the Secret containing the proxy configuration
 84		// to use while communicating with the container registry.
 85		proxySecretRef?: {
 86			// Name of the referent.
 87			name!: string
 88		}
 89
 90		// SecretRef can be given the name of a secret containing
 91		// credentials to use for the image registry. The secret should be
 92		// created with `kubectl create secret docker-registry`, or the
 93		// equivalent.
 94		secretRef?: {
 95			// Name of the referent.
 96			name!: string
 97		}
 98
 99		// ServiceAccountName is the name of the Kubernetes ServiceAccount used to authenticate
100		// the image pull if the service account has attached pull secrets.
101		serviceAccountName?: strings.MaxRunes(
102			253,
103		)
104
105		// This flag tells the controller to suspend subsequent image scans.
106		// It does not apply to already started scans. Defaults to false.
107		suspend?: bool
108
109		// Timeout for image scanning.
110		// Defaults to 'Interval' duration.
111		timeout?: =~"^([0-9]+(\\.[0-9]+)?(ms|s|m))+$"
112	}
113
114	// ImageRepositoryStatus defines the observed state of ImageRepository
115	status?: {
116		// CanonicalName is the name of the image repository with all the
117		// implied bits made explicit; e.g., `docker.io/library/alpine`
118		// rather than `alpine`.
119		canonicalImageName?: string
120		conditions?: [...{
121			// lastTransitionTime is the last time the condition transitioned from one status to another.
122			// This should be when the underlying condition changed. If that is not known,
123			// then using the time when the API field changed is acceptable.
124			lastTransitionTime!: time.Time
125
126			// message is a human readable message indicating details about the transition.
127			// This may be an empty string.
128			message!: strings.MaxRunes(
129				32768,
130			)
131
132			// observedGeneration represents the .metadata.generation that the condition was set based upon.
133			// For instance, if .metadata.generation is currently 12, but the
134			// .status.conditions[x].observedGeneration is 9, the condition is out of date
135			// with respect to the current state of the instance.
136			observedGeneration?: int64 & int & >=0
137
138			// reason contains a programmatic identifier indicating the reason for the
139			// condition's last transition.
140			// Producers of specific condition types may define expected values and meanings for this field,
141			// and whether the values are considered a guaranteed API.
142			// The value should be a CamelCase string.
143			// This field may not be empty.
144			reason!: strings.MaxRunes(
145				1024,
146			) &
147			strings.MinRunes(
148				1,
149			) &
150			=~"^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$"
151
152			// status of the condition, one of True, False, Unknown.
153			status!: "True" | "False" | "Unknown"
154
155			// type of condition in CamelCase or in foo.example.com/CamelCase.
156			type!: strings.MaxRunes(
157				316,
158			) &
159			=~"^([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])$"
160		}]
161
162		// LastHandledReconcileAt holds the value of the most recent
163		// reconcile request value, so a change of the annotation value
164		// can be detected.
165		lastHandledReconcileAt?: string
166
167		// LastScanResult contains the number of fetched tags.
168		lastScanResult?: {
169			// LatestTags is a small sample of the tags found in the last scan.
170			// It's the first 10 tags when sorting all the tags in descending
171			// alphabetical order.
172			latestTags?: [...string]
173
174			// Revision is a stable hash of the scanned tags.
175			revision?: string
176
177			// ScanTime is the time when the last scan was performed.
178			scanTime?: time.Time
179
180			// TagCount is the number of tags found in the last scan.
181			tagCount!: int
182		}
183
184		// ObservedExclusionList is a list of observed exclusion list. It reflects
185		// the exclusion rules used for the observed scan result in
186		// status.lastScanResult.
187		observedExclusionList?: [...string]
188
189		// ObservedGeneration is the last reconciled generation.
190		observedGeneration?: int64 & int
191	}
192
193	_embeddedResource: {
194		apiVersion!: string
195		kind!:       string
196		metadata?:   {...}
197	}
198	apiVersion: "image.toolkit.fluxcd.io/v1"
199	kind:       "ImageRepository"
200	metadata!: {
201		name!:      string
202		namespace!: string
203		labels?: [string]:      string
204		annotations?: [string]: string
205		...
206	}
207}