Skip to content

Commit c0d7808

Browse files
committed
update API
1 parent 3c57eb2 commit c0d7808

19 files changed

+4507
-94
lines changed

apis/apps/v1/componentdefinition_types.go

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,10 +1112,32 @@ type ComponentFileTemplate struct {
11121112
// +optional
11131113
ExternalManaged *bool `json:"externalManaged,omitempty"`
11141114

1115-
// Specifies whether to restart the pod when the file changes.
1115+
// Specifies whether to restart the pods when the configuration changes.
11161116
//
11171117
// +optional
11181118
RestartOnFileChange *bool `json:"restartOnFileChange,omitempty"`
1119+
1120+
// Defines the procedure that reloads the configuration when the file changes.
1121+
//
1122+
// When @restartOnFileChange is set to true, this action will be ignored.
1123+
//
1124+
// Note: This field is immutable once it has been set.
1125+
//
1126+
// +optional
1127+
Reconfigure *Action `json:"reconfigure,omitempty"`
1128+
1129+
// Defines the procedures that reload the configuration when the file changes if there are more than one files
1130+
// in the template, and they have different reload actions.
1131+
//
1132+
// Each key in the map represents a file name, and the corresponding value is the action to reload the
1133+
// configuration for that file. It takes precedence over the default @reconfigure action if set.
1134+
//
1135+
// When @restartOnFileChange is set to true, these actions will be ignored.
1136+
//
1137+
// Note: This field is immutable once it has been set.
1138+
//
1139+
// +optional
1140+
// Reconfigures *map[string]Action `json:"reconfigures,omitempty"`
11191141
}
11201142

11211143
type LogConfig struct {
@@ -1693,8 +1715,6 @@ type ComponentLifecycleActions struct {
16931715
//
16941716
// Note: This field is immutable once it has been set.
16951717
//
1696-
// This Action is reserved for future versions.
1697-
//
16981718
// +optional
16991719
Reconfigure *Action `json:"reconfigure,omitempty"`
17001720

apis/apps/v1/types.go

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -495,25 +495,39 @@ type ClusterComponentConfig struct {
495495
// The external source for the configuration.
496496
ClusterComponentConfigSource `json:",inline"`
497497

498-
// The custom reconfigure action to reload the service configuration whenever changes to this config are detected.
498+
// ExternalManaged indicates whether the configuration is managed by an external system.
499+
// When set to true, the controller will use the user-provided template and reconfigure action,
500+
// ignoring the default template and update behavior.
501+
//
502+
// +optional
503+
ExternalManaged *bool `json:"externalManaged,omitempty"`
504+
505+
// The custom reconfigure action to reload the configuration whenever changes to this config are detected.
499506
//
500507
// The container executing this action has access to following variables:
501508
//
502509
// - KB_CONFIG_FILES_CREATED: file1,file2...
503510
// - KB_CONFIG_FILES_REMOVED: file1,file2...
504511
// - KB_CONFIG_FILES_UPDATED: file1:checksum1,file2:checksum2...
505512
//
506-
// Note: This field is immutable once it has been set.
507-
//
508513
// +optional
509514
Reconfigure *Action `json:"reconfigure,omitempty"`
510515

511-
// ExternalManaged indicates whether the configuration is managed by an external system.
512-
// When set to true, the controller will use the user-provided template and reconfigure action,
513-
// ignoring the default template and update behavior.
516+
// The custom reconfigure actions to reload the configuration whenever changes to this config are detected.
517+
// It is applicable to the scenario where there are more than one files in the configuration,
518+
// and they have different reload actions.
519+
//
520+
// Each key in the map represents a file name, and the corresponding value is the action to reload the
521+
// configuration for that file. It takes precedence over the default @reconfigure action if set.
522+
//
523+
// The container executing each action has access to following variables:
524+
//
525+
// - KB_CONFIG_FILES_CREATED: file
526+
// - KB_CONFIG_FILES_REMOVED: file
527+
// - KB_CONFIG_FILES_UPDATED: checksum
514528
//
515529
// +optional
516-
ExternalManaged *bool `json:"externalManaged,omitempty"`
530+
// Reconfigures *map[string]Action `json:"reconfigures,omitempty"`
517531
}
518532

519533
// ClusterComponentConfigSource represents the source of a configuration for a component.

apis/apps/v1/zz_generated.deepcopy.go

Lines changed: 10 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/workloads/v1/instanceset_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ type LifecycleActions struct {
504504
// +optional
505505
Switchover *Action `json:"switchover,omitempty"`
506506

507-
// Defines the procedure that update a replica with new configuration.
507+
// Defines the procedure that update replicas with new configuration.
508508
//
509509
// +optional
510510
Reconfigure *Action `json:"reconfigure,omitempty"`

config/crd/bases/apps.kubeblocks.io_clusters.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ spec:
291291
type: string
292292
reconfigure:
293293
description: |-
294-
The custom reconfigure action to reload the service configuration whenever changes to this config are detected.
294+
The custom reconfigure action to reload the configuration whenever changes to this config are detected.
295295

296296

297297
The container executing this action has access to following variables:
@@ -300,9 +300,6 @@ spec:
300300
- KB_CONFIG_FILES_CREATED: file1,file2...
301301
- KB_CONFIG_FILES_REMOVED: file1,file2...
302302
- KB_CONFIG_FILES_UPDATED: file1:checksum1,file2:checksum2...
303-
304-
305-
Note: This field is immutable once it has been set.
306303
properties:
307304
exec:
308305
description: |-
@@ -11513,7 +11510,7 @@ spec:
1151311510
type: string
1151411511
reconfigure:
1151511512
description: |-
11516-
The custom reconfigure action to reload the service configuration whenever changes to this config are detected.
11513+
The custom reconfigure action to reload the configuration whenever changes to this config are detected.
1151711514

1151811515

1151911516
The container executing this action has access to following variables:
@@ -11522,9 +11519,6 @@ spec:
1152211519
- KB_CONFIG_FILES_CREATED: file1,file2...
1152311520
- KB_CONFIG_FILES_REMOVED: file1,file2...
1152411521
- KB_CONFIG_FILES_UPDATED: file1:checksum1,file2:checksum2...
11525-
11526-
11527-
Note: This field is immutable once it has been set.
1152811522
properties:
1152911523
exec:
1153011524
description: |-

0 commit comments

Comments
 (0)