Skip to content

Commit

Permalink
Update src/cmd/tag.go
Browse files Browse the repository at this point in the history
Co-authored-by: David Bloss <[email protected]>
  • Loading branch information
2 people authored and Taimoor Ahmad committed Sep 14, 2023
1 parent 2f79d68 commit b8eb29a
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/cmd/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,17 @@ opslevel create tag --type=Team ID|ALIAS KEY VALUE
value := args[2]

if cmd.Flag("assign").Changed {
var input opslevel.TagAssignInput
tagInput := opslevel.TagInput{
Key: key,
Value: value,
}
input := opslevel.TagAssignInput{Tags: []opslevel.TagInput{tagInput}}

if opslevel.IsID(resource) {
input = opslevel.TagAssignInput{
Id: opslevel.ID(resource),
Tags: []opslevel.TagInput{tagInput},
}
input.Id = opslevel.ID(resource)
} else {
input = opslevel.TagAssignInput{
Alias: resource,
Type: opslevel.TaggableResource(resourceType),
Tags: []opslevel.TagInput{tagInput},
}
input.Alias = resource
input.Type = opslevel.TaggableResource(resourceType)
}

result, err := getClientGQL().AssignTag(input)
Expand Down

0 comments on commit b8eb29a

Please sign in to comment.