From 6d3100c8604c90b698ec1d51b7754015d8e1ba2d Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Fri, 22 Mar 2024 11:37:31 +0100 Subject: [PATCH] [Feature] Expose Force CRD Install option (#1625) --- CHANGELOG.md | 1 + cmd/crd.go | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a24221cf2..c2e8b06e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - (Feature) (ML) Use Scheduler API - (Feature) (Scheduler) Introduce Scheduler CRD - (Feature) Discover Namespace in DebugPackage from K8S +- (Feature) Expose Force CRD Install option ## [1.2.39](https://github.com/arangodb/kube-arangodb/tree/1.2.39) (2024-03-11) - (Feature) Extract Scheduler API diff --git a/cmd/crd.go b/cmd/crd.go index a44329fbc..3c843b258 100644 --- a/cmd/crd.go +++ b/cmd/crd.go @@ -52,6 +52,7 @@ var ( var ( crdInstallOptions struct { validationSchema []string + force bool } ) @@ -65,6 +66,7 @@ func init() { f := cmdCRDInstall.Flags() f.StringArrayVar(&crdInstallOptions.validationSchema, "crd.validation-schema", defaultValidationSchemaEnabled, "Controls which CRD should have validation schema =.") + f.BoolVar(&crdInstallOptions.force, "crd.force-update", false, "Enforce CRD Schema update") cmdCRD.AddCommand(cmdCRDInstall) } @@ -109,7 +111,7 @@ func cmdCRDInstallRun(cmd *cobra.Command, args []string) { ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() - err = crd.EnsureCRDWithOptions(ctx, client, crd.EnsureCRDOptions{IgnoreErrors: false, CRDOptions: crdOpts}) + err = crd.EnsureCRDWithOptions(ctx, client, crd.EnsureCRDOptions{IgnoreErrors: false, CRDOptions: crdOpts, ForceUpdate: crdInstallOptions.force}) if err != nil { os.Exit(1) }