Skip to content

Commit 36f072d

Browse files
committed
fix: new clusterrole not created
1 parent 476e036 commit 36f072d

File tree

8 files changed

+12
-19
lines changed

8 files changed

+12
-19
lines changed

apis/apps/v1/cluster_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ type ClusterComponentSpec struct {
439439
// it will also be bound to a default cluster role named
440440
// "kubeblocks-cluster-pod-role", which is installed together with KubeBlocks.
441441
//
442-
// Before KubeBlocks 1.0.2, the automatically created serviceaccount is named "kb-{componentdefinition.name}".
442+
// Before KubeBlocks 1.1, the automatically created serviceaccount is named "kb-{componentdefinition.name}".
443443
// To reduce unintended pod restart, old pods still use old serviceaccount. New serviceaccount will be used
444444
// when a workload has been restarted.
445445
//

apis/apps/v1/component_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ type ComponentSpec struct {
202202
// it will also be bound to a default cluster role named
203203
// "kubeblocks-cluster-pod-role", which is installed together with KubeBlocks.
204204
//
205-
// Before KubeBlocks 1.0.2, the automatically created serviceaccount is named "kb-{componentdefinition.name}".
205+
// Before KubeBlocks 1.1, the automatically created serviceaccount is named "kb-{componentdefinition.name}".
206206
// To reduce unintended pod restart, old pods still use old serviceaccount. New serviceaccount will be used
207207
// when a workload has been restarted.
208208
//

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4178,7 +4178,7 @@ spec:
41784178
"kubeblocks-cluster-pod-role", which is installed together with KubeBlocks.
41794179

41804180

4181-
Before KubeBlocks 1.0.2, the automatically created serviceaccount is named "kb-{componentdefinition.name}".
4181+
Before KubeBlocks 1.1, the automatically created serviceaccount is named "kb-{componentdefinition.name}".
41824182
To reduce unintended pod restart, old pods still use old serviceaccount. New serviceaccount will be used
41834183
when a workload has been restarted.
41844184

@@ -15569,7 +15569,7 @@ spec:
1556915569
"kubeblocks-cluster-pod-role", which is installed together with KubeBlocks.
1557015570

1557115571

15572-
Before KubeBlocks 1.0.2, the automatically created serviceaccount is named "kb-{componentdefinition.name}".
15572+
Before KubeBlocks 1.1, the automatically created serviceaccount is named "kb-{componentdefinition.name}".
1557315573
To reduce unintended pod restart, old pods still use old serviceaccount. New serviceaccount will be used
1557415574
when a workload has been restarted.
1557515575

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4404,7 +4404,7 @@ spec:
44044404
"kubeblocks-cluster-pod-role", which is installed together with KubeBlocks.
44054405

44064406

4407-
Before KubeBlocks 1.0.2, the automatically created serviceaccount is named "kb-{componentdefinition.name}".
4407+
Before KubeBlocks 1.1, the automatically created serviceaccount is named "kb-{componentdefinition.name}".
44084408
To reduce unintended pod restart, old pods still use old serviceaccount. New serviceaccount will be used
44094409
when a workload has been restarted.
44104410

controllers/apps/componentdefinition_controller.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,10 @@ func (r *ComponentDefinitionReconciler) Reconcile(ctx context.Context, req ctrl.
7575
rctx := intctrlutil.RequestCtx{
7676
Ctx: ctx,
7777
Req: req,
78-
Log: log.FromContext(ctx).WithValues("component", req.NamespacedName),
78+
Log: log.FromContext(ctx).WithValues("componentdefinition", req.NamespacedName),
7979
Recorder: r.Recorder,
8080
}
8181

82-
rctx.Log.V(1).Info("reconcile", "component", req.NamespacedName)
83-
8482
cmpd := &appsv1.ComponentDefinition{}
8583
if err := r.Client.Get(rctx.Ctx, rctx.Req.NamespacedName, cmpd); err != nil {
8684
return intctrlutil.CheckedRequeueWithError(err, rctx.Log, "")
@@ -112,11 +110,6 @@ func (r *ComponentDefinitionReconciler) reconcile(rctx intctrlutil.RequestCtx,
112110
return *res, err
113111
}
114112

115-
if cmpd.Status.ObservedGeneration == cmpd.Generation &&
116-
slices.Contains([]appsv1.Phase{appsv1.AvailablePhase}, cmpd.Status.Phase) {
117-
return intctrlutil.Reconciled()
118-
}
119-
120113
if err = r.validate(r.Client, rctx, cmpd); err != nil {
121114
if err1 := r.unavailable(r.Client, rctx, cmpd, err); err1 != nil {
122115
return intctrlutil.CheckedRequeueWithError(err1, rctx.Log, "")

deploy/helm/crds/apps.kubeblocks.io_clusters.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4178,7 +4178,7 @@ spec:
41784178
"kubeblocks-cluster-pod-role", which is installed together with KubeBlocks.
41794179

41804180

4181-
Before KubeBlocks 1.0.2, the automatically created serviceaccount is named "kb-{componentdefinition.name}".
4181+
Before KubeBlocks 1.1, the automatically created serviceaccount is named "kb-{componentdefinition.name}".
41824182
To reduce unintended pod restart, old pods still use old serviceaccount. New serviceaccount will be used
41834183
when a workload has been restarted.
41844184

@@ -15569,7 +15569,7 @@ spec:
1556915569
"kubeblocks-cluster-pod-role", which is installed together with KubeBlocks.
1557015570

1557115571

15572-
Before KubeBlocks 1.0.2, the automatically created serviceaccount is named "kb-{componentdefinition.name}".
15572+
Before KubeBlocks 1.1, the automatically created serviceaccount is named "kb-{componentdefinition.name}".
1557315573
To reduce unintended pod restart, old pods still use old serviceaccount. New serviceaccount will be used
1557415574
when a workload has been restarted.
1557515575

deploy/helm/crds/apps.kubeblocks.io_components.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4404,7 +4404,7 @@ spec:
44044404
"kubeblocks-cluster-pod-role", which is installed together with KubeBlocks.
44054405

44064406

4407-
Before KubeBlocks 1.0.2, the automatically created serviceaccount is named "kb-{componentdefinition.name}".
4407+
Before KubeBlocks 1.1, the automatically created serviceaccount is named "kb-{componentdefinition.name}".
44084408
To reduce unintended pod restart, old pods still use old serviceaccount. New serviceaccount will be used
44094409
when a workload has been restarted.
44104410

docs/developer_docs/api-reference/cluster.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ with other Kubernetes resources, such as modifying Pod labels or sending events.
720720
<code>policyRules</code> field. If needed (currently this means if any lifecycleAction is enabled),
721721
it will also be bound to a default cluster role named
722722
&ldquo;kubeblocks-cluster-pod-role&rdquo;, which is installed together with KubeBlocks.</p>
723-
<p>Before KubeBlocks 1.0.2, the automatically created serviceaccount is named &ldquo;kb-&#123;componentdefinition.name&#125;&rdquo;.
723+
<p>Before KubeBlocks 1.1, the automatically created serviceaccount is named &ldquo;kb-&#123;componentdefinition.name&#125;&rdquo;.
724724
To reduce unintended pod restart, old pods still use old serviceaccount. New serviceaccount will be used
725725
when a workload has been restarted.</p>
726726
<p>If the field is not empty, the specified ServiceAccount will be used, and KubeBlocks will not
@@ -3362,7 +3362,7 @@ with other Kubernetes resources, such as modifying Pod labels or sending events.
33623362
<code>policyRules</code> field. If needed (currently this means if any lifecycleAction is enabled),
33633363
it will also be bound to a default cluster role named
33643364
&ldquo;kubeblocks-cluster-pod-role&rdquo;, which is installed together with KubeBlocks.</p>
3365-
<p>Before KubeBlocks 1.0.2, the automatically created serviceaccount is named &ldquo;kb-&#123;componentdefinition.name&#125;&rdquo;.
3365+
<p>Before KubeBlocks 1.1, the automatically created serviceaccount is named &ldquo;kb-&#123;componentdefinition.name&#125;&rdquo;.
33663366
To reduce unintended pod restart, old pods still use old serviceaccount. New serviceaccount will be used
33673367
when a workload has been restarted.</p>
33683368
<p>If the field is not empty, the specified ServiceAccount will be used, and KubeBlocks will not
@@ -6812,7 +6812,7 @@ with other Kubernetes resources, such as modifying Pod labels or sending events.
68126812
<code>policyRules</code> field. If needed (currently this means if any lifecycleAction is enabled),
68136813
it will also be bound to a default cluster role named
68146814
&ldquo;kubeblocks-cluster-pod-role&rdquo;, which is installed together with KubeBlocks.</p>
6815-
<p>Before KubeBlocks 1.0.2, the automatically created serviceaccount is named &ldquo;kb-&#123;componentdefinition.name&#125;&rdquo;.
6815+
<p>Before KubeBlocks 1.1, the automatically created serviceaccount is named &ldquo;kb-&#123;componentdefinition.name&#125;&rdquo;.
68166816
To reduce unintended pod restart, old pods still use old serviceaccount. New serviceaccount will be used
68176817
when a workload has been restarted.</p>
68186818
<p>If the field is not empty, the specified ServiceAccount will be used, and KubeBlocks will not

0 commit comments

Comments
 (0)