Skip to content

Commit 351b9a6

Browse files
author
Lis
authored
fix(platform): set container runtime as required (#1553)
1 parent 019b4eb commit 351b9a6

File tree

8 files changed

+16
-4
lines changed

8 files changed

+16
-4
lines changed

api/openapi/zz_generated.openapi.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/platform/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ type ClusterFeature struct {
394394
EnableMetricsServer bool
395395
// +optional
396396
EnableCilium bool
397-
// +optional
397+
398398
ContainerRuntime ContainerRuntimeType
399399
// +optional
400400
IPv6DualStack bool

api/platform/v1/defaults.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,9 @@ func SetDefaults_LBCFStatus(obj *LBCFStatus) {
126126
obj.Phase = AddonPhaseInitializing
127127
}
128128
}
129+
130+
func SetDefaults_ClusterFeature(obj *ClusterFeature) {
131+
if obj.ContainerRuntime == "" {
132+
obj.ContainerRuntime = Docker
133+
}
134+
}

api/platform/v1/generated.proto

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/platform/v1/types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,8 @@ type ClusterFeature struct {
402402
IPv6DualStack bool `json:"ipv6DualStack,omitempty" protobuf:"bytes,13,opt,name=ipv6DualStack"`
403403
// +optional
404404
EnableCilium bool `json:"enableCilium,omitempty" protobuf:"bytes,14,opt,name=enableCilium"`
405-
// +optional
406-
ContainerRuntime ContainerRuntimeType `json:"containerRuntime,omitempty" protobuf:"bytes,15,opt,name=containerRuntime"`
405+
406+
ContainerRuntime ContainerRuntimeType `json:"containerRuntime" protobuf:"bytes,15,opt,name=containerRuntime"`
407407
// Upgrade control upgrade process.
408408
// +optional
409409
Upgrade Upgrade `json:"upgrade,omitempty" protobuf:"bytes,22,opt,name=upgrade"`

api/platform/v1/zz_generated.defaults.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/tke-installer/app/installer/installer.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,6 +1188,10 @@ func (t *TKE) createGlobalCluster(ctx context.Context) error {
11881188
}
11891189
t.completeWithProvider()
11901190

1191+
if len(t.Cluster.Spec.Features.ContainerRuntime) == 0 {
1192+
t.Cluster.Spec.Features.ContainerRuntime = platformv1.Containerd
1193+
}
1194+
11911195
if t.Cluster.Spec.ClusterCredentialRef == nil {
11921196
credential := &platformv1.ClusterCredential{
11931197
ObjectMeta: metav1.ObjectMeta{

test/tke/tke.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ func (testTke *TestTKE) ClusterTemplate(nodes ...cloudprovider.Instance) *platfo
6666
Features: platformv1.ClusterFeature{
6767
HA: &platformv1.HA{},
6868
EnableMasterSchedule: true,
69+
ContainerRuntime: platformv1.Containerd,
6970
},
7071
Version: env.K8sVersion(),
7172
ClusterCIDR: "10.244.0.0/16",

0 commit comments

Comments
 (0)