Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support to add labels to actionset in kanctl create actionset command #2434

Merged
merged 3 commits into from
Oct 26, 2023

Conversation

viveksinghggits
Copy link
Contributor

Change Overview

Fixes: #2433

This PR adds capability in kanctl so that we can specify the labels for the actionset that is going to get created. To do this, it introduces a flag called --labels to kanctl create actionset command.

kanctl create actionset --help
Create a new ActionSet or override a <parent> ActionSet

Usage:
  kanctl create actionset [flags]

Flags:
  -a, --action string                action for the action set (required if creating a new action set)
...
...
  -k, --kind string                  resource kind to apply selector on. Used along with the selector specified using --selector/-l (default "all")
      --labels string                Labels that should be added to the created actionset. Multiple labels can be separate by comma(,) (eg: --labels key=value,foo=bar)
...
...

Pull request type

Please check the type of change your PR introduces:

  • 🚧 Work in Progress
  • 🌈 Refactoring (no functional changes, no api changes)
  • 🐹 Trivial/Minor
  • 🐛 Bugfix
  • 🌻 Feature
  • 🗺️ Documentation
  • 🤖 Test

Issues

Test Plan

kanister/pkg/kanctl (label-actionset*) » go test
OK: 4 passed
PASS
ok  	github.com/kanisterio/kanister/pkg/kanctl	0.030s
  • 💪 Manual
  • ⚡ Unit test
  • 💚 E2E
kanctl create actionset --action backup --namespace kanister --blueprint mysql-blueprint --statefulset mysql/mysql-release --profile mysql/s3-profile-qgbmj --labels=key=value --dry-run 
apiVersion: cr.kanister.io/v1alpha1
kind: ActionSet
metadata:
  creationTimestamp: null
  generateName: backup-
  labels:
    key: value
spec:
kanctl create actionset --action backup --namespace kanister --blueprint mysql-blueprint --statefulset mysql/mysql-release --profile mysql/s3-profile-qgbmj --labels=key=value,keytwo=valuetwo --dry-run
apiVersion: cr.kanister.io/v1alpha1
kind: ActionSet
metadata:
  creationTimestamp: null
  generateName: backup-
  labels:
    key: value
    keytwo: valuetwo
spec:
kanctl create actionset --action backup --namespace kanister --blueprint mysql-blueprint --statefulset mysql/mysql-release --profile mysql/s3-profile-qgbmj --labels=key=value,keytwo=valuetwo, --dry-run
Error: invalid labels value. make sure the value for field --labels is correct
Usage:
  kanctl create actionset [flags]

@e-sumin
Copy link
Contributor

e-sumin commented Oct 25, 2023

Overall, except the raised question, LGTM to me.

Kanister automation moved this from In Progress to Reviewer approved Oct 26, 2023
@mergify mergify bot merged commit b909ad0 into master Oct 26, 2023
15 checks passed
Kanister automation moved this from Reviewer approved to Done Oct 26, 2023
@mergify mergify bot deleted the label-actionset branch October 26, 2023 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

Support to create actionset with specific labels using kanctl
2 participants