From faabcf114f117cd38e583b7c8eef50b4f092b343 Mon Sep 17 00:00:00 2001 From: Harold Cheng Date: Wed, 4 Dec 2024 11:52:45 +0800 Subject: [PATCH 1/7] chore: remove its role probe --- apis/workloads/v1/instanceset_types.go | 62 ----- apis/workloads/v1/zz_generated.deepcopy.go | 27 --- controllers/apps/component_utils.go | 9 - .../apps/transformer_component_workload.go | 1 - .../workloads/instanceset_controller_test.go | 5 - .../builder/builder_instance_set.go | 27 --- .../builder/builder_instance_set_test.go | 20 -- pkg/controller/factory/builder_test.go | 3 - pkg/controller/instanceset/object_builder.go | 224 +----------------- .../instanceset/object_builder_test.go | 99 -------- pkg/controller/instanceset/suite_test.go | 2 - pkg/controller/instanceset/types.go | 3 - pkg/controller/instanceset/utils.go | 2 +- pkg/controller/instanceset/utils_test.go | 2 - 14 files changed, 2 insertions(+), 484 deletions(-) diff --git a/apis/workloads/v1/instanceset_types.go b/apis/workloads/v1/instanceset_types.go index b67f4a2fcd0..e032e9c85be 100644 --- a/apis/workloads/v1/instanceset_types.go +++ b/apis/workloads/v1/instanceset_types.go @@ -195,11 +195,6 @@ type InstanceSetSpec struct { // +optional Roles []ReplicaRole `json:"roles,omitempty"` - // Provides method to probe role. - // - // +optional - RoleProbe *RoleProbe `json:"roleProbe,omitempty"` - // Provides actions to do membership dynamic reconfiguration. // // +optional @@ -506,63 +501,6 @@ const ( NoneMode AccessMode = "None" ) -// RoleProbe defines how to observe role -type RoleProbe struct { - // Defines a custom method for role probing. - // Actions defined here are executed in series. - // Upon completion of all actions, the final output should be a single string representing the role name defined in spec.Roles. - // The latest [BusyBox](https://busybox.net/) image will be used if Image is not configured. - // Environment variables can be used in Command: - // - v_KB_ITS_LAST_STDOUT: stdout from the last action, watch for 'v_' prefix - // - KB_ITS_USERNAME: username part of the credential - // - KB_ITS_PASSWORD: password part of the credential - // - // +optional - CustomHandler []Action `json:"customHandler,omitempty"` - - // Specifies the number of seconds to wait after the container has started before initiating role probing. - // - // +kubebuilder:default=0 - // +kubebuilder:validation:Minimum=0 - // +optional - InitialDelaySeconds int32 `json:"initialDelaySeconds,omitempty"` - - // Specifies the number of seconds after which the probe times out. - // - // +kubebuilder:default=1 - // +kubebuilder:validation:Minimum=1 - // +optional - TimeoutSeconds int32 `json:"timeoutSeconds,omitempty"` - - // Specifies the frequency (in seconds) of probe execution. - // - // +kubebuilder:default=2 - // +kubebuilder:validation:Minimum=1 - // +optional - PeriodSeconds int32 `json:"periodSeconds,omitempty"` - - // Specifies the minimum number of consecutive successes for the probe to be considered successful after having failed. - // - // +kubebuilder:default=1 - // +kubebuilder:validation:Minimum=1 - // +optional - SuccessThreshold int32 `json:"successThreshold,omitempty"` - - // Specifies the minimum number of consecutive failures for the probe to be considered failed after having succeeded. - // - // +kubebuilder:default=3 - // +kubebuilder:validation:Minimum=1 - // +optional - FailureThreshold int32 `json:"failureThreshold,omitempty"` - - // Specifies the method for updating the pod role label. - // - // +kubebuilder:default=ReadinessProbeEventUpdate - // +kubebuilder:validation:Enum={ReadinessProbeEventUpdate, DirectAPIServerEventUpdate} - // +optional - RoleUpdateMechanism RoleUpdateMechanism `json:"roleUpdateMechanism,omitempty"` -} - type Action struct { // Refers to the utility image that contains the command which can be utilized to retrieve or process role information. // diff --git a/apis/workloads/v1/zz_generated.deepcopy.go b/apis/workloads/v1/zz_generated.deepcopy.go index f36aeda179e..5c605826880 100644 --- a/apis/workloads/v1/zz_generated.deepcopy.go +++ b/apis/workloads/v1/zz_generated.deepcopy.go @@ -196,11 +196,6 @@ func (in *InstanceSetSpec) DeepCopyInto(out *InstanceSetSpec) { *out = make([]ReplicaRole, len(*in)) copy(*out, *in) } - if in.RoleProbe != nil { - in, out := &in.RoleProbe, &out.RoleProbe - *out = new(RoleProbe) - (*in).DeepCopyInto(*out) - } if in.MembershipReconfiguration != nil { in, out := &in.MembershipReconfiguration, &out.MembershipReconfiguration *out = new(MembershipReconfiguration) @@ -484,28 +479,6 @@ func (in *ReplicaRole) DeepCopy() *ReplicaRole { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RoleProbe) DeepCopyInto(out *RoleProbe) { - *out = *in - if in.CustomHandler != nil { - in, out := &in.CustomHandler, &out.CustomHandler - *out = make([]Action, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoleProbe. -func (in *RoleProbe) DeepCopy() *RoleProbe { - if in == nil { - return nil - } - out := new(RoleProbe) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SchedulingPolicy) DeepCopyInto(out *SchedulingPolicy) { *out = *in diff --git a/controllers/apps/component_utils.go b/controllers/apps/component_utils.go index e43f1af7eb9..24feb92ed52 100644 --- a/controllers/apps/component_utils.go +++ b/controllers/apps/component_utils.go @@ -31,11 +31,6 @@ import ( func delayUpdateInstanceSetSystemFields(obj workloads.InstanceSetSpec, pobj *workloads.InstanceSetSpec) { delayUpdatePodSpecSystemFields(obj.Template.Spec, &pobj.Template.Spec) - - if pobj.RoleProbe != nil && obj.RoleProbe != nil { - pobj.RoleProbe.FailureThreshold = obj.RoleProbe.FailureThreshold - pobj.RoleProbe.SuccessThreshold = obj.RoleProbe.SuccessThreshold - } } // delayUpdatePodSpecSystemFields to delay the updating to system fields in pod spec. @@ -50,10 +45,6 @@ func delayUpdatePodSpecSystemFields(obj corev1.PodSpec, pobj *corev1.PodSpec) { func updateInstanceSetSystemFields(obj workloads.InstanceSetSpec, pobj *workloads.InstanceSetSpec) { updatePodSpecSystemFields(obj.Template.Spec, &pobj.Template.Spec) - if pobj.RoleProbe != nil && obj.RoleProbe != nil { - pobj.RoleProbe.FailureThreshold = obj.RoleProbe.FailureThreshold - pobj.RoleProbe.SuccessThreshold = obj.RoleProbe.SuccessThreshold - } } // updatePodSpecSystemFields to update system fields in pod spec. diff --git a/controllers/apps/transformer_component_workload.go b/controllers/apps/transformer_component_workload.go index ea995677519..f5072a00e7a 100644 --- a/controllers/apps/transformer_component_workload.go +++ b/controllers/apps/transformer_component_workload.go @@ -459,7 +459,6 @@ func copyAndMergeITS(oldITS, newITS *workloads.InstanceSet) *workloads.InstanceS itsObjCopy.Spec.Template = *itsProto.Spec.Template.DeepCopy() itsObjCopy.Spec.Replicas = itsProto.Spec.Replicas itsObjCopy.Spec.Roles = itsProto.Spec.Roles - itsObjCopy.Spec.RoleProbe = itsProto.Spec.RoleProbe itsObjCopy.Spec.MembershipReconfiguration = itsProto.Spec.MembershipReconfiguration itsObjCopy.Spec.MemberUpdateStrategy = itsProto.Spec.MemberUpdateStrategy itsObjCopy.Spec.Credential = itsProto.Spec.Credential diff --git a/controllers/workloads/instanceset_controller_test.go b/controllers/workloads/instanceset_controller_test.go index 48901cb0ee6..7138b89e9db 100644 --- a/controllers/workloads/instanceset_controller_test.go +++ b/controllers/workloads/instanceset_controller_test.go @@ -62,15 +62,10 @@ var _ = Describe("InstanceSet Controller", func() { ObjectMeta: pod.ObjectMeta, Spec: pod.Spec, } - action := workloads.Action{ - Image: "foo", - Command: []string{"bar"}, - } its := builder.NewInstanceSetBuilder(testCtx.DefaultNamespace, name). AddMatchLabelsInMap(commonLabels). AddAnnotations(constant.CRDAPIVersionAnnotationKey, workloads.GroupVersion.String()). SetTemplate(template). - AddCustomHandler(action). GetObject() viper.Set(constant.KBToolsImage, "kb-tool-image") Expect(k8sClient.Create(ctx, its)).Should(Succeed()) diff --git a/pkg/controller/builder/builder_instance_set.go b/pkg/controller/builder/builder_instance_set.go index 39f9d71ffaa..79ea71f824e 100644 --- a/pkg/controller/builder/builder_instance_set.go +++ b/pkg/controller/builder/builder_instance_set.go @@ -128,33 +128,6 @@ func (builder *InstanceSetBuilder) SetUpdateStrategyType(strategyType apps.State return builder } -func (builder *InstanceSetBuilder) SetCustomHandler(handler []workloads.Action) *InstanceSetBuilder { - roleProbe := builder.get().Spec.RoleProbe - if roleProbe == nil { - roleProbe = &workloads.RoleProbe{} - } - roleProbe.CustomHandler = handler - builder.get().Spec.RoleProbe = roleProbe - return builder -} - -func (builder *InstanceSetBuilder) AddCustomHandler(handler workloads.Action) *InstanceSetBuilder { - roleProbe := builder.get().Spec.RoleProbe - if roleProbe == nil { - roleProbe = &workloads.RoleProbe{} - } - handlers := roleProbe.CustomHandler - handlers = append(handlers, handler) - roleProbe.CustomHandler = handlers - builder.get().Spec.RoleProbe = roleProbe - return builder -} - -func (builder *InstanceSetBuilder) SetRoleProbe(roleProbe *workloads.RoleProbe) *InstanceSetBuilder { - builder.get().Spec.RoleProbe = roleProbe - return builder -} - func (builder *InstanceSetBuilder) SetMembershipReconfiguration(reconfiguration *workloads.MembershipReconfiguration) *InstanceSetBuilder { builder.get().Spec.MembershipReconfiguration = reconfiguration return builder diff --git a/pkg/controller/builder/builder_instance_set_test.go b/pkg/controller/builder/builder_instance_set_test.go index fd4a3dcabcc..44f7116cbcc 100644 --- a/pkg/controller/builder/builder_instance_set_test.go +++ b/pkg/controller/builder/builder_instance_set_test.go @@ -116,18 +116,6 @@ var _ = Describe("instance_set builder", func() { }, } strategyType := apps.OnDeleteStatefulSetStrategyType - delay := int32(10) - roleProbe := workloads.RoleProbe{InitialDelaySeconds: delay} - actions := []workloads.Action{ - { - Image: "foo-1", - Command: []string{"bar-1"}, - }, - } - action := workloads.Action{ - Image: "foo-2", - Command: []string{"bar-2"}, - } memberUpdateStrategy := workloads.BestEffortParallelUpdateStrategy paused := true credential := workloads.Credential{ @@ -160,9 +148,6 @@ var _ = Describe("instance_set builder", func() { SetPodUpdatePolicy(podUpdatePolicy). SetUpdateStrategy(strategy). SetUpdateStrategyType(strategyType). - SetRoleProbe(&roleProbe). - SetCustomHandler(actions). - AddCustomHandler(action). SetMemberUpdateStrategy(&memberUpdateStrategy). SetPaused(paused). SetCredential(credential). @@ -196,11 +181,6 @@ var _ = Describe("instance_set builder", func() { Expect(*its.Spec.UpdateStrategy.RollingUpdate.Partition).Should(Equal(partition)) Expect(its.Spec.UpdateStrategy.RollingUpdate.MaxUnavailable).ShouldNot(BeNil()) Expect(its.Spec.UpdateStrategy.RollingUpdate.MaxUnavailable).ShouldNot(Equal(maxUnavailable)) - Expect(its.Spec.RoleProbe).ShouldNot(BeNil()) - Expect(its.Spec.RoleProbe.InitialDelaySeconds).Should(Equal(delay)) - Expect(its.Spec.RoleProbe.CustomHandler).Should(HaveLen(2)) - Expect(its.Spec.RoleProbe.CustomHandler[0]).Should(Equal(actions[0])) - Expect(its.Spec.RoleProbe.CustomHandler[1]).Should(Equal(action)) Expect(its.Spec.MemberUpdateStrategy).ShouldNot(BeNil()) Expect(*its.Spec.MemberUpdateStrategy).Should(Equal(memberUpdateStrategy)) Expect(its.Spec.Paused).Should(Equal(paused)) diff --git a/pkg/controller/factory/builder_test.go b/pkg/controller/factory/builder_test.go index 30de73608c7..7af11a7e784 100644 --- a/pkg/controller/factory/builder_test.go +++ b/pkg/controller/factory/builder_test.go @@ -123,9 +123,6 @@ var _ = Describe("builder", func() { // test roles Expect(its.Spec.Roles).Should(HaveLen(len(compDef.Spec.Roles))) - // test role probe - Expect(its.Spec.RoleProbe).Should(BeNil()) - // test member update strategy Expect(its.Spec.MemberUpdateStrategy).ShouldNot(BeNil()) Expect(*its.Spec.MemberUpdateStrategy).Should(BeEquivalentTo(workloads.BestEffortParallelUpdateStrategy)) diff --git a/pkg/controller/instanceset/object_builder.go b/pkg/controller/instanceset/object_builder.go index 6e49fee6ca4..7317293ed86 100644 --- a/pkg/controller/instanceset/object_builder.go +++ b/pkg/controller/instanceset/object_builder.go @@ -20,19 +20,14 @@ along with this program. If not, see . package instanceset import ( - "encoding/json" "fmt" - "strconv" "strings" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/sets" workloads "github.com/apecloud/kubeblocks/apis/workloads/v1" - "github.com/apecloud/kubeblocks/pkg/constant" "github.com/apecloud/kubeblocks/pkg/controller/builder" - "github.com/apecloud/kubeblocks/pkg/controllerutil" - viper "github.com/apecloud/kubeblocks/pkg/viperx" ) func buildHeadlessSvc(its workloads.InstanceSet, labels, selectors map[string]string) *corev1.Service { @@ -69,224 +64,7 @@ func getHeadlessSvcName(itsName string) string { func BuildPodTemplate(its *workloads.InstanceSet) *corev1.PodTemplateSpec { template := its.Spec.Template.DeepCopy() - injectRoleProbeContainer(its, template) + // injectRoleProbeContainer(its, template) return template } - -func injectRoleProbeContainer(its *workloads.InstanceSet, template *corev1.PodTemplateSpec) { - roleProbe := its.Spec.RoleProbe - if roleProbe == nil { - return - } - credential := its.Spec.Credential - credentialEnv := make([]corev1.EnvVar, 0) - if credential != nil { - credentialEnv = append(credentialEnv, - corev1.EnvVar{ - Name: usernameCredentialVarName, - Value: credential.Username.Value, - ValueFrom: credential.Username.ValueFrom, - }, - corev1.EnvVar{ - Name: passwordCredentialVarName, - Value: credential.Password.Value, - ValueFrom: credential.Password.ValueFrom, - }) - } - - actionSvcPorts := buildActionSvcPorts(template, roleProbe.CustomHandler) - - actionSvcList, _ := json.Marshal(actionSvcPorts) - injectRoleProbeBaseContainer(its, template, string(actionSvcList), credentialEnv) - - if roleProbe.CustomHandler != nil { - injectCustomRoleProbeContainer(its, template, actionSvcPorts, credentialEnv) - } -} - -func buildActionSvcPorts(template *corev1.PodTemplateSpec, actions []workloads.Action) []int32 { - findAllUsedPorts := func() []int32 { - allUsedPorts := make([]int32, 0) - for _, container := range template.Spec.Containers { - for _, port := range container.Ports { - allUsedPorts = append(allUsedPorts, port.ContainerPort) - allUsedPorts = append(allUsedPorts, port.HostPort) - } - } - return allUsedPorts - } - - findNextAvailablePort := func(base int32, allUsedPorts []int32) int32 { - for port := base + 1; port < 65535; port++ { - available := true - for _, usedPort := range allUsedPorts { - if port == usedPort { - available = false - break - } - } - if available { - return port - } - } - return 0 - } - - allUsedPorts := findAllUsedPorts() - svcPort := actionSvcPortBase - var actionSvcPorts []int32 - for range actions { - svcPort = findNextAvailablePort(svcPort, allUsedPorts) - actionSvcPorts = append(actionSvcPorts, svcPort) - } - return actionSvcPorts -} - -func injectRoleProbeBaseContainer(its *workloads.InstanceSet, template *corev1.PodTemplateSpec, actionSvcList string, credentialEnv []corev1.EnvVar) { - // compute parameters for role probe base container - roleProbe := its.Spec.RoleProbe - if roleProbe == nil { - return - } - - // already has role probe container, for test purpose - if _, c := controllerutil.GetContainerByName(template.Spec.Containers, roleProbeContainerName); c != nil { - return - } - - image := viper.GetString(constant.KBToolsImage) - probeHTTPPort := viper.GetInt("ROLE_SERVICE_HTTP_PORT") - if probeHTTPPort == 0 { - probeHTTPPort = defaultRoleProbeDaemonPort - } - probeGRPCPort := viper.GetInt("ROLE_PROBE_GRPC_PORT") - if probeGRPCPort == 0 { - probeGRPCPort = defaultRoleProbeGRPCPort - } - env := credentialEnv - env = append(env, - corev1.EnvVar{ - Name: actionSvcListVarName, - Value: actionSvcList, - }) - - // inject role update mechanism env - env = append(env, - corev1.EnvVar{ - Name: RoleUpdateMechanismVarName, - Value: string(roleProbe.RoleUpdateMechanism), - }) - - // inject role probe timeout env - env = append(env, - corev1.EnvVar{ - Name: roleProbeTimeoutVarName, - Value: strconv.Itoa(int(roleProbe.TimeoutSeconds)), - }) - - readinessProbe := &corev1.Probe{ - InitialDelaySeconds: roleProbe.InitialDelaySeconds, - TimeoutSeconds: roleProbe.TimeoutSeconds, - PeriodSeconds: roleProbe.PeriodSeconds, - SuccessThreshold: roleProbe.SuccessThreshold, - FailureThreshold: roleProbe.FailureThreshold, - } - - readinessProbe.ProbeHandler = corev1.ProbeHandler{ - Exec: &corev1.ExecAction{ - Command: []string{ - grpcHealthProbeBinaryPath, - fmt.Sprintf(grpcHealthProbeArgsFormat, probeGRPCPort), - }, - }, - } - - // if role probe container doesn't exist, create a new one - // build container - container := builder.NewContainerBuilder(roleProbeContainerName). - SetImage(image). - SetImagePullPolicy(corev1.PullIfNotPresent). - AddCommands([]string{ - roleProbeBinaryName, - "--port", strconv.Itoa(probeHTTPPort), - "--grpcport", strconv.Itoa(probeGRPCPort), - }...). - AddEnv(env...). - AddPorts( - corev1.ContainerPort{ - ContainerPort: int32(probeHTTPPort), - Name: roleProbeContainerName, - Protocol: "TCP", - }, - corev1.ContainerPort{ - ContainerPort: int32(probeGRPCPort), - Name: roleProbeGRPCPortName, - Protocol: "TCP", - }, - ). - SetReadinessProbe(*readinessProbe). - GetObject() - - // inject role probe container - template.Spec.Containers = append(template.Spec.Containers, *container) -} - -func injectCustomRoleProbeContainer(its *workloads.InstanceSet, template *corev1.PodTemplateSpec, actionSvcPorts []int32, credentialEnv []corev1.EnvVar) { - if its.Spec.RoleProbe == nil { - return - } - - // inject shared volume - agentVolume := corev1.Volume{ - Name: roleAgentVolumeName, - VolumeSource: corev1.VolumeSource{ - EmptyDir: &corev1.EmptyDirVolumeSource{}, - }, - } - template.Spec.Volumes = append(template.Spec.Volumes, agentVolume) - - // inject init container - agentVolumeMount := corev1.VolumeMount{ - Name: roleAgentVolumeName, - MountPath: roleAgentVolumeMountPath, - } - agentPath := strings.Join([]string{roleAgentVolumeMountPath, roleAgentName}, "/") - initContainer := corev1.Container{ - Name: roleAgentInstallerName, - Image: shell2httpImage, - ImagePullPolicy: corev1.PullIfNotPresent, - VolumeMounts: []corev1.VolumeMount{agentVolumeMount}, - Command: []string{ - "cp", - shell2httpBinaryPath, - agentPath, - }, - } - template.Spec.InitContainers = append(template.Spec.InitContainers, initContainer) - - // inject action containers based on utility images - for i, action := range its.Spec.RoleProbe.CustomHandler { - image := action.Image - if len(image) == 0 { - image = defaultActionImage - } - command := []string{ - agentPath, - "-port", fmt.Sprintf("%d", actionSvcPorts[i]), - "-export-all-vars", - "-form", - shell2httpServePath, - strings.Join(action.Command, " "), - } - container := corev1.Container{ - Name: fmt.Sprintf("action-%d", i), - Image: image, - ImagePullPolicy: corev1.PullIfNotPresent, - VolumeMounts: []corev1.VolumeMount{agentVolumeMount}, - Env: credentialEnv, - Command: command, - } - template.Spec.Containers = append(template.Spec.Containers, container) - } -} diff --git a/pkg/controller/instanceset/object_builder_test.go b/pkg/controller/instanceset/object_builder_test.go index 435b73376ca..a47d7304d4c 100644 --- a/pkg/controller/instanceset/object_builder_test.go +++ b/pkg/controller/instanceset/object_builder_test.go @@ -25,7 +25,6 @@ import ( corev1 "k8s.io/api/core/v1" - workloads "github.com/apecloud/kubeblocks/apis/workloads/v1" "github.com/apecloud/kubeblocks/pkg/constant" "github.com/apecloud/kubeblocks/pkg/controller/builder" ) @@ -40,107 +39,9 @@ var _ = Describe("object generation transformer test.", func() { SetRoles(roles). SetCredential(credential). SetTemplate(template). - SetCustomHandler(observeActions). GetObject() }) - Context("injectRoleProbeBaseContainer function", func() { - It("should reuse container 'kb-role-probe' if exists", func() { - templateCopy := template.DeepCopy() - templateCopy.Spec.Containers = append(templateCopy.Spec.Containers, corev1.Container{ - Name: roleProbeContainerName, - Image: "bar", - Ports: []corev1.ContainerPort{ - { - Name: roleProbeGRPCPortName, - ContainerPort: defaultRoleProbeGRPCPort, - }, - { - Name: roleProbeDaemonPortName, - ContainerPort: defaultRoleProbeDaemonPort, - }, - }, - }) - injectRoleProbeBaseContainer(its, templateCopy, "", nil) - Expect(len(templateCopy.Spec.Containers)).Should(Equal(2)) - probeContainer := templateCopy.Spec.Containers[1] - Expect(len(probeContainer.Ports)).Should(Equal(2)) - Expect(probeContainer.Ports[0].ContainerPort).Should(BeElementOf([]int32{int32(defaultRoleProbeGRPCPort), int32(defaultRoleProbeDaemonPort)})) - }) - - It("should not use default grpcPort in case of 'probe-grpc-port' existence", func() { - its.Spec.RoleProbe.RoleUpdateMechanism = workloads.ReadinessProbeEventUpdate - templateCopy := template.DeepCopy() - templateCopy.Spec.Containers = append(templateCopy.Spec.Containers, corev1.Container{ - Name: roleProbeContainerName, - Image: "bar", - Ports: []corev1.ContainerPort{ - { - Name: roleProbeGRPCPortName, - ContainerPort: 9555, - }, - { - Name: roleProbeDaemonPortName, - ContainerPort: defaultRoleProbeDaemonPort, - }, - }, - }) - injectRoleProbeBaseContainer(its, templateCopy, "", nil) - Expect(len(templateCopy.Spec.Containers)).Should(Equal(2)) - probeContainer := templateCopy.Spec.Containers[1] - Expect(len(probeContainer.Ports)).Should(Equal(2)) - Expect(probeContainer.Ports[0].ContainerPort).Should(Equal(int32(9555))) - }) - - It("container.ports nil", func() { - its.Spec.RoleProbe.RoleUpdateMechanism = workloads.ReadinessProbeEventUpdate - templateCopy := template.DeepCopy() - templateCopy.Spec.Containers = append(templateCopy.Spec.Containers, corev1.Container{ - Name: roleProbeContainerName, - Image: "bar", - Ports: []corev1.ContainerPort{ - { - Name: roleProbeGRPCPortName, - ContainerPort: defaultRoleProbeGRPCPort, - }, - { - Name: roleProbeDaemonPortName, - ContainerPort: defaultRoleProbeDaemonPort, - }, - }, - }) - injectRoleProbeBaseContainer(its, templateCopy, "", nil) - Expect(len(templateCopy.Spec.Containers)).Should(Equal(2)) - probeContainer := templateCopy.Spec.Containers[1] - Expect(len(probeContainer.Ports)).Should(Equal(2)) - Expect(probeContainer.Ports[0].ContainerPort).Should(Equal(int32(defaultRoleProbeGRPCPort))) - }) - - It("container.ports.containerPort negative", func() { - its.Spec.RoleProbe.RoleUpdateMechanism = workloads.ReadinessProbeEventUpdate - templateCopy := template.DeepCopy() - templateCopy.Spec.Containers = append(templateCopy.Spec.Containers, corev1.Container{ - Name: roleProbeContainerName, - Image: "bar", - Ports: []corev1.ContainerPort{ - { - Name: roleProbeGRPCPortName, - ContainerPort: defaultRoleProbeGRPCPort, - }, - { - Name: roleProbeDaemonPortName, - ContainerPort: defaultRoleProbeDaemonPort, - }, - }, - }) - injectRoleProbeBaseContainer(its, templateCopy, "", nil) - Expect(len(templateCopy.Spec.Containers)).Should(Equal(2)) - probeContainer := templateCopy.Spec.Containers[1] - Expect(len(probeContainer.Ports)).Should(Equal(2)) - Expect(probeContainer.Ports[0].ContainerPort).Should(Equal(int32(defaultRoleProbeGRPCPort))) - }) - }) - Context("headless service", func() { It("getHeadlessSvcName", func() { Expect(getHeadlessSvcName(its.Name)).Should(Equal("bar-headless")) diff --git a/pkg/controller/instanceset/suite_test.go b/pkg/controller/instanceset/suite_test.go index 54d275ae337..7c6ff168adf 100644 --- a/pkg/controller/instanceset/suite_test.go +++ b/pkg/controller/instanceset/suite_test.go @@ -145,8 +145,6 @@ var ( Username: workloads.CredentialVar{Value: "foo"}, Password: workloads.CredentialVar{Value: "bar"}, } - - observeActions = []workloads.Action{{Command: []string{"cmd"}}} ) func makePodUpdateReady(newRevision string, roleful bool, pods ...*corev1.Pod) { diff --git a/pkg/controller/instanceset/types.go b/pkg/controller/instanceset/types.go index 4af6d8ab75b..6cf388f2d34 100644 --- a/pkg/controller/instanceset/types.go +++ b/pkg/controller/instanceset/types.go @@ -34,9 +34,6 @@ const ( roleAgentInstallerName = "role-agent-installer" roleAgentVolumeMountPath = "/role-probe" roleAgentName = "agent" - shell2httpImage = "msoap/shell2http:1.16.0" - shell2httpBinaryPath = "/app/shell2http" - shell2httpServePath = "/role" defaultRoleProbeDaemonPort = 7373 defaultRoleProbeGRPCPort = 50101 roleProbeDaemonPortName = "probe-port" diff --git a/pkg/controller/instanceset/utils.go b/pkg/controller/instanceset/utils.go index d3cd1817586..78b8a2740c3 100644 --- a/pkg/controller/instanceset/utils.go +++ b/pkg/controller/instanceset/utils.go @@ -131,7 +131,7 @@ func IsInstanceSetReady(its *workloads.InstanceSet) bool { } // check whether role probe has done - if len(its.Spec.Roles) == 0 && its.Spec.RoleProbe == nil { + if len(its.Spec.Roles) == 0 { return true } membersStatus := its.Status.MembersStatus diff --git a/pkg/controller/instanceset/utils_test.go b/pkg/controller/instanceset/utils_test.go index 239d2c014c7..bde7f772e09 100644 --- a/pkg/controller/instanceset/utils_test.go +++ b/pkg/controller/instanceset/utils_test.go @@ -205,12 +205,10 @@ var _ = Describe("utils test", func() { By("set its to role-less") its.Status.AvailableReplicas = replicas its.Spec.Roles = nil - its.Spec.RoleProbe = nil Expect(IsInstanceSetReady(its)).Should(BeTrue()) By("set its to role-ful") its.Spec.Roles = roles - its.Spec.RoleProbe = &workloads.RoleProbe{} Expect(IsInstanceSetReady(its)).Should(BeFalse()) By("set membersStatus to ready") From bb48ac66c13876fc07dae36f98abd05b02958210 Mon Sep 17 00:00:00 2001 From: Harold Cheng Date: Wed, 4 Dec 2024 12:39:54 +0800 Subject: [PATCH 2/7] manifests --- .../workloads.kubeblocks.io_instancesets.yaml | 79 ------------------- .../workloads.kubeblocks.io_instancesets.yaml | 79 ------------------- 2 files changed, 158 deletions(-) diff --git a/config/crd/bases/workloads.kubeblocks.io_instancesets.yaml b/config/crd/bases/workloads.kubeblocks.io_instancesets.yaml index 3da51ffb9f8..ae1d65f7959 100644 --- a/config/crd/bases/workloads.kubeblocks.io_instancesets.yaml +++ b/config/crd/bases/workloads.kubeblocks.io_instancesets.yaml @@ -4174,85 +4174,6 @@ spec: format: int32 minimum: 0 type: integer - roleProbe: - description: Provides method to probe role. - properties: - customHandler: - description: |- - Defines a custom method for role probing. - Actions defined here are executed in series. - Upon completion of all actions, the final output should be a single string representing the role name defined in spec.Roles. - The latest [BusyBox](https://busybox.net/) image will be used if Image is not configured. - Environment variables can be used in Command: - - v_KB_ITS_LAST_STDOUT: stdout from the last action, watch for 'v_' prefix - - KB_ITS_USERNAME: username part of the credential - - KB_ITS_PASSWORD: password part of the credential - items: - properties: - args: - description: Additional parameters used to perform specific - statements. This field is optional. - items: - type: string - type: array - command: - description: A set of instructions that will be executed - within the Container to retrieve or process role information. - This field is required. - items: - type: string - type: array - image: - description: Refers to the utility image that contains the - command which can be utilized to retrieve or process role - information. - type: string - required: - - command - type: object - type: array - failureThreshold: - default: 3 - description: Specifies the minimum number of consecutive failures - for the probe to be considered failed after having succeeded. - format: int32 - minimum: 1 - type: integer - initialDelaySeconds: - default: 0 - description: Specifies the number of seconds to wait after the - container has started before initiating role probing. - format: int32 - minimum: 0 - type: integer - periodSeconds: - default: 2 - description: Specifies the frequency (in seconds) of probe execution. - format: int32 - minimum: 1 - type: integer - roleUpdateMechanism: - default: ReadinessProbeEventUpdate - description: Specifies the method for updating the pod role label. - enum: - - ReadinessProbeEventUpdate - - DirectAPIServerEventUpdate - type: string - successThreshold: - default: 1 - description: Specifies the minimum number of consecutive successes - for the probe to be considered successful after having failed. - format: int32 - minimum: 1 - type: integer - timeoutSeconds: - default: 1 - description: Specifies the number of seconds after which the probe - times out. - format: int32 - minimum: 1 - type: integer - type: object roles: description: A list of roles defined in the system. items: diff --git a/deploy/helm/crds/workloads.kubeblocks.io_instancesets.yaml b/deploy/helm/crds/workloads.kubeblocks.io_instancesets.yaml index 3da51ffb9f8..ae1d65f7959 100644 --- a/deploy/helm/crds/workloads.kubeblocks.io_instancesets.yaml +++ b/deploy/helm/crds/workloads.kubeblocks.io_instancesets.yaml @@ -4174,85 +4174,6 @@ spec: format: int32 minimum: 0 type: integer - roleProbe: - description: Provides method to probe role. - properties: - customHandler: - description: |- - Defines a custom method for role probing. - Actions defined here are executed in series. - Upon completion of all actions, the final output should be a single string representing the role name defined in spec.Roles. - The latest [BusyBox](https://busybox.net/) image will be used if Image is not configured. - Environment variables can be used in Command: - - v_KB_ITS_LAST_STDOUT: stdout from the last action, watch for 'v_' prefix - - KB_ITS_USERNAME: username part of the credential - - KB_ITS_PASSWORD: password part of the credential - items: - properties: - args: - description: Additional parameters used to perform specific - statements. This field is optional. - items: - type: string - type: array - command: - description: A set of instructions that will be executed - within the Container to retrieve or process role information. - This field is required. - items: - type: string - type: array - image: - description: Refers to the utility image that contains the - command which can be utilized to retrieve or process role - information. - type: string - required: - - command - type: object - type: array - failureThreshold: - default: 3 - description: Specifies the minimum number of consecutive failures - for the probe to be considered failed after having succeeded. - format: int32 - minimum: 1 - type: integer - initialDelaySeconds: - default: 0 - description: Specifies the number of seconds to wait after the - container has started before initiating role probing. - format: int32 - minimum: 0 - type: integer - periodSeconds: - default: 2 - description: Specifies the frequency (in seconds) of probe execution. - format: int32 - minimum: 1 - type: integer - roleUpdateMechanism: - default: ReadinessProbeEventUpdate - description: Specifies the method for updating the pod role label. - enum: - - ReadinessProbeEventUpdate - - DirectAPIServerEventUpdate - type: string - successThreshold: - default: 1 - description: Specifies the minimum number of consecutive successes - for the probe to be considered successful after having failed. - format: int32 - minimum: 1 - type: integer - timeoutSeconds: - default: 1 - description: Specifies the number of seconds after which the probe - times out. - format: int32 - minimum: 1 - type: integer - type: object roles: description: A list of roles defined in the system. items: From 4bd5d2c15e8d6ca327dd9e98e5c232d01ee01719 Mon Sep 17 00:00:00 2001 From: Harold Cheng Date: Wed, 4 Dec 2024 16:48:04 +0800 Subject: [PATCH 3/7] api doc --- docs/developer_docs/api-reference/cluster.md | 146 +------------------ 1 file changed, 1 insertion(+), 145 deletions(-) diff --git a/docs/developer_docs/api-reference/cluster.md b/docs/developer_docs/api-reference/cluster.md index 97782c92516..6d7d6f603f9 100644 --- a/docs/developer_docs/api-reference/cluster.md +++ b/docs/developer_docs/api-reference/cluster.md @@ -29005,20 +29005,6 @@ UpdateStrategy.Type will be set to appsv1.OnDeleteStatefulSetStrategyType if Mem -roleProbe
- - -RoleProbe - - - - -(Optional) -

Provides method to probe role.

- - - - membershipReconfiguration
@@ -29120,7 +29106,7 @@ InstanceSetStatus

Action

-(Appears on:MembershipReconfiguration, RoleProbe) +(Appears on:MembershipReconfiguration)

@@ -29536,20 +29522,6 @@ UpdateStrategy.Type will be set to appsv1.OnDeleteStatefulSetStrategyType if Mem -roleProbe
- - -RoleProbe - - - - -(Optional) -

Provides method to probe role.

- - - - membershipReconfiguration
@@ -30447,124 +30419,8 @@ bool -

RoleProbe -

-

-(Appears on:InstanceSetSpec) -

-
-

RoleProbe defines how to observe role

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-customHandler
- - -[]Action - - -
-(Optional) -

Defines a custom method for role probing. -Actions defined here are executed in series. -Upon completion of all actions, the final output should be a single string representing the role name defined in spec.Roles. -The latest BusyBox image will be used if Image is not configured. -Environment variables can be used in Command: -- v_KB_ITS_LASTSTDOUT: stdout from the last action, watch for ‘v’ prefix -- KB_ITS_USERNAME: username part of the credential -- KB_ITS_PASSWORD: password part of the credential

-
-initialDelaySeconds
- -int32 - -
-(Optional) -

Specifies the number of seconds to wait after the container has started before initiating role probing.

-
-timeoutSeconds
- -int32 - -
-(Optional) -

Specifies the number of seconds after which the probe times out.

-
-periodSeconds
- -int32 - -
-(Optional) -

Specifies the frequency (in seconds) of probe execution.

-
-successThreshold
- -int32 - -
-(Optional) -

Specifies the minimum number of consecutive successes for the probe to be considered successful after having failed.

-
-failureThreshold
- -int32 - -
-(Optional) -

Specifies the minimum number of consecutive failures for the probe to be considered failed after having succeeded.

-
-roleUpdateMechanism
- - -RoleUpdateMechanism - - -
-(Optional) -

Specifies the method for updating the pod role label.

-

RoleUpdateMechanism (string alias)

-

-(Appears on:RoleProbe) -

RoleUpdateMechanism defines the way how pod role label being updated.

From a375ff07044e0af8a3c5cb1e97b68926e0c85ab0 Mon Sep 17 00:00:00 2001 From: Harold Cheng Date: Wed, 4 Dec 2024 17:05:46 +0800 Subject: [PATCH 4/7] tidy up --- pkg/controller/instanceset/types.go | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/pkg/controller/instanceset/types.go b/pkg/controller/instanceset/types.go index 6cf388f2d34..45f7f8bb0b7 100644 --- a/pkg/controller/instanceset/types.go +++ b/pkg/controller/instanceset/types.go @@ -29,18 +29,6 @@ const ( LegacyRSMFinalizerName = "rsm.workloads.kubeblocks.io/finalizer" roleProbeContainerName = "kb-role-probe" - roleProbeBinaryName = "lorry" - roleAgentVolumeName = "role-agent" - roleAgentInstallerName = "role-agent-installer" - roleAgentVolumeMountPath = "/role-probe" - roleAgentName = "agent" - defaultRoleProbeDaemonPort = 7373 - defaultRoleProbeGRPCPort = 50101 - roleProbeDaemonPortName = "probe-port" - roleProbeGRPCPortName = "probe-grpc-port" - grpcHealthProbeBinaryPath = "/bin/grpc_health_probe" - grpcHealthProbeArgsFormat = "-addr=:%d" - defaultActionImage = "busybox:1.35" usernameCredentialVarName = "KB_RSM_USERNAME" passwordCredentialVarName = "KB_RSM_PASSWORD" servicePortVarName = "KB_RSM_SERVICE_PORT" @@ -48,10 +36,6 @@ const ( RoleUpdateMechanismVarName = "KB_RSM_ROLE_UPDATE_MECHANISM" roleProbeTimeoutVarName = "KB_RSM_ROLE_PROBE_TIMEOUT" readinessProbeEventFieldPath = "spec.containers{" + roleProbeContainerName + "}" - - actionSvcPortBase = int32( - 36500, - ) ) const ( From 07b51c7ef116d5928684e2f48fd8918762a7d761 Mon Sep 17 00:00:00 2001 From: Harold Cheng Date: Wed, 4 Dec 2024 17:30:09 +0800 Subject: [PATCH 5/7] tidy up --- pkg/controller/instanceset/object_builder.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/controller/instanceset/object_builder.go b/pkg/controller/instanceset/object_builder.go index 7317293ed86..cdab95d26fa 100644 --- a/pkg/controller/instanceset/object_builder.go +++ b/pkg/controller/instanceset/object_builder.go @@ -64,7 +64,6 @@ func getHeadlessSvcName(itsName string) string { func BuildPodTemplate(its *workloads.InstanceSet) *corev1.PodTemplateSpec { template := its.Spec.Template.DeepCopy() - // injectRoleProbeContainer(its, template) return template } From 546cc913e613d3377fa3079b7d72afa3707a0201 Mon Sep 17 00:00:00 2001 From: Harold Cheng Date: Thu, 5 Dec 2024 11:22:05 +0800 Subject: [PATCH 6/7] more deletion --- pkg/controller/instanceset/pod_role_event_handler.go | 2 +- .../instanceset/pod_role_event_handler_test.go | 2 +- pkg/controller/instanceset/types.go | 11 ----------- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/pkg/controller/instanceset/pod_role_event_handler.go b/pkg/controller/instanceset/pod_role_event_handler.go index 26eca264bb0..5857fdda8ff 100644 --- a/pkg/controller/instanceset/pod_role_event_handler.go +++ b/pkg/controller/instanceset/pod_role_event_handler.go @@ -74,7 +74,7 @@ func (h *PodRoleEventHandler) Handle(cli client.Client, reqCtx intctrlutil.Reque // HACK: to support kb-agent probe event event = h.transformKBAgentProbeEvent(reqCtx.Log, event) - filePaths := []string{readinessProbeEventFieldPath, legacyEventFieldPath, lorryEventFieldPath} + filePaths := []string{legacyEventFieldPath, lorryEventFieldPath} if !slices.Contains(filePaths, event.InvolvedObject.FieldPath) || event.Reason != checkRoleOperation { return nil } diff --git a/pkg/controller/instanceset/pod_role_event_handler_test.go b/pkg/controller/instanceset/pod_role_event_handler_test.go index eb94949c9b8..2434be999b3 100644 --- a/pkg/controller/instanceset/pod_role_event_handler_test.go +++ b/pkg/controller/instanceset/pod_role_event_handler_test.go @@ -52,7 +52,7 @@ var _ = Describe("pod role label event handler test", func() { Namespace: pod.Namespace, Name: pod.Name, UID: pod.UID, - FieldPath: readinessProbeEventFieldPath, + FieldPath: lorryEventFieldPath, } role := workloads.ReplicaRole{ Name: "leader", diff --git a/pkg/controller/instanceset/types.go b/pkg/controller/instanceset/types.go index 45f7f8bb0b7..248474ff986 100644 --- a/pkg/controller/instanceset/types.go +++ b/pkg/controller/instanceset/types.go @@ -25,17 +25,6 @@ const ( RoleLabelKey = "kubeblocks.io/role" AccessModeLabelKey = "workloads.kubeblocks.io/access-mode" - - LegacyRSMFinalizerName = "rsm.workloads.kubeblocks.io/finalizer" - - roleProbeContainerName = "kb-role-probe" - usernameCredentialVarName = "KB_RSM_USERNAME" - passwordCredentialVarName = "KB_RSM_PASSWORD" - servicePortVarName = "KB_RSM_SERVICE_PORT" - actionSvcListVarName = "KB_RSM_ACTION_SVC_LIST" - RoleUpdateMechanismVarName = "KB_RSM_ROLE_UPDATE_MECHANISM" - roleProbeTimeoutVarName = "KB_RSM_ROLE_PROBE_TIMEOUT" - readinessProbeEventFieldPath = "spec.containers{" + roleProbeContainerName + "}" ) const ( From 3b8fbbcd44710a24681b641cf7ca6b30eec2bad2 Mon Sep 17 00:00:00 2001 From: Harold Cheng Date: Tue, 10 Dec 2024 11:30:35 +0800 Subject: [PATCH 7/7] review comments --- pkg/controller/instanceset/instance_util.go | 2 +- pkg/controller/instanceset/instance_util_test.go | 6 +++--- pkg/controller/instanceset/object_builder.go | 6 ------ pkg/controller/instanceset/pod_role_event_handler.go | 9 +++++---- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/pkg/controller/instanceset/instance_util.go b/pkg/controller/instanceset/instance_util.go index abf7bc5ffb7..750da4ab900 100644 --- a/pkg/controller/instanceset/instance_util.go +++ b/pkg/controller/instanceset/instance_util.go @@ -786,7 +786,7 @@ func BuildInstanceTemplateRevision(template *corev1.PodTemplateSpec, parent *wor } func buildInstanceTemplateExts(itsExt *instanceSetExt) []*instanceTemplateExt { - defaultTemplate := BuildPodTemplate(itsExt.its) + defaultTemplate := itsExt.its.Spec.Template.DeepCopy() makeInstanceTemplateExt := func(templateName string) *instanceTemplateExt { var claims []corev1.PersistentVolumeClaim for _, template := range itsExt.its.Spec.VolumeClaimTemplates { diff --git a/pkg/controller/instanceset/instance_util_test.go b/pkg/controller/instanceset/instance_util_test.go index 7b6f7a4377d..e7fea0a6574 100644 --- a/pkg/controller/instanceset/instance_util_test.go +++ b/pkg/controller/instanceset/instance_util_test.go @@ -130,7 +130,7 @@ var _ = Describe("instance util test", func() { Expect(nameTemplate).Should(HaveKey(its.Name + "-1")) Expect(nameTemplate).Should(HaveKey(its.Name + "-2")) nameTemplate[name0].PodTemplateSpec.Spec.Volumes = nil - defaultTemplate := BuildPodTemplate(its) + defaultTemplate := its.Spec.Template.DeepCopy() Expect(nameTemplate[name0].PodTemplateSpec.Spec).Should(Equal(defaultTemplate.Spec)) }) @@ -167,7 +167,7 @@ var _ = Describe("instance util test", func() { Expect(nameTemplate).Should(HaveKey(name0)) Expect(nameTemplate).Should(HaveKey(name1)) Expect(nameTemplate).Should(HaveKey(nameOverride0)) - expectedTemplate := BuildPodTemplate(its) + expectedTemplate := its.Spec.Template.DeepCopy() Expect(nameTemplate[name0].PodTemplateSpec.Spec).Should(Equal(expectedTemplate.Spec)) Expect(nameTemplate[name1].PodTemplateSpec.Spec).Should(Equal(expectedTemplate.Spec)) Expect(nameTemplate[nameOverride0].PodTemplateSpec.Spec).ShouldNot(Equal(expectedTemplate.Spec)) @@ -198,7 +198,7 @@ var _ = Describe("instance util test", func() { Expect(instance.pod.Namespace).Should(Equal(its.Namespace)) Expect(instance.pod.Spec.Volumes).Should(HaveLen(1)) Expect(instance.pod.Spec.Volumes[0].Name).Should(Equal(volumeClaimTemplates[0].Name)) - expectedTemplate := BuildPodTemplate(its) + expectedTemplate := its.Spec.Template.DeepCopy() Expect(instance.pod.Spec).ShouldNot(Equal(expectedTemplate.Spec)) // reset pod.volumes, pod.hostname and pod.subdomain instance.pod.Spec.Volumes = nil diff --git a/pkg/controller/instanceset/object_builder.go b/pkg/controller/instanceset/object_builder.go index cdab95d26fa..45bb841b13e 100644 --- a/pkg/controller/instanceset/object_builder.go +++ b/pkg/controller/instanceset/object_builder.go @@ -61,9 +61,3 @@ func buildHeadlessSvc(its workloads.InstanceSet, labels, selectors map[string]st func getHeadlessSvcName(itsName string) string { return strings.Join([]string{itsName, "headless"}, "-") } - -func BuildPodTemplate(its *workloads.InstanceSet) *corev1.PodTemplateSpec { - template := its.Spec.Template.DeepCopy() - - return template -} diff --git a/pkg/controller/instanceset/pod_role_event_handler.go b/pkg/controller/instanceset/pod_role_event_handler.go index 5857fdda8ff..3c3808a2f66 100644 --- a/pkg/controller/instanceset/pod_role_event_handler.go +++ b/pkg/controller/instanceset/pod_role_event_handler.go @@ -63,9 +63,10 @@ const ( roleChangedAnnotKey = "role.kubeblocks.io/event-handled" // TODO(v1.0): remove this later. - checkRoleOperation = "checkRole" - legacyEventFieldPath = "spec.containers{kb-checkrole}" - lorryEventFieldPath = "spec.containers{lorry}" + checkRoleOperation = "checkRole" + lagacyReadinessProbeEventFieldPath = "spec.containers{kb-role-probe}" + legacyEventFieldPath = "spec.containers{kb-checkrole}" + lorryEventFieldPath = "spec.containers{lorry}" ) var roleMessageRegex = regexp.MustCompile(`Readiness probe failed: .*({.*})`) @@ -74,7 +75,7 @@ func (h *PodRoleEventHandler) Handle(cli client.Client, reqCtx intctrlutil.Reque // HACK: to support kb-agent probe event event = h.transformKBAgentProbeEvent(reqCtx.Log, event) - filePaths := []string{legacyEventFieldPath, lorryEventFieldPath} + filePaths := []string{lagacyReadinessProbeEventFieldPath, legacyEventFieldPath, lorryEventFieldPath} if !slices.Contains(filePaths, event.InvolvedObject.FieldPath) || event.Reason != checkRoleOperation { return nil }