-
Notifications
You must be signed in to change notification settings - Fork 149
Open
Labels
help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
Description
Why do you think this document is needed:
The content of this article may need modifications: Article Path
The following content may be incorrect:
Overriding Configuration File Values
If necessary, command line flags can still be used in conjunction with the configuration file. The parameters specified via the command line will override those in the configuration file. For example, to override the number of API server replicas, you could use:
karmadactl init --config /path/to/karmada-init.yaml --karmada-apiserver-replicas 5
According to the code implementation:
setIfNotZeroInt32(&i.KarmadaAPIServerReplicas, apiServer.CommonSettings.Replicas)// setIfNotEmpty checks if the source string is not empty, and if so, assigns its value to the destination string. func setIfNotEmpty(dest *string, src string) { if src != "" { *dest = src } }
Since the assignment of i.KarmadaAPIServerReplicas using the command line occurs earlier than the assignment from parsing the configuration file, it will override the value passed from the command line, rather than the command line value overriding the value passed from the configuration file.
Metadata
Metadata
Assignees
Labels
help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.