Skip to content

Commit f74ee2d

Browse files
committed
refactor: rm hardcoded values and unecessary fields
1 parent 9689c67 commit f74ee2d

File tree

1 file changed

+1
-24
lines changed

1 file changed

+1
-24
lines changed

internal/providers/k3sintel.go

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,14 @@ import (
88
"encoding/json"
99
"fmt"
1010

11-
corev1 "k8s.io/api/core/v1"
1211
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1312
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
1413
"k8s.io/apimachinery/pkg/types"
1514
capiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1"
1615
"sigs.k8s.io/controller-runtime/pkg/client"
1716

18-
kthreesbootstrapv1beta2 "github.com/k3s-io/cluster-api-k3s/bootstrap/api/v1beta2"
19-
kthreescpv1beta2 "github.com/k3s-io/cluster-api-k3s/controlplane/api/v1beta2"
2017
intelv1alpha1 "github.com/open-edge-platform/cluster-api-provider-intel/api/v1alpha1"
18+
kthreescpv1beta2 "github.com/k3s-io/cluster-api-k3s/controlplane/api/v1beta2"
2119
apierrors "k8s.io/apimachinery/pkg/api/errors"
2220
)
2321

@@ -103,27 +101,6 @@ func (k3sintel) CreateControlPlaneTemplate(ctx context.Context, c client.Client,
103101
Namespace: name.Namespace,
104102
}
105103

106-
cpt.Spec.Template.Spec.KThreesConfigSpec = kthreesbootstrapv1beta2.KThreesConfigSpec{
107-
Files: []kthreesbootstrapv1beta2.File{
108-
{},
109-
},
110-
Version: "v1.32.4+k3s1", // TODO: make configurable from the template
111-
ServerConfig: kthreesbootstrapv1beta2.KThreesServerConfig{ // TODO: make configurable from the template
112-
TLSSan: []string{"0.0.0.0"},
113-
ClusterDomain: "cluster.edge",
114-
DisableCloudController: func(b bool) *bool { return &b }(false),
115-
},
116-
}
117-
118-
cpt.Spec.Template.Spec.MachineTemplate = kthreescpv1beta2.KThreesControlPlaneMachineTemplate{
119-
InfrastructureRef: corev1.ObjectReference{
120-
APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1",
121-
Kind: "IntelMachineTemplate",
122-
Name: fmt.Sprintf("%s-controlplane", name.Name),
123-
Namespace: name.Namespace,
124-
},
125-
}
126-
127104
if err := c.Create(ctx, &cpt); err != nil {
128105
if apierrors.IsAlreadyExists(err) {
129106
return nil

0 commit comments

Comments
 (0)