Skip to content

Commit 05f4303

Browse files
committed
fix crd generation
1 parent 109e877 commit 05f4303

File tree

3 files changed

+26
-21
lines changed

3 files changed

+26
-21
lines changed

deploy/helm/hbase-operator/crds/crds.yaml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -725,13 +725,17 @@ spec:
725725
type: boolean
726726
type: object
727727
regionMover:
728+
default:
729+
ack: null
730+
maxThreads: null
731+
runBeforeShutdown: null
728732
description: Before terminating a region server pod, the RegionMover tool can be invoked to transfer local regions to other servers. This may cause a lot of network traffic in the Kubernetes cluster if the entire HBase stacklet is being restarted. The operator will compute a timeout period for the region move that will not exceed the graceful shutdown timeout.
729-
nullable: true
730733
properties:
731734
ack:
732735
description: If enabled (default), the region mover will confirm that regions are available on the source as well as the target pods before and after the move.
736+
nullable: true
733737
type: boolean
734-
extraOpts:
738+
additionalMoverOptions:
735739
default: []
736740
description: Additional options to pass to the region mover.
737741
items:
@@ -741,14 +745,12 @@ spec:
741745
description: Maximum number of threads to use for moving regions.
742746
format: uint16
743747
minimum: 0.0
748+
nullable: true
744749
type: integer
745750
runBeforeShutdown:
746751
description: Move local regions to other servers before terminating a region server's pod.
752+
nullable: true
747753
type: boolean
748-
required:
749-
- ack
750-
- maxThreads
751-
- runBeforeShutdown
752754
type: object
753755
resources:
754756
default:
@@ -974,13 +976,17 @@ spec:
974976
type: boolean
975977
type: object
976978
regionMover:
979+
default:
980+
ack: null
981+
maxThreads: null
982+
runBeforeShutdown: null
977983
description: Before terminating a region server pod, the RegionMover tool can be invoked to transfer local regions to other servers. This may cause a lot of network traffic in the Kubernetes cluster if the entire HBase stacklet is being restarted. The operator will compute a timeout period for the region move that will not exceed the graceful shutdown timeout.
978-
nullable: true
979984
properties:
980985
ack:
981986
description: If enabled (default), the region mover will confirm that regions are available on the source as well as the target pods before and after the move.
987+
nullable: true
982988
type: boolean
983-
extraOpts:
989+
additionalMoverOptions:
984990
default: []
985991
description: Additional options to pass to the region mover.
986992
items:
@@ -990,14 +996,12 @@ spec:
990996
description: Maximum number of threads to use for moving regions.
991997
format: uint16
992998
minimum: 0.0
999+
nullable: true
9931000
type: integer
9941001
runBeforeShutdown:
9951002
description: Move local regions to other servers before terminating a region server's pod.
1003+
nullable: true
9961004
type: boolean
997-
required:
998-
- ack
999-
- maxThreads
1000-
- runBeforeShutdown
10011005
type: object
10021006
resources:
10031007
default:

docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ spec:
4141
runBeforeShutdown: true # <1>
4242
maxThreads: 5 # <2>
4343
ack: false # <3>
44-
extraOpts: ["--designatedFile", "/path/to/designatedFile"] # <4>
44+
additionalMoverOptions: ["--designatedFile", "/path/to/designatedFile"] # <4>
4545
----
4646
<1>: Run the region mover tool before shutting down the region server. Default is `false`.
4747
<2>: Maximum number of threads to use for moving regions. Default is 1.

rust/crd/src/lib.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -534,17 +534,17 @@ pub struct RegionMover {
534534
/// source as well as the target pods before and after the move.
535535
ack: Option<bool>,
536536

537-
/// Additional options to pass to the region mover.
538-
#[serde(default)]
539-
extra_opts: Option<RegionMoverExtraCliOpts>,
537+
#[fragment_attrs(serde(flatten))]
538+
cli_opts: Option<RegionMoverExtraCliOpts>,
540539
}
541540

542541
#[derive(Clone, Debug, Eq, Deserialize, JsonSchema, PartialEq, Serialize)]
543542
#[serde(rename_all = "camelCase")]
544543
#[schemars(deny_unknown_fields)]
545544
pub struct RegionMoverExtraCliOpts {
546-
#[serde(flatten)]
547-
pub cli_opts: Vec<String>,
545+
/// Additional options to pass to the region mover.
546+
#[serde(default)]
547+
pub additional_mover_options: Vec<String>,
548548
}
549549

550550
impl Atomic for RegionMoverExtraCliOpts {}
@@ -555,7 +555,7 @@ impl Default for RegionMover {
555555
run_before_shutdown: Some(false),
556556
max_threads: Some(1),
557557
ack: Some(true),
558-
extra_opts: None,
558+
cli_opts: None,
559559
}
560560
}
561561
}
@@ -595,6 +595,7 @@ pub struct RegionServerConfig {
595595
/// This may cause a lot of network traffic in the Kubernetes cluster if the entire HBase stacklet is being
596596
/// restarted.
597597
/// The operator will compute a timeout period for the region move that will not exceed the graceful shutdown timeout.
598+
#[fragment_attrs(serde(default))]
598599
pub region_mover: RegionMover,
599600
}
600601

@@ -1170,9 +1171,9 @@ impl AnyServiceConfig {
11701171
command.extend(
11711172
config
11721173
.region_mover
1173-
.extra_opts
1174+
.cli_opts
11741175
.iter()
1175-
.flat_map(|o| o.cli_opts.clone())
1176+
.flat_map(|o| o.additional_mover_options.clone())
11761177
.map(|s| escape(std::borrow::Cow::Borrowed(&s)).to_string()),
11771178
);
11781179
command.join(" ")

0 commit comments

Comments
 (0)