Add --plugins flag to velero install (#1930)

* Add plugins flag to install

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
This commit is contained in:
Nolan Brubaker
2019-10-03 16:44:52 -07:00
committed by KubeKween
parent db59d8d4bc
commit f009fe9bd1
7 changed files with 63 additions and 34 deletions
+3
View File
@@ -64,6 +64,7 @@ type InstallOptions struct {
Wait bool
UseVolumeSnapshots bool
DefaultResticMaintenanceFrequency time.Duration
Plugins flag.StringArray
}
// BindFlags adds command line values to the options struct.
@@ -92,6 +93,7 @@ func (o *InstallOptions) BindFlags(flags *pflag.FlagSet) {
flags.BoolVar(&o.UseRestic, "use-restic", o.UseRestic, "create restic deployment. Optional.")
flags.BoolVar(&o.Wait, "wait", o.Wait, "wait for Velero deployment to be ready. Optional.")
flags.DurationVar(&o.DefaultResticMaintenanceFrequency, "default-restic-prune-frequency", o.DefaultResticMaintenanceFrequency, "how often 'restic prune' is run for restic repositories by default. Optional.")
flags.Var(&o.Plugins, "plugins", "Plugin container images to install into the Velero Deployment. Optional.")
}
// NewInstallOptions instantiates a new, default InstallOptions struct.
@@ -155,6 +157,7 @@ func (o *InstallOptions) AsVeleroOptions() (*install.VeleroOptions, error) {
BSLConfig: o.BackupStorageConfig.Data(),
VSLConfig: o.VolumeSnapshotConfig.Data(),
DefaultResticMaintenanceFrequency: o.DefaultResticMaintenanceFrequency,
Plugins: o.Plugins,
}, nil
}