oracle-cne / ocne

The Oracle Cloud Native Environment CLI
Universal Permissive License v1.0
1 stars 0 forks source link

Command Line Arguments Do Not Take Precedence Over ClusterConfigFile #7

Closed George-Aeillo closed 1 month ago

George-Aeillo commented 1 month ago

Summary It was noticed that when the name entry was populated in a config file and the -C option was passed to the cluster start command with a different name, the -C name was not used, but the name entry in the config file was. For example, if config.yaml consists of  name: shouldNotBeUsed and the command used is cluster start -C nameToUse -c config.yaml, the cluster would start with the name shouldNotBeUsed. This is not ideal, as command line arguments should take precedence.

Steps to Reproduce

  1. Create a config file with the name entry populated
  2. Create a cluster with a different name passed in first through the -C flag, and then pass in the config file through the -c flag.

Expected Results

./ocne cluster start -w 1 -C realName -c ~/test.yaml 
INFO[2024-08-28T16:46:04-04:00] Creating new Kubernetes cluster named realName

Actual Results Test.yaml contains name: test as the only entry

./ocne cluster start -w 1 -C realName -c ~/test.yaml
INFO[2024-08-28T16:46:04-04:00] Creating new Kubernetes cluster named test 

References Reported By - George Aeillo