-
Notifications
You must be signed in to change notification settings - Fork 208
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
[GEN-2309] fix: config set command #2372
[GEN-2309] fix: config set command #2372
Conversation
…play-source-manage-list
…urces-card Task 107 overview sources card
…rce-manage-list Task 142 display source manage list
…rce-btn Task 143 add new source btn
…sources-connection Task 145 handle new sources connection
…o TASK-159-connect-api
}, | ||
} | ||
|
||
func updateConfigProperty(ctx context.Context, client *kube.Client, ns, property, value string) error { | ||
configMapName := "odigos-config" | ||
func setConfigProperty(config *common.OdigosConfiguration, property string, value []string) error { |
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.
should we err in case the property expects 1 value but the value
array has more than one?
instead of ignoring it
cli/cmd/config.go
Outdated
ns, _ := cmd.Flags().GetString("namespace") | ||
if ns == "" { | ||
ns = "odigos-system" | ||
ns = consts.DefaultOdigosNamespace | ||
} |
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.
please use
ns, err := resources.GetOdigosNamespace(client, ctx)
To automatically get the namespace instead of having the user supplying it
…al/odigos into gen-2309-fix-config-set-command
…al/odigos into gen-2309-fix-config-set-command
@alonkeyval @blumamir do you think this could replace #2303? My intent with that was to be able to override settings like image prefix. I had also considered a new |
@damemi It sounds like we can use this command for the purposes you described as well. |
This pull request introduces several changes to the
cli/cmd/config.go
file to enhance configuration management in Odigos. The changes include importing new packages, updating command arguments, and modifying the configuration update process.Imports and Dependencies:
resources
,odigospro
,common
, andconsts
packages to support new functionalities.Command Argument Handling:
Args
for thesetConfigCmd
command fromcobra.ExactArgs(2)
tocobra.MinimumNArgs(2)
to allow for multiple values.Configuration Update Process:
updateConfigProperty
function withsetConfigProperty
to handle a broader range of configuration properties and to increment theConfigVersion
.resources.GetCurrentConfig
,resources.CreateResourceManagers
, andresources.ApplyResourceManagers
.These changes improve the flexibility and robustness of the configuration management in Odigos.