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

ccictl apply edit-last-applied

Scenario

Use the default editor to edit the latest last-applied-configuration annotation of the resource.

  • The edit-last-applied command allows you to directly edit any API resource that can be retrieved using the command-line tool. It opens the editor defined by the EDITOR environment variable, or "vi" on Linux or "notepad" on Windows by default. You can edit multiple objects, but the changes you make can only be applied one at a time. This command accepts file names and command line arguments, but the file you point to must be a previously saved version of the resource.
  • The default format is YAML. To edit in JSON, specify -o json.
  • The --windows-line-endings flag can be used to force the use of Windows-style line endings. Otherwise, the default settings of the OS will be used.
  • If an error occurs during the update, a temporary file containing the changes that are not applied is created on the disk. The most common error during an update is that another editor is changing the resource on the server. When this occurs, you will have to apply your changes to the newer version of the resource, or update your temporary saved copy to include the latest resource version.
ccictl apply edit-last-applied (RESOURCE/NAME | -f FILENAME)

Examples

# Edit the last-applied-configuration annotation by type or name in the YAML file.
ccictl apply edit-last-applied deployment/nginx

# Edit the last-applied-configuration annotation in JSON.
ccictl apply edit-last-applied -f deploy.yaml -o json

Options

-f, --filename strings

List of file names, directories, or file URLs used to edit resources.

-h, --help

Help information for edit-last-applied

-o, --output string

Output format. The value can be json or yaml.

-R, --recursive

Process the directory used in -f or --filename recursively. This option is useful when you want to manage related manifests organized within the same directory.

--validate string[="strict"]     Default: "strict"

The value must be one of the following: "strict" (or "true"), "warn", and "ignore" (or "false"). "true" or "strict" will use the pattern definition to validate the input. If the input is invalid, the request fails. "false" or "ignore" will not perform any schema definition checks, but will silently delete all unknown or duplicate fields.

--windows-line-endings

The default value is the native line ending format of your platform.

The following ccictl options can also be used in subcommands:

Parent command options