Begin warning on use of "--config" flag
I ran into an interesting scenario the other night:
I was using the "--config" flag to set IPAM mode.
When using this flag the cilium CLI cannot known to fix-up any stale entries in the cilium-config config-map. Subsequently it left cluster-pool flags in the config even tho the kubernetes IPAM mode was configured.
In this instance, it was benign and no harm was done. However it's not a large stretch of the imagination to think where bugs could creep in from this.
In this case the Cilium CLI had a flag specifically for setting the ipam mode, which does all the correct things w/r/t updating the config map.
We should begin issuing warnings to users when we see a "--config=XYZ" settings which we have explicity created a smarter native cli flag.
In my case when I specified the "--config 'ipam.mode=kubernetes'" flag, we should spit out a warning saying something to the effect of "you probably want to use the --ipam flag instead".
Subsequently it left cluster-pool flags in the config even tho the kubernetes IPAM mode was configured.
Shouldn't we also fatal in the agent if we have conflicting flags like this?
@pchaigno - not exactly sure, we probably setup the code in a "feature flag" fashion where extraneous flags are ignored if some top level flag is not defined (like x.mode = ).
Yep, but if this config. results in a broken cluster, we should check the options and fatal if they're not compatible.
@pchaigno agreed, it did not wind up creating a broken cluster (just for full context), but I agree with your sentiment regardless.