{ "description": "ImageUpdater is the Schema for the imageupdaters API", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "type": "object" }, "spec": { "description": "ImageUpdaterSpec defines the desired state of ImageUpdater\nIt specifies which applications to target, default update strategies,\nand a list of images to manage.", "properties": { "applicationRefs": { "description": "ApplicationRefs indicates the set of applications to be managed.\nApplicationRefs is a list of rules to select Argo CD Applications within the ImageUpdater CR's namespace.\nEach reference can also provide specific overrides for the global settings defined above.", "items": { "description": "ApplicationRef contains various criteria by which to include applications for managing by image updater", "properties": { "commonUpdateSettings": { "description": "CommonUpdateSettings overrides the global CommonUpdateSettings for applications\nmatched by this selector.\nThis field is ignored when UseAnnotations is true.", "properties": { "allowTags": { "description": "AllowTags is a regex pattern for tags to allow.\nThis acts as the default if not overridden.", "type": "string" }, "forceUpdate": { "default": false, "description": "ForceUpdate specifies whether updates should be forced.\nThis acts as the default if not overridden.", "type": "boolean" }, "ignoreTags": { "description": "IgnoreTags is a list of glob-like patterns of tags to ignore.\nThis acts as the default and can be overridden at more specific levels.", "items": { "type": "string" }, "type": "array", "x-kubernetes-list-type": "atomic" }, "platforms": { "description": "Platforms specifies a list of target platforms (e.g., \"linux/amd64\", \"linux/arm64\").\nIf specified, the image updater will consider these platforms when checking for new versions or digests.", "items": { "type": "string" }, "type": "array", "x-kubernetes-list-type": "atomic" }, "pullSecret": { "description": "PullSecret is the pull secret to use for images.\nThis acts as the default if not overridden.", "type": "string" }, "updateStrategy": { "default": "semver", "description": "UpdateStrategy defines the update strategy to apply.\nExamples: \"semver\", \"latest\", \"digest\", \"name\".\nThis acts as the default if not overridden at a more specific level.", "type": "string" } }, "type": "object", "additionalProperties": false }, "images": { "description": "Images contains a list of configurations that how images should be updated.\nThese rules apply to applications selected by namePattern in ApplicationRefs, and each\nimage can override global/ApplicationRef settings.\nThis field is ignored when UseAnnotations is true.", "items": { "description": "ImageConfig defines how a specific container image should be discovered, updated,\nand how those updates should be reflected in application manifests.", "properties": { "alias": { "description": "Alias is a short, user-defined name for this image configuration.\nIt MUST be unique within a single ApplicationRef's list of images.\nThis field is mandatory.", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-._]*$", "type": "string" }, "commonUpdateSettings": { "description": "CommonUpdateSettings overrides the effective default CommonUpdateSettings for this specific image.", "properties": { "allowTags": { "description": "AllowTags is a regex pattern for tags to allow.\nThis acts as the default if not overridden.", "type": "string" }, "forceUpdate": { "default": false, "description": "ForceUpdate specifies whether updates should be forced.\nThis acts as the default if not overridden.", "type": "boolean" }, "ignoreTags": { "description": "IgnoreTags is a list of glob-like patterns of tags to ignore.\nThis acts as the default and can be overridden at more specific levels.", "items": { "type": "string" }, "type": "array", "x-kubernetes-list-type": "atomic" }, "platforms": { "description": "Platforms specifies a list of target platforms (e.g., \"linux/amd64\", \"linux/arm64\").\nIf specified, the image updater will consider these platforms when checking for new versions or digests.", "items": { "type": "string" }, "type": "array", "x-kubernetes-list-type": "atomic" }, "pullSecret": { "description": "PullSecret is the pull secret to use for images.\nThis acts as the default if not overridden.", "type": "string" }, "updateStrategy": { "default": "semver", "description": "UpdateStrategy defines the update strategy to apply.\nExamples: \"semver\", \"latest\", \"digest\", \"name\".\nThis acts as the default if not overridden at a more specific level.", "type": "string" } }, "type": "object", "additionalProperties": false }, "imageName": { "description": "ImageName is the full identifier of the image to be tracked,\nincluding the registry (if not Docker Hub), the image name, and an initial/current tag or version.\nThis is the string used to query the container registry and also as a base for finding updates.\nExample: \"docker.io/library/nginx:1.17.10\", \"quay.io/prometheus/node-exporter:v1.5.0\".\nThis field is mandatory.", "type": "string" }, "manifestTargets": { "description": "ManifestTarget defines how and where to update this image in Kubernetes manifests.\nOnly one of Helm or Kustomize should be specified within this block.\nThis whole block is optional if the image update isn't written to a manifest in a structured way.", "properties": { "helm": { "description": "Helm specifies update parameters if the target manifest is managed by Helm\nand updates are to be made to Helm values files.", "properties": { "name": { "description": "Name is the dot-separated path to the Helm key for the image repository/name part.\nExample: \"image.repository\", \"frontend.deployment.image.name\".\nIf neither spec nor name/tag are set, defaults to \"image.name\".\nIf spec is set, this field is ignored.", "type": "string" }, "spec": { "description": "Spec is the dot-separated path to a Helm key where the full image string\n(e.g., \"image/name:1.0\") should be written.\nUse this if your Helm chart expects the entire image reference in a single field,\nrather than separate name/tag fields. If this is set, name and tag will be ignored.", "type": "string" }, "tag": { "description": "Tag is the dot-separated path to the Helm key for the image tag part.\nExample: \"image.tag\", \"frontend.deployment.image.version\".\nIf neither spec nor name/tag are set, defaults to \"image.tag\".\nIf spec is set, this field is ignored.", "type": "string" } }, "type": "object", "additionalProperties": false }, "kustomize": { "description": "Kustomize specifies update parameters if the target manifest is managed by Kustomize\nand updates involve changing image tags in Kustomize configurations.", "properties": { "name": { "description": "Name is the image name (which can include the registry and an initial tag)\nas it appears in the `images` list of a kustomization.yaml file that needs to be updated.\nThe updater will typically change the tag or add a digest to this entry.\nExample: \"docker.io/library/nginx\".\nThis field is required if the Kustomize target is used.", "type": "string" } }, "required": [ "name" ], "type": "object", "additionalProperties": false } }, "type": "object", "x-kubernetes-validations": [ { "message": "Exactly one of helm or kustomize must be specified within manifestTargets if the block is present.", "rule": "has(self.helm) ? !has(self.kustomize) : has(self.kustomize)" } ], "additionalProperties": false } }, "required": [ "alias", "imageName" ], "type": "object", "additionalProperties": false }, "type": "array", "x-kubernetes-list-map-keys": [ "alias" ], "x-kubernetes-list-type": "map" }, "labelSelectors": { "description": "LabelSelectors indicates the label selectors to apply for application selection", "properties": { "matchExpressions": { "description": "matchExpressions is a list of label selector requirements. The requirements are ANDed.", "items": { "description": "A label selector requirement is a selector that contains values, a key, and an operator that\nrelates the key and values.", "properties": { "key": { "description": "key is the label key that the selector applies to.", "type": "string" }, "operator": { "description": "operator represents a key's relationship to a set of values.\nValid operators are In, NotIn, Exists and DoesNotExist.", "type": "string" }, "values": { "description": "values is an array of string values. If the operator is In or NotIn,\nthe values array must be non-empty. If the operator is Exists or DoesNotExist,\nthe values array must be empty. This array is replaced during a strategic\nmerge patch.", "items": { "type": "string" }, "type": "array", "x-kubernetes-list-type": "atomic" } }, "required": [ "key", "operator" ], "type": "object", "additionalProperties": false }, "type": "array", "x-kubernetes-list-type": "atomic" }, "matchLabels": { "additionalProperties": { "type": "string" }, "description": "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels\nmap is equivalent to an element of matchExpressions, whose key field is \"key\", the\noperator is \"In\", and the values array contains only \"value\". The requirements are ANDed.", "type": "object" } }, "type": "object", "x-kubernetes-map-type": "atomic", "additionalProperties": false }, "namePattern": { "description": "NamePattern indicates the glob pattern for application name", "type": "string" }, "useAnnotations": { "default": false, "description": "UseAnnotations When true, read image configuration from Application's\nargocd-image-updater.argoproj.io/* annotations instead of\nrequiring explicit Images[] configuration in this CR.\nWhen this field is set to true, only namePattern and labelSelectors are used for\napplication selection. All other fields (CommonUpdateSettings, WriteBackConfig, Images)\nare ignored.", "type": "boolean" }, "writeBackConfig": { "description": "WriteBackConfig overrides the global WriteBackConfig settings for applications\nmatched by this selector.\nThis field is ignored when UseAnnotations is true.", "properties": { "gitConfig": { "description": "GitConfig provides Git configuration settings if the write-back method involves Git.\nThis can only be used when method is \"git\" or starts with \"git:\".", "properties": { "branch": { "description": "Branch to commit updates to.\nRequired if write-back method is Git and this is not specified at the spec level.", "type": "string" }, "pullRequest": { "description": "PullRequest configures creation of pull requests when writing back image updates to Git.\nWhen set, the controller opens a PR instead of pushing to the branch.\nIf not specified write back config method is `git`.", "properties": { "github": { "description": "GitHub configures PR creation via the GitHub API.", "type": "object" }, "gitlab": { "description": "GitLab configures MR creation via the GitLab API.", "type": "object" } }, "type": "object", "x-kubernetes-validations": [ { "message": "Exactly one of github or gitlab must be set", "rule": "(has(self.github) ? 1 : 0) + (has(self.gitlab) ? 1 : 0) == 1" } ], "additionalProperties": false }, "repository": { "description": "Repository URL to commit changes to.\nIf not specified here or at the spec level, the controller MUST infer it from the\nArgo CD Application's `spec.source.repoURL`. This field allows overriding that.", "type": "string" }, "writeBackTarget": { "description": "WriteBackTarget defines the path and type of file to update in the Git repository.\nExamples: \"helmvalues:./helm/values.yaml\", \"kustomization:./kustomize/overlays/production\".\nFor ApplicationSet usage, `{{ .app.path.path }}` should be resolved by ApplicationSet\nbefore this CR is generated, resulting in a concrete path here.\nRequired if write-back method is Git and this is not specified at the spec level.", "type": "string" } }, "type": "object", "additionalProperties": false }, "method": { "default": "argocd", "description": "Method defines the method for writing back updated image versions.\nThis acts as the default if not overridden. If not specified, defaults to \"argocd\".", "pattern": "^(argocd|git|git:[a-zA-Z0-9][a-zA-Z0-9-._/:]*)$", "type": "string" } }, "required": [ "method" ], "type": "object", "additionalProperties": false } }, "required": [ "namePattern" ], "type": "object", "x-kubernetes-validations": [ { "message": "Either useAnnotations must be true, or images must be provided with at least one item", "rule": "!(has(self.useAnnotations) && self.useAnnotations == true) ? (has(self.images) && size(self.images) > 0) : true" } ], "additionalProperties": false }, "minItems": 1, "type": "array", "x-kubernetes-list-map-keys": [ "namePattern" ], "x-kubernetes-list-type": "map" }, "commonUpdateSettings": { "description": "CommonUpdateSettings provides global default settings for update strategies,\ntag filtering, pull secrets, etc., for all applications matched by this CR.\nThese can be overridden at the ApplicationRef or ImageConfig level.", "properties": { "allowTags": { "description": "AllowTags is a regex pattern for tags to allow.\nThis acts as the default if not overridden.", "type": "string" }, "forceUpdate": { "default": false, "description": "ForceUpdate specifies whether updates should be forced.\nThis acts as the default if not overridden.", "type": "boolean" }, "ignoreTags": { "description": "IgnoreTags is a list of glob-like patterns of tags to ignore.\nThis acts as the default and can be overridden at more specific levels.", "items": { "type": "string" }, "type": "array", "x-kubernetes-list-type": "atomic" }, "platforms": { "description": "Platforms specifies a list of target platforms (e.g., \"linux/amd64\", \"linux/arm64\").\nIf specified, the image updater will consider these platforms when checking for new versions or digests.", "items": { "type": "string" }, "type": "array", "x-kubernetes-list-type": "atomic" }, "pullSecret": { "description": "PullSecret is the pull secret to use for images.\nThis acts as the default if not overridden.", "type": "string" }, "updateStrategy": { "default": "semver", "description": "UpdateStrategy defines the update strategy to apply.\nExamples: \"semver\", \"latest\", \"digest\", \"name\".\nThis acts as the default if not overridden at a more specific level.", "type": "string" } }, "type": "object", "additionalProperties": false }, "writeBackConfig": { "description": "WriteBackConfig provides global default settings for how and where to write back image updates.\nThis can be overridden at the ApplicationRef level.", "properties": { "gitConfig": { "description": "GitConfig provides Git configuration settings if the write-back method involves Git.\nThis can only be used when method is \"git\" or starts with \"git:\".", "properties": { "branch": { "description": "Branch to commit updates to.\nRequired if write-back method is Git and this is not specified at the spec level.", "type": "string" }, "pullRequest": { "description": "PullRequest configures creation of pull requests when writing back image updates to Git.\nWhen set, the controller opens a PR instead of pushing to the branch.\nIf not specified write back config method is `git`.", "properties": { "github": { "description": "GitHub configures PR creation via the GitHub API.", "type": "object" }, "gitlab": { "description": "GitLab configures MR creation via the GitLab API.", "type": "object" } }, "type": "object", "x-kubernetes-validations": [ { "message": "Exactly one of github or gitlab must be set", "rule": "(has(self.github) ? 1 : 0) + (has(self.gitlab) ? 1 : 0) == 1" } ], "additionalProperties": false }, "repository": { "description": "Repository URL to commit changes to.\nIf not specified here or at the spec level, the controller MUST infer it from the\nArgo CD Application's `spec.source.repoURL`. This field allows overriding that.", "type": "string" }, "writeBackTarget": { "description": "WriteBackTarget defines the path and type of file to update in the Git repository.\nExamples: \"helmvalues:./helm/values.yaml\", \"kustomization:./kustomize/overlays/production\".\nFor ApplicationSet usage, `{{ .app.path.path }}` should be resolved by ApplicationSet\nbefore this CR is generated, resulting in a concrete path here.\nRequired if write-back method is Git and this is not specified at the spec level.", "type": "string" } }, "type": "object", "additionalProperties": false }, "method": { "default": "argocd", "description": "Method defines the method for writing back updated image versions.\nThis acts as the default if not overridden. If not specified, defaults to \"argocd\".", "pattern": "^(argocd|git|git:[a-zA-Z0-9][a-zA-Z0-9-._/:]*)$", "type": "string" } }, "required": [ "method" ], "type": "object", "additionalProperties": false } }, "required": [ "applicationRefs" ], "type": "object", "additionalProperties": false }, "status": { "description": "ImageUpdaterStatus defines the observed state of ImageUpdater", "properties": { "applicationsMatched": { "description": "ApplicationsMatched is the number of Argo CD applications matched by this CR's selectors.", "format": "int32", "minimum": 0, "type": "integer" }, "conditions": { "description": "Conditions represent the latest available observations of the resource's state.", "items": { "description": "Condition contains details for one aspect of the current state of this API Resource.", "properties": { "lastTransitionTime": { "description": "lastTransitionTime is the last time the condition transitioned from one status to another.\nThis should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.", "format": "date-time", "type": "string" }, "message": { "description": "message is a human readable message indicating details about the transition.\nThis may be an empty string.", "maxLength": 32768, "type": "string" }, "observedGeneration": { "description": "observedGeneration represents the .metadata.generation that the condition was set based upon.\nFor instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date\nwith respect to the current state of the instance.", "format": "int64", "minimum": 0, "type": "integer" }, "reason": { "description": "reason contains a programmatic identifier indicating the reason for the condition's last transition.\nProducers of specific condition types may define expected values and meanings for this field,\nand whether the values are considered a guaranteed API.\nThe value should be a CamelCase string.\nThis field may not be empty.", "maxLength": 1024, "minLength": 1, "pattern": "^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$", "type": "string" }, "status": { "description": "status of the condition, one of True, False, Unknown.", "enum": [ "True", "False", "Unknown" ], "type": "string" }, "type": { "description": "type of condition in CamelCase or in foo.example.com/CamelCase.", "maxLength": 316, "pattern": "^([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])$", "type": "string" } }, "required": [ "lastTransitionTime", "message", "reason", "status", "type" ], "type": "object", "additionalProperties": false }, "type": "array", "x-kubernetes-list-map-keys": [ "type" ], "x-kubernetes-list-type": "map" }, "imagesManaged": { "description": "ImagesManaged is the number of images that were eligible for update checking.", "format": "int32", "minimum": 0, "type": "integer" }, "lastCheckedAt": { "description": "LastCheckedAt indicates when the controller last checked for image updates.", "format": "date-time", "type": "string" }, "lastUpdatedAt": { "description": "LastUpdatedAt indicates when the controller last performed an image update.", "format": "date-time", "type": "string" }, "observedGeneration": { "description": "ObservedGeneration is the most recent generation observed by the controller.", "format": "int64", "minimum": 0, "type": "integer" }, "recentUpdates": { "description": "RecentUpdates contains the list of image updates performed during the last update cycle.", "items": { "description": "RecentUpdate records a single image update performed during the last update.", "properties": { "alias": { "description": "Alias is the alias of the image configuration that was updated.", "type": "string" }, "applicationsUpdated": { "description": "ApplicationsUpdated is the number of applications in which this image was updated.", "format": "int32", "minimum": 0, "type": "integer" }, "image": { "description": "Image is the full image reference.", "type": "string" }, "message": { "description": "Message provides a human-readable description of the update action.", "type": "string" }, "newVersion": { "description": "NewVersion is the new tag or digest the image was updated to.", "type": "string" }, "updatedAt": { "description": "UpdatedAt is the timestamp when the update was applied.", "format": "date-time", "type": "string" } }, "required": [ "alias", "applicationsUpdated", "image", "newVersion", "updatedAt" ], "type": "object", "additionalProperties": false }, "type": "array", "x-kubernetes-list-type": "atomic" } }, "type": "object", "additionalProperties": false } }, "type": "object" }