Skip to content

Commit 6d3100c

Browse files
authored
[Feature] Expose Force CRD Install option (#1625)
1 parent 72be29c commit 6d3100c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- (Feature) (ML) Use Scheduler API
88
- (Feature) (Scheduler) Introduce Scheduler CRD
99
- (Feature) Discover Namespace in DebugPackage from K8S
10+
- (Feature) Expose Force CRD Install option
1011

1112
## [1.2.39](https://github.com/arangodb/kube-arangodb/tree/1.2.39) (2024-03-11)
1213
- (Feature) Extract Scheduler API

cmd/crd.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ var (
5252
var (
5353
crdInstallOptions struct {
5454
validationSchema []string
55+
force bool
5556
}
5657
)
5758

@@ -65,6 +66,7 @@ func init() {
6566

6667
f := cmdCRDInstall.Flags()
6768
f.StringArrayVar(&crdInstallOptions.validationSchema, "crd.validation-schema", defaultValidationSchemaEnabled, "Controls which CRD should have validation schema <crd-name>=<true/false>.")
69+
f.BoolVar(&crdInstallOptions.force, "crd.force-update", false, "Enforce CRD Schema update")
6870
cmdCRD.AddCommand(cmdCRDInstall)
6971
}
7072

@@ -109,7 +111,7 @@ func cmdCRDInstallRun(cmd *cobra.Command, args []string) {
109111
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
110112
defer cancel()
111113

112-
err = crd.EnsureCRDWithOptions(ctx, client, crd.EnsureCRDOptions{IgnoreErrors: false, CRDOptions: crdOpts})
114+
err = crd.EnsureCRDWithOptions(ctx, client, crd.EnsureCRDOptions{IgnoreErrors: false, CRDOptions: crdOpts, ForceUpdate: crdInstallOptions.force})
113115
if err != nil {
114116
os.Exit(1)
115117
}

0 commit comments

Comments
 (0)