mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-11-13 00:50:38 -05:00
Remove all traces of CoreOS from the codebase
This commit is contained in:
parent
35e2267cf9
commit
743f5fa627
39 changed files with 117 additions and 799 deletions
|
|
@ -109,7 +109,7 @@ func main() {
|
|||
log.With(zap.Error(err)).Fatalf("Failed to create cloud controller manager")
|
||||
}
|
||||
clusterInitJoiner = kubernetes.New(
|
||||
"gcp", k8sapi.NewKubernetesUtil(), &k8sapi.CoreOSConfiguration{}, kubectl.New(), cloudControllerManager,
|
||||
"gcp", k8sapi.NewKubernetesUtil(), &k8sapi.KubdeadmConfiguration{}, kubectl.New(), cloudControllerManager,
|
||||
&gcpcloud.CloudNodeManager{}, &gcpcloud.Autoscaler{}, metadata, pcrsJSON, helmClient,
|
||||
)
|
||||
openTPM = vtpm.OpenVTPM
|
||||
|
|
@ -142,7 +142,7 @@ func main() {
|
|||
log.With(zap.Error(err)).Fatalf("Failed to marshal PCRs")
|
||||
}
|
||||
clusterInitJoiner = kubernetes.New(
|
||||
"azure", k8sapi.NewKubernetesUtil(), &k8sapi.CoreOSConfiguration{}, kubectl.New(), azurecloud.NewCloudControllerManager(metadata),
|
||||
"azure", k8sapi.NewKubernetesUtil(), &k8sapi.KubdeadmConfiguration{}, kubectl.New(), azurecloud.NewCloudControllerManager(metadata),
|
||||
&azurecloud.CloudNodeManager{}, &azurecloud.Autoscaler{}, metadata, pcrsJSON, helmClient,
|
||||
)
|
||||
|
||||
|
|
@ -163,7 +163,7 @@ func main() {
|
|||
log.With(zap.Error(err)).Fatalf("Failed to marshal PCRs")
|
||||
}
|
||||
clusterInitJoiner = kubernetes.New(
|
||||
"qemu", k8sapi.NewKubernetesUtil(), &k8sapi.CoreOSConfiguration{}, kubectl.New(), &qemucloud.CloudControllerManager{},
|
||||
"qemu", k8sapi.NewKubernetesUtil(), &k8sapi.KubdeadmConfiguration{}, kubectl.New(), &qemucloud.CloudControllerManager{},
|
||||
&qemucloud.CloudNodeManager{}, &qemucloud.Autoscaler{}, metadata, pcrsJSON, helmClient,
|
||||
)
|
||||
metadataAPI = metadata
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ type Client struct {
|
|||
// New creates a new client with the given logger.
|
||||
func New(log *logger.Logger) (*Client, error) {
|
||||
settings := cli.New()
|
||||
settings.KubeConfig = constants.CoreOSAdminConfFilename
|
||||
settings.KubeConfig = constants.ControlPlaneAdminConfFilename
|
||||
|
||||
actionConfig := &action.Configuration{}
|
||||
if err := actionConfig.Init(settings.RESTClientGetter(), constants.HelmNamespace,
|
||||
|
|
@ -83,7 +83,7 @@ func (h *Client) installCiliumAzure(ctx context.Context, release helm.Release, k
|
|||
}
|
||||
|
||||
func (h *Client) installlCiliumGCP(ctx context.Context, kubectl k8sapi.Client, release helm.Release, nodeName, nodePodCIDR, subnetworkPodCIDR, kubeAPIEndpoint string) error {
|
||||
out, err := exec.CommandContext(ctx, constants.KubectlPath, "--kubeconfig", constants.CoreOSAdminConfFilename, "patch", "node", nodeName, "-p", "{\"spec\":{\"podCIDR\": \""+nodePodCIDR+"\"}}").CombinedOutput()
|
||||
out, err := exec.CommandContext(ctx, constants.KubectlPath, "--kubeconfig", constants.ControlPlaneAdminConfFilename, "patch", "node", nodeName, "-p", "{\"spec\":{\"podCIDR\": \""+nodePodCIDR+"\"}}").CombinedOutput()
|
||||
if err != nil {
|
||||
err = errors.New(string(out))
|
||||
return err
|
||||
|
|
|
|||
|
|
@ -29,9 +29,9 @@ const (
|
|||
auditPolicyPath = "/etc/kubernetes/audit-policy.yaml"
|
||||
)
|
||||
|
||||
type CoreOSConfiguration struct{}
|
||||
type KubdeadmConfiguration struct{}
|
||||
|
||||
func (c *CoreOSConfiguration) InitConfiguration(externalCloudProvider bool, k8sVersion versions.ValidK8sVersion) KubeadmInitYAML {
|
||||
func (c *KubdeadmConfiguration) InitConfiguration(externalCloudProvider bool, k8sVersion versions.ValidK8sVersion) KubeadmInitYAML {
|
||||
var cloudProvider string
|
||||
if externalCloudProvider {
|
||||
cloudProvider = "external"
|
||||
|
|
@ -171,7 +171,7 @@ func (c *CoreOSConfiguration) InitConfiguration(externalCloudProvider bool, k8sV
|
|||
}
|
||||
}
|
||||
|
||||
func (c *CoreOSConfiguration) JoinConfiguration(externalCloudProvider bool) KubeadmJoinYAML {
|
||||
func (c *KubdeadmConfiguration) JoinConfiguration(externalCloudProvider bool) KubeadmJoinYAML {
|
||||
var cloudProvider string
|
||||
if externalCloudProvider {
|
||||
cloudProvider = "external"
|
||||
|
|
|
|||
|
|
@ -22,17 +22,17 @@ func TestMain(m *testing.M) {
|
|||
}
|
||||
|
||||
func TestInitConfiguration(t *testing.T) {
|
||||
coreOSConfig := CoreOSConfiguration{}
|
||||
kubeadmConfig := KubdeadmConfiguration{}
|
||||
|
||||
testCases := map[string]struct {
|
||||
config KubeadmInitYAML
|
||||
}{
|
||||
"CoreOS init config can be created": {
|
||||
config: coreOSConfig.InitConfiguration(true, versions.Default),
|
||||
"kubeadm init config can be created": {
|
||||
config: kubeadmConfig.InitConfiguration(true, versions.Default),
|
||||
},
|
||||
"CoreOS init config with all fields can be created": {
|
||||
"kubeadm init config with all fields can be created": {
|
||||
config: func() KubeadmInitYAML {
|
||||
c := coreOSConfig.InitConfiguration(true, versions.Default)
|
||||
c := kubeadmConfig.InitConfiguration(true, versions.Default)
|
||||
c.SetAPIServerAdvertiseAddress("192.0.2.0")
|
||||
c.SetNodeIP("192.0.2.0")
|
||||
c.SetNodeName("node")
|
||||
|
|
@ -60,7 +60,7 @@ func TestInitConfiguration(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestInitConfigurationKubeadmCompatibility(t *testing.T) {
|
||||
coreOSConfig := CoreOSConfiguration{}
|
||||
kubeadmConfig := KubdeadmConfiguration{}
|
||||
|
||||
testCases := map[string]struct {
|
||||
config KubeadmInitYAML
|
||||
|
|
@ -68,11 +68,11 @@ func TestInitConfigurationKubeadmCompatibility(t *testing.T) {
|
|||
wantErr bool
|
||||
}{
|
||||
"Kubeadm accepts version 'Latest'": {
|
||||
config: coreOSConfig.InitConfiguration(true, versions.Default),
|
||||
config: kubeadmConfig.InitConfiguration(true, versions.Default),
|
||||
expectedVersion: fmt.Sprintf("v%s", versions.VersionConfigs[versions.Default].PatchVersion),
|
||||
},
|
||||
"Kubeadm receives incompatible version": {
|
||||
config: coreOSConfig.InitConfiguration(true, "1.19"),
|
||||
config: kubeadmConfig.InitConfiguration(true, "1.19"),
|
||||
wantErr: true,
|
||||
},
|
||||
}
|
||||
|
|
@ -92,17 +92,17 @@ func TestInitConfigurationKubeadmCompatibility(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestJoinConfiguration(t *testing.T) {
|
||||
coreOSConfig := CoreOSConfiguration{}
|
||||
kubdeadmConfig := KubdeadmConfiguration{}
|
||||
|
||||
testCases := map[string]struct {
|
||||
config KubeadmJoinYAML
|
||||
}{
|
||||
"CoreOS join config can be created": {
|
||||
config: coreOSConfig.JoinConfiguration(true),
|
||||
"kubeadm join config can be created": {
|
||||
config: kubdeadmConfig.JoinConfiguration(true),
|
||||
},
|
||||
"CoreOS join config with all fields can be created": {
|
||||
"kubeadm join config with all fields can be created": {
|
||||
config: func() KubeadmJoinYAML {
|
||||
c := coreOSConfig.JoinConfiguration(true)
|
||||
c := kubdeadmConfig.JoinConfiguration(true)
|
||||
c.SetAPIServerEndpoint("192.0.2.0:6443")
|
||||
c.SetNodeIP("192.0.2.0")
|
||||
c.SetNodeName("node")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue