Skip to content

feat: Add support for target tag sets with --tag flag#578

Closed
grace-rehn wants to merge 2 commits intomainfrom
grace/target-tag-set-support
Closed

feat: Add support for target tag sets with --tag flag#578
grace-rehn wants to merge 2 commits intomainfrom
grace/target-tag-set-support

Conversation

@grace-rehn
Copy link
Contributor

@grace-rehn grace-rehn commented Feb 10, 2026

Updates targets to support the ability to tag with a tag from new target tag sets.

  • Introduces new --tag flag which will accept canonical tag names
  • Keeps --role flag which has not changed and will accept tags from the [System] tag set as plain tag names

Tag Flag

Create commands with new --tag flag

Create a Cloud Region deployment target in Octopus Deploy

USAGE
 octopus deployment-target cloud-region create [flags]

FLAGS
     --environment strings    Choose at least one environment for the deployment target.
 -n, --name string            A short, memorable, unique name for this Cloud Region.
     --role strings           Choose at least one role that this deployment target will provide (use --tag for tag sets with validation).
     --tag strings            Target tags in canonical format (TagSetName/TagName).
     --tenant strings         Associate the deployment target with tenants
     --tenant-tag strings     Associate the deployment target with tenant tags, should be in the format 'tag set name/tag name'
     --tenanted-mode string   
                              Choose the kind of deployments where this deployment target should be included. Default is 'untenanted'
 -w, --web                    Open in web browser
     --worker-pool string     The worker pool for the deployment target, only required if not using the default worker pool

INHERITED FLAGS
 -h, --help                   Show help for a command
     --no-prompt              Disable prompting in interactive mode
 -f, --output-format string   Specify the output format for a command ("json", "table", or "basic") (default "table")
 -s, --space string           Specify the space for operations

EXAMPLE
 $ octopus deployment-target cloud-region create

Prompting

When --tag and --role are not supplied

If Tag Sets exist it will prompt for Tag Set selection, if no tag sets it will following existing prompts for roles

System Tag Set (multi select)

? [System] Target Tags  [Use arrows to move, space to select, <right> to all, <left> to none, type to filter]
> [ ]  [System] Target Tags/azure
  [ ]  [System] Target Tags/kind-cluster
  [ ]  [System] Target Tags/tag
  [ ]  [System] Target Tags/test-deletion

New Tag Sets (single select or multi select)

? My Target Set (Single Select)  [Use arrows to move, type to filter]
> (None)
  My Target Set/1
  My Target Set/2
  My Target Set/3

Validation

--roles flag has not changed, no validation
--tags will validate for existing tags/tag sets and single select/multi select rules

Single Select validation

octopus deployment-target cloud-region create --name 'Test CLi' --space 'Default' --environment 'Development' --role 'azure'  --tag 'My Target Set/1' --tag 'My Target Set/2' --tenanted-mode 'Untenanted' --no-prompt
only one tag can be specified for single-select tag set 'My Target Set', but found: [My Target Set/1 My Target Set/2]

Tag Set does not exist

octopus deployment-target cloud-region create --name 'Test CLi' --space 'Default' --environment 'Development' --tag 'Not Exist/azure' --tenanted-mode 'Untenanted' --no-prompt
tag 'Not Exist/azure' does not belong to any tag set available for this resource

Tag does not exist

octopus deployment-target cloud-region create --name 'Test CLi' --space 'Default' --environment 'Development' --tag '[System] Target Tags/notexist' --tenanted-mode 'Untenanted' --no-prompt
tag '[System] Target Tags/notexist' does not exist in tag set '[System] Target Tags'

Setting roles

All tags will be passed to the API in the roles field as plain tag names.
If both --roles and --tags are supplied, the values will be combined into the roles field.

Working example

octopus deployment-target cloud-region create --name 'Test CLi' --space 'Default' --environment 'Development' --tag '[System] Target Tags/azure' --tag '[System] Target Tags/tag' --tenanted-mode 'Untenanted' --no-prompt
Successfully created cloud region 'Test CLi'.
View this cloud region on Octopus Deploy: http://localhost:8065/app#/Spaces-1/infrastructure/machines/Machines-372/settings
image

@grace-rehn grace-rehn closed this Feb 10, 2026
@grace-rehn
Copy link
Contributor Author

Close (using #579 instead)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant