-
Notifications
You must be signed in to change notification settings - Fork 206
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
Add cli subcommands for manipulating Sources #2375
Conversation
7a086eb
to
3be76f3
Compare
3be76f3
to
535cd3a
Compare
535cd3a
to
69904d0
Compare
69904d0
to
b42996d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥇
sourceFlags.StringVar(&workloadKindFlag, workloadKindFlagName, "", "Kubernetes Kind for entity (one of: Deployment, DaemonSet, StatefulSet, Namespace)") | ||
sourceFlags.StringVar(&workloadNameFlag, workloadNameFlagName, "", "Name of entity for Source") | ||
sourceFlags.StringVar(&workloadNamespaceFlag, workloadNamespaceFlagName, "", "Namespace of entity for Source") | ||
sourceFlags.StringVar(&sourceGroupFlag, sourceGroupFlagName, "", "Name of Source group to use") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonder if we should add a short flag as well for these flags
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about that, it's kind of annoying to type the full flag out each time
6de5372
to
6efdc64
Compare
This adds a new
odigos sources
subcommand for manipulating Sources:odigos sources create ...
odigos sources update ...
odigos sources delete ...
Each command takes the following flags:
--namespace
: The namespace of the Source to act on--workload-kind
: Applies the command to all Sources with the matching label--workload-name
: Applies the command to all Sources with the matching label--workload-namespace
: Applies the command to all Sources with the matching label--group
: Applies the command to all Sources in the groupCreate
This command creates a Source, for example:
It requires the
kind
,name
, andnamespace
flags (enforced by the Source validation webhook, along with all other checks provided by that webhook).It also provides the following flags:
--disable-instrumentation
: setspec.disableInstrumentation: <value>
(default: false)Update
This command updates any Sources matching the label flags, for example:
Because this can update many Sources at once, there is a confirmation prompt.
It also provides the following flags:
--all-namespaces
: apply the change to Sources in all namespaces--yes
: Skip the confirmation prompt--set-group
: Add theodigos.io/group-<value>
label to the Source--remove-group
: Remove theodigos.io/group-<value>
label from the SourceDelete
This command deletes all Sources matching the provided labels, for example:
It also provides the following flags:
--all-namespaces
: apply the change to Sources in all namespaces--yes
: Skip the confirmation prompt