Updated on 2025-04-03 GMT+08:00

ccictl apply set-last-applied

Scenario

Set the last-applied-configuration annotation to match the content of a file. This updates the last-applied-configuration annotation, as if you had run ccictl apply -f <file>, without updating any other part of the object.

ccictl apply set-last-applied -f FILENAME

Examples

# Set the last-applied-configuration annotation of a resource to match the content of a file.
ccictl apply set-last-applied -f deploy.yaml

# Execute the set-last-applied operation against each configuration file in a directory.
ccictl apply set-last-applied -f path/

# Set the last-applied-configuration annotation for a resource to match the content of a file. If no such annotation exists, an annotation will be created.
ccictl apply set-last-applied -f deploy.yaml --create-annotation=true

Options

--allow-missing-template-keys     Default: true

If the value is true, the error in the template is ignored when a field or mapping key is missing in the template. This option applies only to the Golang and JSONPath output formats.

--create-annotation

If the current object does not have the last-applied-configuration annotation, the annotation will be created.

-f, --filename strings

List of file names, directories, or URLs that contain the last-applied-configuration annotation.

-h, --help

Help information for set-last-applied

-o, --output string

Output format. The value options include json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, and jsonpath-file.

--template string

Template character string or template file path used when -o is set to go-template or go-template-file. The Golang template format is [http://golang.org/pkg/text/template/#pkg-overview].

The following ccictl options can also be used in subcommands:

Parent command options