AddTo - Add the helm operator flags to the flagset
(flagSet *pflag.FlagSet)
| 47 | |
| 48 | // AddTo - Add the helm operator flags to the flagset |
| 49 | func (f *Flags) AddTo(flagSet *pflag.FlagSet) { |
| 50 | // Store flagset internally to be used for lookups later. |
| 51 | f.flagSet = flagSet |
| 52 | |
| 53 | // Helm flags. |
| 54 | flagSet.StringVar(&f.WatchesFile, |
| 55 | "watches-file", |
| 56 | "./watches.yaml", |
| 57 | "Path to the watches file to use", |
| 58 | ) |
| 59 | |
| 60 | // Controller flags. |
| 61 | flagSet.DurationVar(&f.ReconcilePeriod, |
| 62 | "reconcile-period", |
| 63 | time.Minute, |
| 64 | "Default reconcile period for controllers", |
| 65 | ) |
| 66 | flagSet.IntVar(&f.MaxConcurrentReconciles, |
| 67 | "max-concurrent-reconciles", |
| 68 | runtime.NumCPU(), |
| 69 | "Maximum number of concurrent reconciles for controllers.", |
| 70 | ) |
| 71 | |
| 72 | _ = flagSet.MarkDeprecated("config", |
| 73 | `controller-runtime has deprecated the ComponentConfig package |
| 74 | and as such, the ability to load the configuation from a file. Since the helm operator relies on controller-runtime |
| 75 | this flag will be removed when upgrading to a version of controller-runtime where the ComponentConfig package has been removed. |
| 76 | see https://github.com/kubernetes-sigs/controller-runtime/issues/895 for more information.`) |
| 77 | |
| 78 | // TODO(2.0.0): remove |
| 79 | flagSet.StringVar(&f.MetricsBindAddress, |
| 80 | "metrics-addr", |
| 81 | ":8080", |
| 82 | "The address the metric endpoint binds to", |
| 83 | ) |
| 84 | _ = flagSet.MarkDeprecated("metrics-addr", "use --metrics-bind-address instead") |
| 85 | flagSet.StringVar(&f.MetricsBindAddress, |
| 86 | "metrics-bind-address", |
| 87 | ":8080", |
| 88 | "The address the metric endpoint binds to", |
| 89 | ) |
| 90 | // TODO(2.0.0): for Go/Helm the port used is: 8081 |
| 91 | // update it to keep the project aligned to the other |
| 92 | flagSet.StringVar(&f.ProbeAddr, |
| 93 | "health-probe-bind-address", |
| 94 | ":8081", |
| 95 | "The address the probe endpoint binds to.", |
| 96 | ) |
| 97 | // TODO(2.0.0): remove |
| 98 | flagSet.BoolVar(&f.LeaderElection, |
| 99 | "enable-leader-election", |
| 100 | false, |
| 101 | "Enable leader election for controller manager. Enabling this will"+ |
| 102 | " ensure there is only one active controller manager.", |
| 103 | ) |
| 104 | _ = flagSet.MarkDeprecated("enable-leader-election", "use --leader-elect instead.") |
| 105 | flagSet.BoolVar(&f.LeaderElection, |
| 106 | "leader-elect", |
no outgoing calls
no test coverage detected