mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-02 06:16:08 -04: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
|
@ -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