From 6a9aa07ba81f41af567952a93e7cff57aaa73fc4 Mon Sep 17 00:00:00 2001 From: killianmuldoon Date: Thu, 31 Aug 2023 10:37:03 +0100 Subject: [PATCH] Remove Kubeadm upstream v1beta1 types Signed-off-by: killianmuldoon --- Makefile | 3 +- .../kubeadm/api/v1alpha4/conversion_test.go | 15 - .../upstreamv1beta1/bootstraptokenstring.go | 89 -- .../bootstraptokenstring_test.go | 223 ----- .../types/upstreamv1beta1/conversion.go | 97 --- .../types/upstreamv1beta1/conversion_test.go | 120 --- .../kubeadm/types/upstreamv1beta1/doc.go | 24 - .../upstreamv1beta1/groupversion_info.go | 35 - .../kubeadm/types/upstreamv1beta1/types.go | 426 --------- .../zz_generated.conversion.go | 811 ------------------ .../upstreamv1beta1/zz_generated.deepcopy.go | 530 ------------ bootstrap/kubeadm/types/utils.go | 11 +- bootstrap/kubeadm/types/utils_test.go | 124 +-- .../kubeadm/api/v1alpha4/conversion_test.go | 16 - .../kubeadm/internal/workload_cluster_test.go | 52 +- .../provisioning/cloudinit/adapter_test.go | 8 +- .../provisioning/cloudinit/writefiles_test.go | 16 +- 17 files changed, 23 insertions(+), 2577 deletions(-) delete mode 100644 bootstrap/kubeadm/types/upstreamv1beta1/bootstraptokenstring.go delete mode 100644 bootstrap/kubeadm/types/upstreamv1beta1/bootstraptokenstring_test.go delete mode 100644 bootstrap/kubeadm/types/upstreamv1beta1/conversion.go delete mode 100644 bootstrap/kubeadm/types/upstreamv1beta1/conversion_test.go delete mode 100644 bootstrap/kubeadm/types/upstreamv1beta1/doc.go delete mode 100644 bootstrap/kubeadm/types/upstreamv1beta1/groupversion_info.go delete mode 100644 bootstrap/kubeadm/types/upstreamv1beta1/types.go delete mode 100644 bootstrap/kubeadm/types/upstreamv1beta1/zz_generated.conversion.go delete mode 100644 bootstrap/kubeadm/types/upstreamv1beta1/zz_generated.deepcopy.go diff --git a/Makefile b/Makefile index 2e992e511af3..91a840c75955 100644 --- a/Makefile +++ b/Makefile @@ -447,9 +447,8 @@ generate-go-conversions-kubeadm-bootstrap: $(CONVERSION_GEN) ## Generate convers --extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1alpha4 \ --output-file-base=zz_generated.conversion $(CONVERSION_GEN_OUTPUT_BASE) \ --go-header-file=./hack/boilerplate/boilerplate.generatego.txt - $(MAKE) clean-generated-conversions SRC_DIRS="./bootstrap/kubeadm/types/upstreamv1beta1,./bootstrap/kubeadm/types/upstreamv1beta2,./bootstrap/kubeadm/types/upstreamv1beta3" + $(MAKE) clean-generated-conversions SRC_DIRS="./bootstrap/kubeadm/types/upstreamv1beta2,./bootstrap/kubeadm/types/upstreamv1beta3" $(CONVERSION_GEN) \ - --input-dirs=./bootstrap/kubeadm/types/upstreamv1beta1 \ --input-dirs=./bootstrap/kubeadm/types/upstreamv1beta2 \ --input-dirs=./bootstrap/kubeadm/types/upstreamv1beta3 \ --build-tag=ignore_autogenerated_kubeadm_types \ diff --git a/bootstrap/kubeadm/api/v1alpha4/conversion_test.go b/bootstrap/kubeadm/api/v1alpha4/conversion_test.go index fbfc48564ac7..be6a5a20a9ab 100644 --- a/bootstrap/kubeadm/api/v1alpha4/conversion_test.go +++ b/bootstrap/kubeadm/api/v1alpha4/conversion_test.go @@ -24,7 +24,6 @@ import ( runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" - "sigs.k8s.io/cluster-api/bootstrap/kubeadm/types/upstreamv1beta1" utilconversion "sigs.k8s.io/cluster-api/util/conversion" ) @@ -48,7 +47,6 @@ func TestFuzzyConversion(t *testing.T) { func fuzzFuncs(_ runtimeserializer.CodecFactory) []interface{} { return []interface{}{ - clusterConfigurationFuzzer, // This custom functions are needed when ConvertTo/ConvertFrom functions // uses the json package to unmarshal the bootstrap token string. // @@ -59,24 +57,11 @@ func fuzzFuncs(_ runtimeserializer.CodecFactory) []interface{} { // // This function effectively disables any fuzzing for the token by setting // the values for ID and Secret to working alphanumeric values. - kubeadmBootstrapTokenStringFuzzerV1UpstreamBeta1, kubeadmBootstrapTokenStringFuzzerV1Beta1, kubeadmBootstrapTokenStringFuzzerV1Alpha4, } } -func clusterConfigurationFuzzer(obj *upstreamv1beta1.ClusterConfiguration, c fuzz.Continue) { - c.FuzzNoCustom(obj) - - // ClusterConfiguration.UseHyperKubeImage has been removed in v1alpha4, so setting it to false in order to avoid v1beta1 --> v1alpha4 --> v1beta1 round trip errors. - obj.UseHyperKubeImage = false -} - -func kubeadmBootstrapTokenStringFuzzerV1UpstreamBeta1(in *upstreamv1beta1.BootstrapTokenString, _ fuzz.Continue) { - in.ID = fakeID - in.Secret = fakeSecret -} - func kubeadmBootstrapTokenStringFuzzerV1Beta1(in *bootstrapv1.BootstrapTokenString, _ fuzz.Continue) { in.ID = fakeID in.Secret = fakeSecret diff --git a/bootstrap/kubeadm/types/upstreamv1beta1/bootstraptokenstring.go b/bootstrap/kubeadm/types/upstreamv1beta1/bootstraptokenstring.go deleted file mode 100644 index f994efcdb6c6..000000000000 --- a/bootstrap/kubeadm/types/upstreamv1beta1/bootstraptokenstring.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package upstreamv1beta1 - -import ( - "fmt" - "strings" - - "github.com/pkg/errors" - bootstrapapi "k8s.io/cluster-bootstrap/token/api" - bootstraputil "k8s.io/cluster-bootstrap/token/util" -) - -// BootstrapTokenString is a token of the format abcdef.abcdef0123456789 that is used -// for both validation of the practically of the API server from a joining node's point -// of view and as an authentication method for the node in the bootstrap phase of -// "kubeadm join". This token is and should be short-lived. -// -// +kubebuilder:validation:Type=string -type BootstrapTokenString struct { - ID string `json:"-"` - Secret string `json:"-"` -} - -// MarshalJSON implements the json.Marshaler interface. -func (bts BootstrapTokenString) MarshalJSON() ([]byte, error) { - return []byte(fmt.Sprintf("%q", bts.String())), nil -} - -// UnmarshalJSON implements the json.Unmarshaller interface. -func (bts *BootstrapTokenString) UnmarshalJSON(b []byte) error { - // If the token is represented as "", just return quickly without an error - if len(b) == 0 { - return nil - } - - // Remove unnecessary " characters coming from the JSON parser - token := strings.ReplaceAll(string(b), `"`, ``) - // Convert the string Token to a BootstrapTokenString object - newbts, err := NewBootstrapTokenString(token) - if err != nil { - return err - } - bts.ID = newbts.ID - bts.Secret = newbts.Secret - return nil -} - -// String returns the string representation of the BootstrapTokenString. -func (bts BootstrapTokenString) String() string { - if len(bts.ID) > 0 && len(bts.Secret) > 0 { - return bootstraputil.TokenFromIDAndSecret(bts.ID, bts.Secret) - } - return "" -} - -// NewBootstrapTokenString converts the given Bootstrap Token as a string -// to the BootstrapTokenString object used for serialization/deserialization -// and internal usage. It also automatically validates that the given token -// is of the right format. -func NewBootstrapTokenString(token string) (*BootstrapTokenString, error) { - substrs := bootstraputil.BootstrapTokenRegexp.FindStringSubmatch(token) - // TODO: Add a constant for the 3 value here, and explain better why it's needed (other than because how the regexp parsin works) - if len(substrs) != 3 { - return nil, errors.Errorf("the bootstrap token %q was not of the form %q", token, bootstrapapi.BootstrapTokenPattern) - } - - return &BootstrapTokenString{ID: substrs[1], Secret: substrs[2]}, nil -} - -// NewBootstrapTokenStringFromIDAndSecret is a wrapper around NewBootstrapTokenString -// that allows the caller to specify the ID and Secret separately. -func NewBootstrapTokenStringFromIDAndSecret(id, secret string) (*BootstrapTokenString, error) { - return NewBootstrapTokenString(bootstraputil.TokenFromIDAndSecret(id, secret)) -} diff --git a/bootstrap/kubeadm/types/upstreamv1beta1/bootstraptokenstring_test.go b/bootstrap/kubeadm/types/upstreamv1beta1/bootstraptokenstring_test.go deleted file mode 100644 index 1b7c5804b801..000000000000 --- a/bootstrap/kubeadm/types/upstreamv1beta1/bootstraptokenstring_test.go +++ /dev/null @@ -1,223 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package upstreamv1beta1 - -import ( - "encoding/json" - "testing" - - "github.com/google/go-cmp/cmp" - . "github.com/onsi/gomega" - "github.com/pkg/errors" -) - -func TestMarshalJSON(t *testing.T) { - var tests = []struct { - bts BootstrapTokenString - expected string - }{ - {BootstrapTokenString{ID: "abcdef", Secret: "abcdef0123456789"}, `"abcdef.abcdef0123456789"`}, - {BootstrapTokenString{ID: "foo", Secret: "bar"}, `"foo.bar"`}, - {BootstrapTokenString{ID: "h", Secret: "b"}, `"h.b"`}, - } - for _, rt := range tests { - t.Run(rt.bts.ID, func(t *testing.T) { - g := NewWithT(t) - - b, err := json.Marshal(rt.bts) - g.Expect(err).ToNot(HaveOccurred()) - g.Expect(b).To(BeEquivalentTo(rt.expected)) - }) - } -} - -func TestUnmarshalJSON(t *testing.T) { - var tests = []struct { - input string - bts *BootstrapTokenString - expectedError bool - }{ - {`"f.s"`, &BootstrapTokenString{}, true}, - {`"abcdef."`, &BootstrapTokenString{}, true}, - {`"abcdef:abcdef0123456789"`, &BootstrapTokenString{}, true}, - {`abcdef.abcdef0123456789`, &BootstrapTokenString{}, true}, - {`"abcdef.abcdef0123456789`, &BootstrapTokenString{}, true}, - {`"abcdef.ABCDEF0123456789"`, &BootstrapTokenString{}, true}, - {`"abcdef.abcdef0123456789"`, &BootstrapTokenString{ID: "abcdef", Secret: "abcdef0123456789"}, false}, - {`"123456.aabbccddeeffgghh"`, &BootstrapTokenString{ID: "123456", Secret: "aabbccddeeffgghh"}, false}, - } - for _, rt := range tests { - t.Run(rt.input, func(t *testing.T) { - g := NewWithT(t) - - newbts := &BootstrapTokenString{} - err := json.Unmarshal([]byte(rt.input), newbts) - if rt.expectedError { - g.Expect(err).To(HaveOccurred()) - } else { - g.Expect(err).ToNot(HaveOccurred()) - } - g.Expect(newbts).To(BeComparableTo(rt.bts)) - }) - } -} - -func TestJSONRoundtrip(t *testing.T) { - var tests = []struct { - input string - bts *BootstrapTokenString - }{ - {`"abcdef.abcdef0123456789"`, nil}, - {"", &BootstrapTokenString{ID: "abcdef", Secret: "abcdef0123456789"}}, - } - for _, rt := range tests { - t.Run(rt.input, func(t *testing.T) { - g := NewWithT(t) - - g.Expect(roundtrip(rt.input, rt.bts)).To(Succeed()) - }) - } -} - -func roundtrip(input string, bts *BootstrapTokenString) error { - var b []byte - var err error - newbts := &BootstrapTokenString{} - // If string input was specified, roundtrip like this: string -> (unmarshal) -> object -> (marshal) -> string - if len(input) > 0 { - if err := json.Unmarshal([]byte(input), newbts); err != nil { - return errors.Wrap(err, "expected no unmarshal error, got error") - } - if b, err = json.Marshal(newbts); err != nil { - return errors.Wrap(err, "expected no marshal error, got error") - } - if input != string(b) { - return errors.Errorf( - "expected token: %s\n\t actual: %s", - input, - string(b), - ) - } - } else { // Otherwise, roundtrip like this: object -> (marshal) -> string -> (unmarshal) -> object - if b, err = json.Marshal(bts); err != nil { - return errors.Wrap(err, "expected no marshal error, got error") - } - if err := json.Unmarshal(b, newbts); err != nil { - return errors.Wrap(err, "expected no unmarshal error, got error") - } - if diff := cmp.Diff(bts, newbts); diff != "" { - return errors.Errorf( - "expected object: %v\n\t actual: %v\n\t got diff: %v", - bts, - newbts, - diff, - ) - } - } - return nil -} - -func TestTokenFromIDAndSecret(t *testing.T) { - var tests = []struct { - bts BootstrapTokenString - expected string - }{ - {BootstrapTokenString{ID: "foo", Secret: "bar"}, "foo.bar"}, - {BootstrapTokenString{ID: "abcdef", Secret: "abcdef0123456789"}, "abcdef.abcdef0123456789"}, - {BootstrapTokenString{ID: "h", Secret: "b"}, "h.b"}, - } - for _, rt := range tests { - t.Run(rt.bts.ID, func(t *testing.T) { - g := NewWithT(t) - - g.Expect(rt.bts.String()).To(Equal(rt.expected)) - }) - } -} - -func TestNewBootstrapTokenString(t *testing.T) { - var tests = []struct { - token string - expectedError bool - bts *BootstrapTokenString - }{ - {token: "", expectedError: true, bts: nil}, - {token: ".", expectedError: true, bts: nil}, - {token: "1234567890123456789012", expectedError: true, bts: nil}, // invalid parcel size - {token: "12345.1234567890123456", expectedError: true, bts: nil}, // invalid parcel size - {token: ".1234567890123456", expectedError: true, bts: nil}, // invalid parcel size - {token: "123456.", expectedError: true, bts: nil}, // invalid parcel size - {token: "123456:1234567890.123456", expectedError: true, bts: nil}, // invalid separation - {token: "abcdef:1234567890123456", expectedError: true, bts: nil}, // invalid separation - {token: "Abcdef.1234567890123456", expectedError: true, bts: nil}, // invalid token id - {token: "123456.AABBCCDDEEFFGGHH", expectedError: true, bts: nil}, // invalid token secret - {token: "123456.AABBCCD-EEFFGGHH", expectedError: true, bts: nil}, // invalid character - {token: "abc*ef.1234567890123456", expectedError: true, bts: nil}, // invalid character - {token: "abcdef.1234567890123456", expectedError: false, bts: &BootstrapTokenString{ID: "abcdef", Secret: "1234567890123456"}}, - {token: "123456.aabbccddeeffgghh", expectedError: false, bts: &BootstrapTokenString{ID: "123456", Secret: "aabbccddeeffgghh"}}, - {token: "abcdef.abcdef0123456789", expectedError: false, bts: &BootstrapTokenString{ID: "abcdef", Secret: "abcdef0123456789"}}, - {token: "123456.1234560123456789", expectedError: false, bts: &BootstrapTokenString{ID: "123456", Secret: "1234560123456789"}}, - } - for _, rt := range tests { - t.Run(rt.token, func(t *testing.T) { - g := NewWithT(t) - - actual, err := NewBootstrapTokenString(rt.token) - if rt.expectedError { - g.Expect(err).To(HaveOccurred()) - } else { - g.Expect(err).ToNot(HaveOccurred()) - } - g.Expect(actual).To(BeComparableTo(rt.bts)) - }) - } -} - -func TestNewBootstrapTokenStringFromIDAndSecret(t *testing.T) { - var tests = []struct { - id, secret string - expectedError bool - bts *BootstrapTokenString - }{ - {id: "", secret: "", expectedError: true, bts: nil}, - {id: "1234567890123456789012", secret: "", expectedError: true, bts: nil}, // invalid parcel size - {id: "12345", secret: "1234567890123456", expectedError: true, bts: nil}, // invalid parcel size - {id: "", secret: "1234567890123456", expectedError: true, bts: nil}, // invalid parcel size - {id: "123456", secret: "", expectedError: true, bts: nil}, // invalid parcel size - {id: "Abcdef", secret: "1234567890123456", expectedError: true, bts: nil}, // invalid token id - {id: "123456", secret: "AABBCCDDEEFFGGHH", expectedError: true, bts: nil}, // invalid token secret - {id: "123456", secret: "AABBCCD-EEFFGGHH", expectedError: true, bts: nil}, // invalid character - {id: "abc*ef", secret: "1234567890123456", expectedError: true, bts: nil}, // invalid character - {id: "abcdef", secret: "1234567890123456", expectedError: false, bts: &BootstrapTokenString{ID: "abcdef", Secret: "1234567890123456"}}, - {id: "123456", secret: "aabbccddeeffgghh", expectedError: false, bts: &BootstrapTokenString{ID: "123456", Secret: "aabbccddeeffgghh"}}, - {id: "abcdef", secret: "abcdef0123456789", expectedError: false, bts: &BootstrapTokenString{ID: "abcdef", Secret: "abcdef0123456789"}}, - {id: "123456", secret: "1234560123456789", expectedError: false, bts: &BootstrapTokenString{ID: "123456", Secret: "1234560123456789"}}, - } - for _, rt := range tests { - t.Run(rt.id, func(t *testing.T) { - g := NewWithT(t) - - actual, err := NewBootstrapTokenStringFromIDAndSecret(rt.id, rt.secret) - if rt.expectedError { - g.Expect(err).To(HaveOccurred()) - } else { - g.Expect(err).ToNot(HaveOccurred()) - } - g.Expect(actual).To(BeComparableTo(rt.bts)) - }) - } -} diff --git a/bootstrap/kubeadm/types/upstreamv1beta1/conversion.go b/bootstrap/kubeadm/types/upstreamv1beta1/conversion.go deleted file mode 100644 index e893686d52e1..000000000000 --- a/bootstrap/kubeadm/types/upstreamv1beta1/conversion.go +++ /dev/null @@ -1,97 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package upstreamv1beta1 - -import ( - apimachineryconversion "k8s.io/apimachinery/pkg/conversion" - "sigs.k8s.io/controller-runtime/pkg/conversion" - - bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" -) - -// ConvertTo converts this ClusterConfiguration to the Hub version (v1alpha4). -func (src *ClusterConfiguration) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*bootstrapv1.ClusterConfiguration) - return Convert_upstreamv1beta1_ClusterConfiguration_To_v1beta1_ClusterConfiguration(src, dst, nil) -} - -// ConvertFrom converts from the ClusterConfiguration Hub version (v1alpha4) to this version. -func (dst *ClusterConfiguration) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*bootstrapv1.ClusterConfiguration) - return Convert_v1beta1_ClusterConfiguration_To_upstreamv1beta1_ClusterConfiguration(src, dst, nil) -} - -// ConvertTo converts this ClusterStatus to the Hub version (v1alpha4). -func (src *ClusterStatus) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*bootstrapv1.ClusterStatus) - return Convert_upstreamv1beta1_ClusterStatus_To_v1beta1_ClusterStatus(src, dst, nil) -} - -// ConvertFrom converts from the ClusterStatus Hub version (v1alpha4) to this version. -func (dst *ClusterStatus) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*bootstrapv1.ClusterStatus) - return Convert_v1beta1_ClusterStatus_To_upstreamv1beta1_ClusterStatus(src, dst, nil) -} - -// ConvertTo converts this InitConfiguration to the Hub version (v1alpha4). -func (src *InitConfiguration) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*bootstrapv1.InitConfiguration) - return Convert_upstreamv1beta1_InitConfiguration_To_v1beta1_InitConfiguration(src, dst, nil) -} - -// ConvertFrom converts from the InitConfiguration Hub version (v1alpha4) to this version. -func (dst *InitConfiguration) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*bootstrapv1.InitConfiguration) - return Convert_v1beta1_InitConfiguration_To_upstreamv1beta1_InitConfiguration(src, dst, nil) -} - -// ConvertTo converts this JoinConfiguration to the Hub version (v1alpha4). -func (src *JoinConfiguration) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*bootstrapv1.JoinConfiguration) - return Convert_upstreamv1beta1_JoinConfiguration_To_v1beta1_JoinConfiguration(src, dst, nil) -} - -// ConvertFrom converts from the JoinConfiguration Hub version (v1alpha4) to this version. -func (dst *JoinConfiguration) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*bootstrapv1.JoinConfiguration) - return Convert_v1beta1_JoinConfiguration_To_upstreamv1beta1_JoinConfiguration(src, dst, nil) -} - -func Convert_upstreamv1beta1_DNS_To_v1beta1_DNS(in *DNS, out *bootstrapv1.DNS, s apimachineryconversion.Scope) error { - // DNS.Type was removed in v1alpha4 because only CoreDNS is supported, dropping this info. - return autoConvert_upstreamv1beta1_DNS_To_v1beta1_DNS(in, out, s) -} - -func Convert_upstreamv1beta1_ClusterConfiguration_To_v1beta1_ClusterConfiguration(in *ClusterConfiguration, out *bootstrapv1.ClusterConfiguration, s apimachineryconversion.Scope) error { - // ClusterConfiguration.UseHyperKubeImage was removed in kubeadm v1alpha4 API - return autoConvert_upstreamv1beta1_ClusterConfiguration_To_v1beta1_ClusterConfiguration(in, out, s) -} - -func Convert_v1beta1_NodeRegistrationOptions_To_upstreamv1beta1_NodeRegistrationOptions(in *bootstrapv1.NodeRegistrationOptions, out *NodeRegistrationOptions, s apimachineryconversion.Scope) error { - // NodeRegistrationOptions.IgnorePreflightErrors does not exist in kubeadm v1beta1 API - return autoConvert_v1beta1_NodeRegistrationOptions_To_upstreamv1beta1_NodeRegistrationOptions(in, out, s) -} - -func Convert_v1beta1_InitConfiguration_To_upstreamv1beta1_InitConfiguration(in *bootstrapv1.InitConfiguration, out *InitConfiguration, s apimachineryconversion.Scope) error { - // InitConfiguration.Patches does not exist in kubeadm v1beta1 API - return autoConvert_v1beta1_InitConfiguration_To_upstreamv1beta1_InitConfiguration(in, out, s) -} - -func Convert_v1beta1_JoinConfiguration_To_upstreamv1beta1_JoinConfiguration(in *bootstrapv1.JoinConfiguration, out *JoinConfiguration, s apimachineryconversion.Scope) error { - // JoinConfiguration.Patches does not exist in kubeadm v1beta1 API - return autoConvert_v1beta1_JoinConfiguration_To_upstreamv1beta1_JoinConfiguration(in, out, s) -} diff --git a/bootstrap/kubeadm/types/upstreamv1beta1/conversion_test.go b/bootstrap/kubeadm/types/upstreamv1beta1/conversion_test.go deleted file mode 100644 index 13d1f18319ac..000000000000 --- a/bootstrap/kubeadm/types/upstreamv1beta1/conversion_test.go +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package upstreamv1beta1 - -import ( - "testing" - - fuzz "github.com/google/gofuzz" - "k8s.io/apimachinery/pkg/api/apitesting/fuzzer" - runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" - - bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" - utilconversion "sigs.k8s.io/cluster-api/util/conversion" -) - -func TestFuzzyConversion(t *testing.T) { - t.Run("for ClusterConfiguration", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Hub: &bootstrapv1.ClusterConfiguration{}, - Spoke: &ClusterConfiguration{}, - // NOTE: Kubeadm types does not have ObjectMeta, so we are required to skip data annotation cleanup in the spoke-hub-spoke round trip test. - SkipSpokeAnnotationCleanup: true, - FuzzerFuncs: []fuzzer.FuzzerFuncs{fuzzFuncs}, - })) - t.Run("for ClusterStatus", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Hub: &bootstrapv1.ClusterStatus{}, - Spoke: &ClusterStatus{}, - // NOTE: Kubeadm types does not have ObjectMeta, so we are required to skip data annotation cleanup in the spoke-hub-spoke round trip test. - SkipSpokeAnnotationCleanup: true, - FuzzerFuncs: []fuzzer.FuzzerFuncs{fuzzFuncs}, - })) - t.Run("for InitConfiguration", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Hub: &bootstrapv1.InitConfiguration{}, - Spoke: &InitConfiguration{}, - // NOTE: Kubeadm types does not have ObjectMeta, so we are required to skip data annotation cleanup in the spoke-hub-spoke round trip test. - SkipSpokeAnnotationCleanup: true, - FuzzerFuncs: []fuzzer.FuzzerFuncs{fuzzFuncs}, - })) - t.Run("for JoinConfiguration", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Hub: &bootstrapv1.JoinConfiguration{}, - Spoke: &JoinConfiguration{}, - // NOTE: Kubeadm types does not have ObjectMeta, so we are required to skip data annotation cleanup in the spoke-hub-spoke round trip test. - SkipSpokeAnnotationCleanup: true, - FuzzerFuncs: []fuzzer.FuzzerFuncs{fuzzFuncs}, - })) -} - -func fuzzFuncs(_ runtimeserializer.CodecFactory) []interface{} { - return []interface{}{ - dnsFuzzer, - clusterConfigurationFuzzer, - kubeadmNodeRegistrationOptionsFuzzer, - kubeadmInitConfigurationFuzzer, - kubeadmJoinConfigurationFuzzer, - } -} - -func dnsFuzzer(obj *DNS, c fuzz.Continue) { - c.FuzzNoCustom(obj) - - // DNS.Type does not exists in v1alpha4, so setting it to empty string in order to avoid v1beta1 --> v1alpha4 --> v1beta1 round trip errors. - obj.Type = "" -} - -func clusterConfigurationFuzzer(obj *ClusterConfiguration, c fuzz.Continue) { - c.FuzzNoCustom(obj) - - // ClusterConfiguration.UseHyperKubeImage has been removed in v1alpha4, so setting it to false in order to avoid v1beta1 --> v1alpha4 --> v1beta1 round trip errors. - obj.UseHyperKubeImage = false -} - -func kubeadmNodeRegistrationOptionsFuzzer(obj *bootstrapv1.NodeRegistrationOptions, c fuzz.Continue) { - c.FuzzNoCustom(obj) - - // NodeRegistrationOptions.IgnorePreflightErrors does not exist in kubeadm v1beta1 API, so setting it to nil in order to avoid - // v1alpha4 --> v1beta1 -> v1alpha4 round trip errors. - obj.IgnorePreflightErrors = nil - - // NodeRegistrationOptions.ImagePullPolicy does not exist in - // kubeadm v1beta1 API, so setting it to empty in order to - // avoid round trip errors. - obj.ImagePullPolicy = "" -} - -func kubeadmInitConfigurationFuzzer(obj *bootstrapv1.InitConfiguration, c fuzz.Continue) { - c.FuzzNoCustom(obj) - - // InitConfiguration.Patches does not exist in kubeadm v1beta1 API, so setting it to nil in order to avoid - // v1beta1 --> upstream v1beta1 -> v1beta1 round trip errors. - obj.Patches = nil - - // InitConfiguration.SkipPhases does not exist in kubeadm v1beta1 API, so setting it to nil in order to avoid - // v1beta1 --> upstream v1beta1 -> v1beta1 round trip errors. - obj.SkipPhases = nil -} - -func kubeadmJoinConfigurationFuzzer(obj *bootstrapv1.JoinConfiguration, c fuzz.Continue) { - c.FuzzNoCustom(obj) - - // JoinConfiguration.Patches does not exist in kubeadm v1beta1 API, so setting it to nil in order to avoid - // v1beta1 --> upstream v1beta1 -> v1beta1 round trip errors. - obj.Patches = nil - - // JoinConfiguration.SkipPhases does not exist in kubeadm v1beta1 API, so setting it to nil in order to avoid - // v1beta1 --> upstream v1beta1 -> v1beta1 round trip errors. - obj.SkipPhases = nil -} diff --git a/bootstrap/kubeadm/types/upstreamv1beta1/doc.go b/bootstrap/kubeadm/types/upstreamv1beta1/doc.go deleted file mode 100644 index 97d1211d0e5e..000000000000 --- a/bootstrap/kubeadm/types/upstreamv1beta1/doc.go +++ /dev/null @@ -1,24 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package upstreamv1beta1 contains a mirror of kubeadm API v1beta1 API, required because it is not possible to import k/K. -// -// IMPORTANT: Do not change these files! -// IMPORTANT: only for KubeadmConfig serialization/deserialization, and should not be used for other purposes. -// -// +k8s:conversion-gen=sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1 -// +k8s:deepcopy-gen=package -package upstreamv1beta1 // import "sigs.k8s.io/cluster-api/bootstrap/kubeadm/kubeadm/v1beta1" diff --git a/bootstrap/kubeadm/types/upstreamv1beta1/groupversion_info.go b/bootstrap/kubeadm/types/upstreamv1beta1/groupversion_info.go deleted file mode 100644 index 8cb7be6e0fb8..000000000000 --- a/bootstrap/kubeadm/types/upstreamv1beta1/groupversion_info.go +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package upstreamv1beta1 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -var ( - // GroupVersion is group version used to register these objects. - GroupVersion = schema.GroupVersion{Group: "kubeadm.k8s.io", Version: "v1beta1"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme. - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = SchemeBuilder.AddToScheme - - localSchemeBuilder = SchemeBuilder.SchemeBuilder -) diff --git a/bootstrap/kubeadm/types/upstreamv1beta1/types.go b/bootstrap/kubeadm/types/upstreamv1beta1/types.go deleted file mode 100644 index 3f90b4611fcc..000000000000 --- a/bootstrap/kubeadm/types/upstreamv1beta1/types.go +++ /dev/null @@ -1,426 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package upstreamv1beta1 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// InitConfiguration contains a list of elements that is specific "kubeadm init"-only runtime -// information. -type InitConfiguration struct { - metav1.TypeMeta `json:",inline"` - - // BootstrapTokens is respected at `kubeadm init` time and describes a set of Bootstrap Tokens to create. - // This information IS NOT uploaded to the kubeadm cluster configmap, partly because of its sensitive nature - // +optional - BootstrapTokens []BootstrapToken `json:"bootstrapTokens,omitempty"` - - // NodeRegistration holds fields that relate to registering the new control-plane node to the cluster. - // When used in the context of control plane nodes, NodeRegistration should remain consistent - // across both InitConfiguration and JoinConfiguration - // +optional - NodeRegistration NodeRegistrationOptions `json:"nodeRegistration,omitempty"` - - // LocalAPIEndpoint represents the endpoint of the API server instance that's deployed on this control plane node - // In HA setups, this differs from ClusterConfiguration.ControlPlaneEndpoint in the sense that ControlPlaneEndpoint - // is the global endpoint for the cluster, which then loadbalances the requests to each individual API server. This - // configuration object lets you customize what IP/DNS name and port the local API server advertises it's accessible - // on. By default, kubeadm tries to auto-detect the IP of the default interface and use that, but in case that process - // fails you may set the desired value here. - // +optional - LocalAPIEndpoint APIEndpoint `json:"localAPIEndpoint,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// ClusterConfiguration contains cluster-wide configuration for a kubeadm cluster. -type ClusterConfiguration struct { - metav1.TypeMeta `json:",inline"` - - // Etcd holds configuration for etcd. - // NB: This value defaults to a Local (stacked) etcd - // +optional - Etcd Etcd `json:"etcd,omitempty"` - - // Networking holds configuration for the networking topology of the cluster. - // NB: This value defaults to the Cluster object spec.clusterNetwork. - // +optional - Networking Networking `json:"networking,omitempty"` - - // KubernetesVersion is the target version of the control plane. - // NB: This value defaults to the Machine object spec.version - // +optional - KubernetesVersion string `json:"kubernetesVersion,omitempty"` - - // ControlPlaneEndpoint sets a stable IP address or DNS name for the control plane; it - // can be a valid IP address or a RFC-1123 DNS subdomain, both with optional TCP port. - // In case the ControlPlaneEndpoint is not specified, the AdvertiseAddress + BindPort - // are used; in case the ControlPlaneEndpoint is specified but without a TCP port, - // the BindPort is used. - // Possible usages are: - // e.g. In a cluster with more than one control plane instances, this field should be - // assigned the address of the external load balancer in front of the - // control plane instances. - // e.g. in environments with enforced node recycling, the ControlPlaneEndpoint - // could be used for assigning a stable DNS to the control plane. - // NB: This value defaults to the first value in the Cluster object status.apiEndpoints array. - // +optional - ControlPlaneEndpoint string `json:"controlPlaneEndpoint,omitempty"` - - // APIServer contains extra settings for the API server control plane component - // +optional - APIServer APIServer `json:"apiServer,omitempty"` - - // ControllerManager contains extra settings for the controller manager control plane component - // +optional - ControllerManager ControlPlaneComponent `json:"controllerManager,omitempty"` - - // Scheduler contains extra settings for the scheduler control plane component - // +optional - Scheduler ControlPlaneComponent `json:"scheduler,omitempty"` - - // DNS defines the options for the DNS add-on installed in the cluster. - // +optional - DNS DNS `json:"dns,omitempty"` - - // CertificatesDir specifies where to store or look for all required certificates. - // NB: if not provided, this will default to `/etc/kubernetes/pki` - // +optional - CertificatesDir string `json:"certificatesDir,omitempty"` - - // ImageRepository sets the container registry to pull images from. - // If empty, `k8s.gcr.io` will be used by default; in case of kubernetes version is a CI build (kubernetes version starts with `ci/` or `ci-cross/`) - // `gcr.io/k8s-staging-ci-images` will be used as a default for control plane components and for kube-proxy, while `k8s.gcr.io` - // will be used for all the other images. - // +optional - ImageRepository string `json:"imageRepository,omitempty"` - - // UseHyperKubeImage controls if hyperkube should be used for Kubernetes components instead of their respective separate images - // +optional - UseHyperKubeImage bool `json:"useHyperKubeImage,omitempty"` - - // FeatureGates enabled by the user. - // +optional - FeatureGates map[string]bool `json:"featureGates,omitempty"` - - // The cluster name - // +optional - ClusterName string `json:"clusterName,omitempty"` -} - -// ControlPlaneComponent holds settings common to control plane component of the cluster. -type ControlPlaneComponent struct { - // ExtraArgs is an extra set of flags to pass to the control plane component. - // TODO: This is temporary and ideally we would like to switch all components to - // use ComponentConfig + ConfigMaps. - ExtraArgs map[string]string `json:"extraArgs,omitempty"` - - // ExtraVolumes is an extra set of host volumes, mounted to the control plane component. - ExtraVolumes []HostPathMount `json:"extraVolumes,omitempty"` -} - -// APIServer holds settings necessary for API server deployments in the cluster. -type APIServer struct { - ControlPlaneComponent `json:",inline"` - - // CertSANs sets extra Subject Alternative Names for the API Server signing cert. - CertSANs []string `json:"certSANs,omitempty"` - - // TimeoutForControlPlane controls the timeout that we use for API server to appear - TimeoutForControlPlane *metav1.Duration `json:"timeoutForControlPlane,omitempty"` -} - -// DNSAddOnType defines string identifying DNS add-on types. -type DNSAddOnType string - -const ( - // CoreDNS add-on type. - CoreDNS DNSAddOnType = "CoreDNS" - - // KubeDNS add-on type. - KubeDNS DNSAddOnType = "kube-dns" -) - -// DNS defines the DNS addon that should be used in the cluster. -type DNS struct { - // Type defines the DNS add-on to be used - // +optional - Type DNSAddOnType `json:"type,omitempty"` - - // ImageMeta allows to customize the image used for the DNS component - ImageMeta `json:",inline"` -} - -// ImageMeta allows to customize the image used for components that are not -// originated from the Kubernetes/Kubernetes release process. -type ImageMeta struct { - // ImageRepository sets the container registry to pull images from. - // if not set, the ImageRepository defined in ClusterConfiguration will be used instead. - ImageRepository string `json:"imageRepository,omitempty"` - - // ImageTag allows to specify a tag for the image. - // In case this value is set, kubeadm does not change automatically the version of the above components during upgrades. - ImageTag string `json:"imageTag,omitempty"` - - //TODO: evaluate if we need also a ImageName based on user feedbacks -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// ClusterStatus contains the cluster status. The ClusterStatus will be stored in the kubeadm-config -// ConfigMap in the cluster, and then updated by kubeadm when additional control plane instance joins or leaves the cluster. -type ClusterStatus struct { - metav1.TypeMeta `json:",inline"` - - // APIEndpoints currently available in the cluster, one for each control plane/api server instance. - // The key of the map is the IP of the host's default interface - APIEndpoints map[string]APIEndpoint `json:"apiEndpoints"` -} - -// APIEndpoint struct contains elements of API server instance deployed on a node. -type APIEndpoint struct { - // AdvertiseAddress sets the IP address for the API server to advertise. - AdvertiseAddress string `json:"advertiseAddress"` - - // BindPort sets the secure port for the API Server to bind to. - // Defaults to 6443. - BindPort int32 `json:"bindPort"` -} - -// NodeRegistrationOptions holds fields that relate to registering a new control-plane or node to the cluster, either via "kubeadm init" or "kubeadm join". -type NodeRegistrationOptions struct { - - // Name is the `.Metadata.Name` field of the Node API object that will be created in this `kubeadm init` or `kubeadm join` operation. - // This field is also used in the CommonName field of the kubelet's client certificate to the API server. - // Defaults to the hostname of the node if not provided. - // +optional - Name string `json:"name,omitempty"` - - // CRISocket is used to retrieve container runtime info. This information will be annotated to the Node API object, for later re-use - // +optional - CRISocket string `json:"criSocket,omitempty"` - - // Taints specifies the taints the Node API object should be registered with. If this field is unset, i.e. nil, in the `kubeadm init` process - // it will be defaulted to []v1.Taint{'node-role.kubernetes.io/master=""'}. If you don't want to taint your control-plane node, set this field to an - // empty slice, i.e. `taints: {}` in the YAML file. This field is solely used for Node registration. - // +optional - Taints []corev1.Taint `json:"taints,omitempty"` - - // KubeletExtraArgs passes through extra arguments to the kubelet. The arguments here are passed to the kubelet command line via the environment file - // kubeadm writes at runtime for the kubelet to source. This overrides the generic base-level configuration in the kubelet-config-1.X ConfigMap - // Flags have higher priority when parsing. These values are local and specific to the node kubeadm is executing on. - // +optional - KubeletExtraArgs map[string]string `json:"kubeletExtraArgs,omitempty"` -} - -// Networking contains elements describing cluster's networking configuration. -type Networking struct { - // ServiceSubnet is the subnet used by k8s services. - // Defaults to a comma-delimited string of the Cluster object's spec.clusterNetwork.pods.cidrBlocks, or - // to "10.96.0.0/12" if that's unset. - // +optional - ServiceSubnet string `json:"serviceSubnet,omitempty"` - // PodSubnet is the subnet used by pods. - // If unset, the API server will not allocate CIDR ranges for every node. - // Defaults to a comma-delimited string of the Cluster object's spec.clusterNetwork.services.cidrBlocks if that is set - // +optional - PodSubnet string `json:"podSubnet,omitempty"` - // DNSDomain is the dns domain used by k8s services. Defaults to "cluster.local". - // +optional - DNSDomain string `json:"dnsDomain,omitempty"` -} - -// BootstrapToken describes one bootstrap token, stored as a Secret in the cluster. -type BootstrapToken struct { - // Token is used for establishing bidirectional trust between nodes and control-planes. - // Used for joining nodes in the cluster. - Token *BootstrapTokenString `json:"token"` - // Description sets a human-friendly message why this token exists and what it's used - // for, so other administrators can know its purpose. - Description string `json:"description,omitempty"` - // TTL defines the time to live for this token. Defaults to 24h. - // Expires and TTL are mutually exclusive. - TTL *metav1.Duration `json:"ttl,omitempty"` - // Expires specifies the timestamp when this token expires. Defaults to being set - // dynamically at runtime based on the TTL. Expires and TTL are mutually exclusive. - Expires *metav1.Time `json:"expires,omitempty"` - // Usages describes the ways in which this token can be used. Can by default be used - // for establishing bidirectional trust, but that can be changed here. - Usages []string `json:"usages,omitempty"` - // Groups specifies the extra groups that this token will authenticate as when/if - // used for authentication - Groups []string `json:"groups,omitempty"` -} - -// Etcd contains elements describing Etcd configuration. -type Etcd struct { - - // Local provides configuration knobs for configuring the local etcd instance - // Local and External are mutually exclusive - Local *LocalEtcd `json:"local,omitempty"` - - // External describes how to connect to an external etcd cluster - // Local and External are mutually exclusive - External *ExternalEtcd `json:"external,omitempty"` -} - -// LocalEtcd describes that kubeadm should run an etcd cluster locally. -type LocalEtcd struct { - // ImageMeta allows to customize the container used for etcd - ImageMeta `json:",inline"` - - // DataDir is the directory etcd will place its data. - // Defaults to "/var/lib/etcd". - // +optional - DataDir string `json:"dataDir,omitempty"` - - // ExtraArgs are extra arguments provided to the etcd binary - // when run inside a static pod. - ExtraArgs map[string]string `json:"extraArgs,omitempty"` - - // ServerCertSANs sets extra Subject Alternative Names for the etcd server signing cert. - ServerCertSANs []string `json:"serverCertSANs,omitempty"` - // PeerCertSANs sets extra Subject Alternative Names for the etcd peer signing cert. - PeerCertSANs []string `json:"peerCertSANs,omitempty"` -} - -// ExternalEtcd describes an external etcd cluster. -// Kubeadm has no knowledge of where certificate files live and they must be supplied. -type ExternalEtcd struct { - // Endpoints of etcd members. Required for ExternalEtcd. - Endpoints []string `json:"endpoints"` - - // CAFile is an SSL Certificate Authority file used to secure etcd communication. - // Required if using a TLS connection. - CAFile string `json:"caFile"` - - // CertFile is an SSL certification file used to secure etcd communication. - // Required if using a TLS connection. - CertFile string `json:"certFile"` - - // KeyFile is an SSL key file used to secure etcd communication. - // Required if using a TLS connection. - KeyFile string `json:"keyFile"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// JoinConfiguration contains elements describing a particular node. -type JoinConfiguration struct { - metav1.TypeMeta `json:",inline"` - - // NodeRegistration holds fields that relate to registering the new control-plane node to the cluster. - // When used in the context of control plane nodes, NodeRegistration should remain consistent - // across both InitConfiguration and JoinConfiguration - // +optional - NodeRegistration NodeRegistrationOptions `json:"nodeRegistration,omitempty"` - - // CACertPath is the path to the SSL certificate authority used to - // secure comunications between node and control-plane. - // Defaults to "/etc/kubernetes/pki/ca.crt". - // +optional - // TODO: revisit when there is defaulting from k/k - CACertPath string `json:"caCertPath,omitempty"` - - // Discovery specifies the options for the kubelet to use during the TLS Bootstrap process - // +optional - // TODO: revisit when there is defaulting from k/k - Discovery Discovery `json:"discovery,omitempty"` - - // ControlPlane defines the additional control plane instance to be deployed on the joining node. - // If nil, no additional control plane instance will be deployed. - // +optional - ControlPlane *JoinControlPlane `json:"controlPlane,omitempty"` -} - -// JoinControlPlane contains elements describing an additional control plane instance to be deployed on the joining node. -type JoinControlPlane struct { - // LocalAPIEndpoint represents the endpoint of the API server instance to be deployed on this node. - LocalAPIEndpoint APIEndpoint `json:"localAPIEndpoint,omitempty"` -} - -// Discovery specifies the options for the kubelet to use during the TLS Bootstrap process. -type Discovery struct { - // BootstrapToken is used to set the options for bootstrap token based discovery - // BootstrapToken and File are mutually exclusive - BootstrapToken *BootstrapTokenDiscovery `json:"bootstrapToken,omitempty"` - - // File is used to specify a file or URL to a kubeconfig file from which to load cluster information - // BootstrapToken and File are mutually exclusive - File *FileDiscovery `json:"file,omitempty"` - - // TLSBootstrapToken is a token used for TLS bootstrapping. - // If .BootstrapToken is set, this field is defaulted to .BootstrapToken.Token, but can be overridden. - // If .File is set, this field **must be set** in case the KubeConfigFile does not contain any other authentication information - // +optional - // TODO: revisit when there is defaulting from k/k - TLSBootstrapToken string `json:"tlsBootstrapToken,omitempty"` - - // Timeout modifies the discovery timeout - Timeout *metav1.Duration `json:"timeout,omitempty"` -} - -// BootstrapTokenDiscovery is used to set the options for bootstrap token based discovery. -type BootstrapTokenDiscovery struct { - // Token is a token used to validate cluster information - // fetched from the control-plane. - Token string `json:"token"` - - // APIServerEndpoint is an IP or domain name to the API server from which info will be fetched. - APIServerEndpoint string `json:"apiServerEndpoint,omitempty"` - - // CACertHashes specifies a set of public key pins to verify - // when token-based discovery is used. The root CA found during discovery - // must match one of these values. Specifying an empty set disables root CA - // pinning, which can be unsafe. Each hash is specified as ":", - // where the only currently supported type is "sha256". This is a hex-encoded - // SHA-256 hash of the Subject Public Key Info (SPKI) object in DER-encoded - // ASN.1. These hashes can be calculated using, for example, OpenSSL: - // openssl x509 -pubkey -in ca.crt openssl rsa -pubin -outform der 2>&/dev/null | openssl dgst -sha256 -hex - CACertHashes []string `json:"caCertHashes,omitempty"` - - // UnsafeSkipCAVerification allows token-based discovery - // without CA verification via CACertHashes. This can weaken - // the security of kubeadm since other nodes can impersonate the control-plane. - UnsafeSkipCAVerification bool `json:"unsafeSkipCAVerification"` -} - -// FileDiscovery is used to specify a file or URL to a kubeconfig file from which to load cluster information. -type FileDiscovery struct { - // KubeConfigPath is used to specify the actual file path or URL to the kubeconfig file from which to load cluster information - KubeConfigPath string `json:"kubeConfigPath"` -} - -// HostPathMount contains elements describing volumes that are mounted from the -// host. -type HostPathMount struct { - // Name of the volume inside the pod template. - Name string `json:"name"` - // HostPath is the path in the host that will be mounted inside - // the pod. - HostPath string `json:"hostPath"` - // MountPath is the path inside the pod where hostPath will be mounted. - MountPath string `json:"mountPath"` - // ReadOnly controls write access to the volume - ReadOnly bool `json:"readOnly,omitempty"` - // PathType is the type of the HostPath. - PathType corev1.HostPathType `json:"pathType,omitempty"` -} diff --git a/bootstrap/kubeadm/types/upstreamv1beta1/zz_generated.conversion.go b/bootstrap/kubeadm/types/upstreamv1beta1/zz_generated.conversion.go deleted file mode 100644 index 0497d927b800..000000000000 --- a/bootstrap/kubeadm/types/upstreamv1beta1/zz_generated.conversion.go +++ /dev/null @@ -1,811 +0,0 @@ -//go:build !ignore_autogenerated_kubeadm_types -// +build !ignore_autogenerated_kubeadm_types - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by conversion-gen. DO NOT EDIT. - -package upstreamv1beta1 - -import ( - unsafe "unsafe" - - corev1 "k8s.io/api/core/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" - v1beta1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" -) - -func init() { - localSchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*APIEndpoint)(nil), (*v1beta1.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_upstreamv1beta1_APIEndpoint_To_v1beta1_APIEndpoint(a.(*APIEndpoint), b.(*v1beta1.APIEndpoint), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.APIEndpoint)(nil), (*APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_APIEndpoint_To_upstreamv1beta1_APIEndpoint(a.(*v1beta1.APIEndpoint), b.(*APIEndpoint), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*APIServer)(nil), (*v1beta1.APIServer)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_upstreamv1beta1_APIServer_To_v1beta1_APIServer(a.(*APIServer), b.(*v1beta1.APIServer), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.APIServer)(nil), (*APIServer)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_APIServer_To_upstreamv1beta1_APIServer(a.(*v1beta1.APIServer), b.(*APIServer), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*BootstrapToken)(nil), (*v1beta1.BootstrapToken)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_upstreamv1beta1_BootstrapToken_To_v1beta1_BootstrapToken(a.(*BootstrapToken), b.(*v1beta1.BootstrapToken), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.BootstrapToken)(nil), (*BootstrapToken)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_BootstrapToken_To_upstreamv1beta1_BootstrapToken(a.(*v1beta1.BootstrapToken), b.(*BootstrapToken), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*BootstrapTokenDiscovery)(nil), (*v1beta1.BootstrapTokenDiscovery)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_upstreamv1beta1_BootstrapTokenDiscovery_To_v1beta1_BootstrapTokenDiscovery(a.(*BootstrapTokenDiscovery), b.(*v1beta1.BootstrapTokenDiscovery), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.BootstrapTokenDiscovery)(nil), (*BootstrapTokenDiscovery)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_BootstrapTokenDiscovery_To_upstreamv1beta1_BootstrapTokenDiscovery(a.(*v1beta1.BootstrapTokenDiscovery), b.(*BootstrapTokenDiscovery), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*BootstrapTokenString)(nil), (*v1beta1.BootstrapTokenString)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_upstreamv1beta1_BootstrapTokenString_To_v1beta1_BootstrapTokenString(a.(*BootstrapTokenString), b.(*v1beta1.BootstrapTokenString), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.BootstrapTokenString)(nil), (*BootstrapTokenString)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_BootstrapTokenString_To_upstreamv1beta1_BootstrapTokenString(a.(*v1beta1.BootstrapTokenString), b.(*BootstrapTokenString), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterConfiguration)(nil), (*ClusterConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterConfiguration_To_upstreamv1beta1_ClusterConfiguration(a.(*v1beta1.ClusterConfiguration), b.(*ClusterConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterStatus)(nil), (*v1beta1.ClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_upstreamv1beta1_ClusterStatus_To_v1beta1_ClusterStatus(a.(*ClusterStatus), b.(*v1beta1.ClusterStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterStatus)(nil), (*ClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterStatus_To_upstreamv1beta1_ClusterStatus(a.(*v1beta1.ClusterStatus), b.(*ClusterStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ControlPlaneComponent)(nil), (*v1beta1.ControlPlaneComponent)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_upstreamv1beta1_ControlPlaneComponent_To_v1beta1_ControlPlaneComponent(a.(*ControlPlaneComponent), b.(*v1beta1.ControlPlaneComponent), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ControlPlaneComponent)(nil), (*ControlPlaneComponent)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ControlPlaneComponent_To_upstreamv1beta1_ControlPlaneComponent(a.(*v1beta1.ControlPlaneComponent), b.(*ControlPlaneComponent), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.DNS)(nil), (*DNS)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_DNS_To_upstreamv1beta1_DNS(a.(*v1beta1.DNS), b.(*DNS), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Discovery)(nil), (*v1beta1.Discovery)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_upstreamv1beta1_Discovery_To_v1beta1_Discovery(a.(*Discovery), b.(*v1beta1.Discovery), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.Discovery)(nil), (*Discovery)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Discovery_To_upstreamv1beta1_Discovery(a.(*v1beta1.Discovery), b.(*Discovery), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Etcd)(nil), (*v1beta1.Etcd)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_upstreamv1beta1_Etcd_To_v1beta1_Etcd(a.(*Etcd), b.(*v1beta1.Etcd), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.Etcd)(nil), (*Etcd)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Etcd_To_upstreamv1beta1_Etcd(a.(*v1beta1.Etcd), b.(*Etcd), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ExternalEtcd)(nil), (*v1beta1.ExternalEtcd)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_upstreamv1beta1_ExternalEtcd_To_v1beta1_ExternalEtcd(a.(*ExternalEtcd), b.(*v1beta1.ExternalEtcd), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ExternalEtcd)(nil), (*ExternalEtcd)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ExternalEtcd_To_upstreamv1beta1_ExternalEtcd(a.(*v1beta1.ExternalEtcd), b.(*ExternalEtcd), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*FileDiscovery)(nil), (*v1beta1.FileDiscovery)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_upstreamv1beta1_FileDiscovery_To_v1beta1_FileDiscovery(a.(*FileDiscovery), b.(*v1beta1.FileDiscovery), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.FileDiscovery)(nil), (*FileDiscovery)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_FileDiscovery_To_upstreamv1beta1_FileDiscovery(a.(*v1beta1.FileDiscovery), b.(*FileDiscovery), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*HostPathMount)(nil), (*v1beta1.HostPathMount)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_upstreamv1beta1_HostPathMount_To_v1beta1_HostPathMount(a.(*HostPathMount), b.(*v1beta1.HostPathMount), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.HostPathMount)(nil), (*HostPathMount)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_HostPathMount_To_upstreamv1beta1_HostPathMount(a.(*v1beta1.HostPathMount), b.(*HostPathMount), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ImageMeta)(nil), (*v1beta1.ImageMeta)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_upstreamv1beta1_ImageMeta_To_v1beta1_ImageMeta(a.(*ImageMeta), b.(*v1beta1.ImageMeta), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ImageMeta)(nil), (*ImageMeta)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ImageMeta_To_upstreamv1beta1_ImageMeta(a.(*v1beta1.ImageMeta), b.(*ImageMeta), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*InitConfiguration)(nil), (*v1beta1.InitConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_upstreamv1beta1_InitConfiguration_To_v1beta1_InitConfiguration(a.(*InitConfiguration), b.(*v1beta1.InitConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*JoinConfiguration)(nil), (*v1beta1.JoinConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_upstreamv1beta1_JoinConfiguration_To_v1beta1_JoinConfiguration(a.(*JoinConfiguration), b.(*v1beta1.JoinConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*JoinControlPlane)(nil), (*v1beta1.JoinControlPlane)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_upstreamv1beta1_JoinControlPlane_To_v1beta1_JoinControlPlane(a.(*JoinControlPlane), b.(*v1beta1.JoinControlPlane), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.JoinControlPlane)(nil), (*JoinControlPlane)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_JoinControlPlane_To_upstreamv1beta1_JoinControlPlane(a.(*v1beta1.JoinControlPlane), b.(*JoinControlPlane), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*LocalEtcd)(nil), (*v1beta1.LocalEtcd)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_upstreamv1beta1_LocalEtcd_To_v1beta1_LocalEtcd(a.(*LocalEtcd), b.(*v1beta1.LocalEtcd), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.LocalEtcd)(nil), (*LocalEtcd)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_LocalEtcd_To_upstreamv1beta1_LocalEtcd(a.(*v1beta1.LocalEtcd), b.(*LocalEtcd), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Networking)(nil), (*v1beta1.Networking)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_upstreamv1beta1_Networking_To_v1beta1_Networking(a.(*Networking), b.(*v1beta1.Networking), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.Networking)(nil), (*Networking)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Networking_To_upstreamv1beta1_Networking(a.(*v1beta1.Networking), b.(*Networking), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*NodeRegistrationOptions)(nil), (*v1beta1.NodeRegistrationOptions)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_upstreamv1beta1_NodeRegistrationOptions_To_v1beta1_NodeRegistrationOptions(a.(*NodeRegistrationOptions), b.(*v1beta1.NodeRegistrationOptions), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*ClusterConfiguration)(nil), (*v1beta1.ClusterConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_upstreamv1beta1_ClusterConfiguration_To_v1beta1_ClusterConfiguration(a.(*ClusterConfiguration), b.(*v1beta1.ClusterConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*DNS)(nil), (*v1beta1.DNS)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_upstreamv1beta1_DNS_To_v1beta1_DNS(a.(*DNS), b.(*v1beta1.DNS), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.InitConfiguration)(nil), (*InitConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_InitConfiguration_To_upstreamv1beta1_InitConfiguration(a.(*v1beta1.InitConfiguration), b.(*InitConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.JoinConfiguration)(nil), (*JoinConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_JoinConfiguration_To_upstreamv1beta1_JoinConfiguration(a.(*v1beta1.JoinConfiguration), b.(*JoinConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.NodeRegistrationOptions)(nil), (*NodeRegistrationOptions)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_NodeRegistrationOptions_To_upstreamv1beta1_NodeRegistrationOptions(a.(*v1beta1.NodeRegistrationOptions), b.(*NodeRegistrationOptions), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_upstreamv1beta1_APIEndpoint_To_v1beta1_APIEndpoint(in *APIEndpoint, out *v1beta1.APIEndpoint, s conversion.Scope) error { - out.AdvertiseAddress = in.AdvertiseAddress - out.BindPort = in.BindPort - return nil -} - -// Convert_upstreamv1beta1_APIEndpoint_To_v1beta1_APIEndpoint is an autogenerated conversion function. -func Convert_upstreamv1beta1_APIEndpoint_To_v1beta1_APIEndpoint(in *APIEndpoint, out *v1beta1.APIEndpoint, s conversion.Scope) error { - return autoConvert_upstreamv1beta1_APIEndpoint_To_v1beta1_APIEndpoint(in, out, s) -} - -func autoConvert_v1beta1_APIEndpoint_To_upstreamv1beta1_APIEndpoint(in *v1beta1.APIEndpoint, out *APIEndpoint, s conversion.Scope) error { - out.AdvertiseAddress = in.AdvertiseAddress - out.BindPort = in.BindPort - return nil -} - -// Convert_v1beta1_APIEndpoint_To_upstreamv1beta1_APIEndpoint is an autogenerated conversion function. -func Convert_v1beta1_APIEndpoint_To_upstreamv1beta1_APIEndpoint(in *v1beta1.APIEndpoint, out *APIEndpoint, s conversion.Scope) error { - return autoConvert_v1beta1_APIEndpoint_To_upstreamv1beta1_APIEndpoint(in, out, s) -} - -func autoConvert_upstreamv1beta1_APIServer_To_v1beta1_APIServer(in *APIServer, out *v1beta1.APIServer, s conversion.Scope) error { - if err := Convert_upstreamv1beta1_ControlPlaneComponent_To_v1beta1_ControlPlaneComponent(&in.ControlPlaneComponent, &out.ControlPlaneComponent, s); err != nil { - return err - } - out.CertSANs = *(*[]string)(unsafe.Pointer(&in.CertSANs)) - out.TimeoutForControlPlane = (*v1.Duration)(unsafe.Pointer(in.TimeoutForControlPlane)) - return nil -} - -// Convert_upstreamv1beta1_APIServer_To_v1beta1_APIServer is an autogenerated conversion function. -func Convert_upstreamv1beta1_APIServer_To_v1beta1_APIServer(in *APIServer, out *v1beta1.APIServer, s conversion.Scope) error { - return autoConvert_upstreamv1beta1_APIServer_To_v1beta1_APIServer(in, out, s) -} - -func autoConvert_v1beta1_APIServer_To_upstreamv1beta1_APIServer(in *v1beta1.APIServer, out *APIServer, s conversion.Scope) error { - if err := Convert_v1beta1_ControlPlaneComponent_To_upstreamv1beta1_ControlPlaneComponent(&in.ControlPlaneComponent, &out.ControlPlaneComponent, s); err != nil { - return err - } - out.CertSANs = *(*[]string)(unsafe.Pointer(&in.CertSANs)) - out.TimeoutForControlPlane = (*v1.Duration)(unsafe.Pointer(in.TimeoutForControlPlane)) - return nil -} - -// Convert_v1beta1_APIServer_To_upstreamv1beta1_APIServer is an autogenerated conversion function. -func Convert_v1beta1_APIServer_To_upstreamv1beta1_APIServer(in *v1beta1.APIServer, out *APIServer, s conversion.Scope) error { - return autoConvert_v1beta1_APIServer_To_upstreamv1beta1_APIServer(in, out, s) -} - -func autoConvert_upstreamv1beta1_BootstrapToken_To_v1beta1_BootstrapToken(in *BootstrapToken, out *v1beta1.BootstrapToken, s conversion.Scope) error { - out.Token = (*v1beta1.BootstrapTokenString)(unsafe.Pointer(in.Token)) - out.Description = in.Description - out.TTL = (*v1.Duration)(unsafe.Pointer(in.TTL)) - out.Expires = (*v1.Time)(unsafe.Pointer(in.Expires)) - out.Usages = *(*[]string)(unsafe.Pointer(&in.Usages)) - out.Groups = *(*[]string)(unsafe.Pointer(&in.Groups)) - return nil -} - -// Convert_upstreamv1beta1_BootstrapToken_To_v1beta1_BootstrapToken is an autogenerated conversion function. -func Convert_upstreamv1beta1_BootstrapToken_To_v1beta1_BootstrapToken(in *BootstrapToken, out *v1beta1.BootstrapToken, s conversion.Scope) error { - return autoConvert_upstreamv1beta1_BootstrapToken_To_v1beta1_BootstrapToken(in, out, s) -} - -func autoConvert_v1beta1_BootstrapToken_To_upstreamv1beta1_BootstrapToken(in *v1beta1.BootstrapToken, out *BootstrapToken, s conversion.Scope) error { - out.Token = (*BootstrapTokenString)(unsafe.Pointer(in.Token)) - out.Description = in.Description - out.TTL = (*v1.Duration)(unsafe.Pointer(in.TTL)) - out.Expires = (*v1.Time)(unsafe.Pointer(in.Expires)) - out.Usages = *(*[]string)(unsafe.Pointer(&in.Usages)) - out.Groups = *(*[]string)(unsafe.Pointer(&in.Groups)) - return nil -} - -// Convert_v1beta1_BootstrapToken_To_upstreamv1beta1_BootstrapToken is an autogenerated conversion function. -func Convert_v1beta1_BootstrapToken_To_upstreamv1beta1_BootstrapToken(in *v1beta1.BootstrapToken, out *BootstrapToken, s conversion.Scope) error { - return autoConvert_v1beta1_BootstrapToken_To_upstreamv1beta1_BootstrapToken(in, out, s) -} - -func autoConvert_upstreamv1beta1_BootstrapTokenDiscovery_To_v1beta1_BootstrapTokenDiscovery(in *BootstrapTokenDiscovery, out *v1beta1.BootstrapTokenDiscovery, s conversion.Scope) error { - out.Token = in.Token - out.APIServerEndpoint = in.APIServerEndpoint - out.CACertHashes = *(*[]string)(unsafe.Pointer(&in.CACertHashes)) - out.UnsafeSkipCAVerification = in.UnsafeSkipCAVerification - return nil -} - -// Convert_upstreamv1beta1_BootstrapTokenDiscovery_To_v1beta1_BootstrapTokenDiscovery is an autogenerated conversion function. -func Convert_upstreamv1beta1_BootstrapTokenDiscovery_To_v1beta1_BootstrapTokenDiscovery(in *BootstrapTokenDiscovery, out *v1beta1.BootstrapTokenDiscovery, s conversion.Scope) error { - return autoConvert_upstreamv1beta1_BootstrapTokenDiscovery_To_v1beta1_BootstrapTokenDiscovery(in, out, s) -} - -func autoConvert_v1beta1_BootstrapTokenDiscovery_To_upstreamv1beta1_BootstrapTokenDiscovery(in *v1beta1.BootstrapTokenDiscovery, out *BootstrapTokenDiscovery, s conversion.Scope) error { - out.Token = in.Token - out.APIServerEndpoint = in.APIServerEndpoint - out.CACertHashes = *(*[]string)(unsafe.Pointer(&in.CACertHashes)) - out.UnsafeSkipCAVerification = in.UnsafeSkipCAVerification - return nil -} - -// Convert_v1beta1_BootstrapTokenDiscovery_To_upstreamv1beta1_BootstrapTokenDiscovery is an autogenerated conversion function. -func Convert_v1beta1_BootstrapTokenDiscovery_To_upstreamv1beta1_BootstrapTokenDiscovery(in *v1beta1.BootstrapTokenDiscovery, out *BootstrapTokenDiscovery, s conversion.Scope) error { - return autoConvert_v1beta1_BootstrapTokenDiscovery_To_upstreamv1beta1_BootstrapTokenDiscovery(in, out, s) -} - -func autoConvert_upstreamv1beta1_BootstrapTokenString_To_v1beta1_BootstrapTokenString(in *BootstrapTokenString, out *v1beta1.BootstrapTokenString, s conversion.Scope) error { - out.ID = in.ID - out.Secret = in.Secret - return nil -} - -// Convert_upstreamv1beta1_BootstrapTokenString_To_v1beta1_BootstrapTokenString is an autogenerated conversion function. -func Convert_upstreamv1beta1_BootstrapTokenString_To_v1beta1_BootstrapTokenString(in *BootstrapTokenString, out *v1beta1.BootstrapTokenString, s conversion.Scope) error { - return autoConvert_upstreamv1beta1_BootstrapTokenString_To_v1beta1_BootstrapTokenString(in, out, s) -} - -func autoConvert_v1beta1_BootstrapTokenString_To_upstreamv1beta1_BootstrapTokenString(in *v1beta1.BootstrapTokenString, out *BootstrapTokenString, s conversion.Scope) error { - out.ID = in.ID - out.Secret = in.Secret - return nil -} - -// Convert_v1beta1_BootstrapTokenString_To_upstreamv1beta1_BootstrapTokenString is an autogenerated conversion function. -func Convert_v1beta1_BootstrapTokenString_To_upstreamv1beta1_BootstrapTokenString(in *v1beta1.BootstrapTokenString, out *BootstrapTokenString, s conversion.Scope) error { - return autoConvert_v1beta1_BootstrapTokenString_To_upstreamv1beta1_BootstrapTokenString(in, out, s) -} - -func autoConvert_upstreamv1beta1_ClusterConfiguration_To_v1beta1_ClusterConfiguration(in *ClusterConfiguration, out *v1beta1.ClusterConfiguration, s conversion.Scope) error { - if err := Convert_upstreamv1beta1_Etcd_To_v1beta1_Etcd(&in.Etcd, &out.Etcd, s); err != nil { - return err - } - if err := Convert_upstreamv1beta1_Networking_To_v1beta1_Networking(&in.Networking, &out.Networking, s); err != nil { - return err - } - out.KubernetesVersion = in.KubernetesVersion - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint - if err := Convert_upstreamv1beta1_APIServer_To_v1beta1_APIServer(&in.APIServer, &out.APIServer, s); err != nil { - return err - } - if err := Convert_upstreamv1beta1_ControlPlaneComponent_To_v1beta1_ControlPlaneComponent(&in.ControllerManager, &out.ControllerManager, s); err != nil { - return err - } - if err := Convert_upstreamv1beta1_ControlPlaneComponent_To_v1beta1_ControlPlaneComponent(&in.Scheduler, &out.Scheduler, s); err != nil { - return err - } - if err := Convert_upstreamv1beta1_DNS_To_v1beta1_DNS(&in.DNS, &out.DNS, s); err != nil { - return err - } - out.CertificatesDir = in.CertificatesDir - out.ImageRepository = in.ImageRepository - // WARNING: in.UseHyperKubeImage requires manual conversion: does not exist in peer-type - out.FeatureGates = *(*map[string]bool)(unsafe.Pointer(&in.FeatureGates)) - out.ClusterName = in.ClusterName - return nil -} - -func autoConvert_v1beta1_ClusterConfiguration_To_upstreamv1beta1_ClusterConfiguration(in *v1beta1.ClusterConfiguration, out *ClusterConfiguration, s conversion.Scope) error { - if err := Convert_v1beta1_Etcd_To_upstreamv1beta1_Etcd(&in.Etcd, &out.Etcd, s); err != nil { - return err - } - if err := Convert_v1beta1_Networking_To_upstreamv1beta1_Networking(&in.Networking, &out.Networking, s); err != nil { - return err - } - out.KubernetesVersion = in.KubernetesVersion - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint - if err := Convert_v1beta1_APIServer_To_upstreamv1beta1_APIServer(&in.APIServer, &out.APIServer, s); err != nil { - return err - } - if err := Convert_v1beta1_ControlPlaneComponent_To_upstreamv1beta1_ControlPlaneComponent(&in.ControllerManager, &out.ControllerManager, s); err != nil { - return err - } - if err := Convert_v1beta1_ControlPlaneComponent_To_upstreamv1beta1_ControlPlaneComponent(&in.Scheduler, &out.Scheduler, s); err != nil { - return err - } - if err := Convert_v1beta1_DNS_To_upstreamv1beta1_DNS(&in.DNS, &out.DNS, s); err != nil { - return err - } - out.CertificatesDir = in.CertificatesDir - out.ImageRepository = in.ImageRepository - out.FeatureGates = *(*map[string]bool)(unsafe.Pointer(&in.FeatureGates)) - out.ClusterName = in.ClusterName - return nil -} - -// Convert_v1beta1_ClusterConfiguration_To_upstreamv1beta1_ClusterConfiguration is an autogenerated conversion function. -func Convert_v1beta1_ClusterConfiguration_To_upstreamv1beta1_ClusterConfiguration(in *v1beta1.ClusterConfiguration, out *ClusterConfiguration, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterConfiguration_To_upstreamv1beta1_ClusterConfiguration(in, out, s) -} - -func autoConvert_upstreamv1beta1_ClusterStatus_To_v1beta1_ClusterStatus(in *ClusterStatus, out *v1beta1.ClusterStatus, s conversion.Scope) error { - out.APIEndpoints = *(*map[string]v1beta1.APIEndpoint)(unsafe.Pointer(&in.APIEndpoints)) - return nil -} - -// Convert_upstreamv1beta1_ClusterStatus_To_v1beta1_ClusterStatus is an autogenerated conversion function. -func Convert_upstreamv1beta1_ClusterStatus_To_v1beta1_ClusterStatus(in *ClusterStatus, out *v1beta1.ClusterStatus, s conversion.Scope) error { - return autoConvert_upstreamv1beta1_ClusterStatus_To_v1beta1_ClusterStatus(in, out, s) -} - -func autoConvert_v1beta1_ClusterStatus_To_upstreamv1beta1_ClusterStatus(in *v1beta1.ClusterStatus, out *ClusterStatus, s conversion.Scope) error { - out.APIEndpoints = *(*map[string]APIEndpoint)(unsafe.Pointer(&in.APIEndpoints)) - return nil -} - -// Convert_v1beta1_ClusterStatus_To_upstreamv1beta1_ClusterStatus is an autogenerated conversion function. -func Convert_v1beta1_ClusterStatus_To_upstreamv1beta1_ClusterStatus(in *v1beta1.ClusterStatus, out *ClusterStatus, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterStatus_To_upstreamv1beta1_ClusterStatus(in, out, s) -} - -func autoConvert_upstreamv1beta1_ControlPlaneComponent_To_v1beta1_ControlPlaneComponent(in *ControlPlaneComponent, out *v1beta1.ControlPlaneComponent, s conversion.Scope) error { - out.ExtraArgs = *(*map[string]string)(unsafe.Pointer(&in.ExtraArgs)) - out.ExtraVolumes = *(*[]v1beta1.HostPathMount)(unsafe.Pointer(&in.ExtraVolumes)) - return nil -} - -// Convert_upstreamv1beta1_ControlPlaneComponent_To_v1beta1_ControlPlaneComponent is an autogenerated conversion function. -func Convert_upstreamv1beta1_ControlPlaneComponent_To_v1beta1_ControlPlaneComponent(in *ControlPlaneComponent, out *v1beta1.ControlPlaneComponent, s conversion.Scope) error { - return autoConvert_upstreamv1beta1_ControlPlaneComponent_To_v1beta1_ControlPlaneComponent(in, out, s) -} - -func autoConvert_v1beta1_ControlPlaneComponent_To_upstreamv1beta1_ControlPlaneComponent(in *v1beta1.ControlPlaneComponent, out *ControlPlaneComponent, s conversion.Scope) error { - out.ExtraArgs = *(*map[string]string)(unsafe.Pointer(&in.ExtraArgs)) - out.ExtraVolumes = *(*[]HostPathMount)(unsafe.Pointer(&in.ExtraVolumes)) - return nil -} - -// Convert_v1beta1_ControlPlaneComponent_To_upstreamv1beta1_ControlPlaneComponent is an autogenerated conversion function. -func Convert_v1beta1_ControlPlaneComponent_To_upstreamv1beta1_ControlPlaneComponent(in *v1beta1.ControlPlaneComponent, out *ControlPlaneComponent, s conversion.Scope) error { - return autoConvert_v1beta1_ControlPlaneComponent_To_upstreamv1beta1_ControlPlaneComponent(in, out, s) -} - -func autoConvert_upstreamv1beta1_DNS_To_v1beta1_DNS(in *DNS, out *v1beta1.DNS, s conversion.Scope) error { - // WARNING: in.Type requires manual conversion: does not exist in peer-type - if err := Convert_upstreamv1beta1_ImageMeta_To_v1beta1_ImageMeta(&in.ImageMeta, &out.ImageMeta, s); err != nil { - return err - } - return nil -} - -func autoConvert_v1beta1_DNS_To_upstreamv1beta1_DNS(in *v1beta1.DNS, out *DNS, s conversion.Scope) error { - if err := Convert_v1beta1_ImageMeta_To_upstreamv1beta1_ImageMeta(&in.ImageMeta, &out.ImageMeta, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_DNS_To_upstreamv1beta1_DNS is an autogenerated conversion function. -func Convert_v1beta1_DNS_To_upstreamv1beta1_DNS(in *v1beta1.DNS, out *DNS, s conversion.Scope) error { - return autoConvert_v1beta1_DNS_To_upstreamv1beta1_DNS(in, out, s) -} - -func autoConvert_upstreamv1beta1_Discovery_To_v1beta1_Discovery(in *Discovery, out *v1beta1.Discovery, s conversion.Scope) error { - out.BootstrapToken = (*v1beta1.BootstrapTokenDiscovery)(unsafe.Pointer(in.BootstrapToken)) - out.File = (*v1beta1.FileDiscovery)(unsafe.Pointer(in.File)) - out.TLSBootstrapToken = in.TLSBootstrapToken - out.Timeout = (*v1.Duration)(unsafe.Pointer(in.Timeout)) - return nil -} - -// Convert_upstreamv1beta1_Discovery_To_v1beta1_Discovery is an autogenerated conversion function. -func Convert_upstreamv1beta1_Discovery_To_v1beta1_Discovery(in *Discovery, out *v1beta1.Discovery, s conversion.Scope) error { - return autoConvert_upstreamv1beta1_Discovery_To_v1beta1_Discovery(in, out, s) -} - -func autoConvert_v1beta1_Discovery_To_upstreamv1beta1_Discovery(in *v1beta1.Discovery, out *Discovery, s conversion.Scope) error { - out.BootstrapToken = (*BootstrapTokenDiscovery)(unsafe.Pointer(in.BootstrapToken)) - out.File = (*FileDiscovery)(unsafe.Pointer(in.File)) - out.TLSBootstrapToken = in.TLSBootstrapToken - out.Timeout = (*v1.Duration)(unsafe.Pointer(in.Timeout)) - return nil -} - -// Convert_v1beta1_Discovery_To_upstreamv1beta1_Discovery is an autogenerated conversion function. -func Convert_v1beta1_Discovery_To_upstreamv1beta1_Discovery(in *v1beta1.Discovery, out *Discovery, s conversion.Scope) error { - return autoConvert_v1beta1_Discovery_To_upstreamv1beta1_Discovery(in, out, s) -} - -func autoConvert_upstreamv1beta1_Etcd_To_v1beta1_Etcd(in *Etcd, out *v1beta1.Etcd, s conversion.Scope) error { - out.Local = (*v1beta1.LocalEtcd)(unsafe.Pointer(in.Local)) - out.External = (*v1beta1.ExternalEtcd)(unsafe.Pointer(in.External)) - return nil -} - -// Convert_upstreamv1beta1_Etcd_To_v1beta1_Etcd is an autogenerated conversion function. -func Convert_upstreamv1beta1_Etcd_To_v1beta1_Etcd(in *Etcd, out *v1beta1.Etcd, s conversion.Scope) error { - return autoConvert_upstreamv1beta1_Etcd_To_v1beta1_Etcd(in, out, s) -} - -func autoConvert_v1beta1_Etcd_To_upstreamv1beta1_Etcd(in *v1beta1.Etcd, out *Etcd, s conversion.Scope) error { - out.Local = (*LocalEtcd)(unsafe.Pointer(in.Local)) - out.External = (*ExternalEtcd)(unsafe.Pointer(in.External)) - return nil -} - -// Convert_v1beta1_Etcd_To_upstreamv1beta1_Etcd is an autogenerated conversion function. -func Convert_v1beta1_Etcd_To_upstreamv1beta1_Etcd(in *v1beta1.Etcd, out *Etcd, s conversion.Scope) error { - return autoConvert_v1beta1_Etcd_To_upstreamv1beta1_Etcd(in, out, s) -} - -func autoConvert_upstreamv1beta1_ExternalEtcd_To_v1beta1_ExternalEtcd(in *ExternalEtcd, out *v1beta1.ExternalEtcd, s conversion.Scope) error { - out.Endpoints = *(*[]string)(unsafe.Pointer(&in.Endpoints)) - out.CAFile = in.CAFile - out.CertFile = in.CertFile - out.KeyFile = in.KeyFile - return nil -} - -// Convert_upstreamv1beta1_ExternalEtcd_To_v1beta1_ExternalEtcd is an autogenerated conversion function. -func Convert_upstreamv1beta1_ExternalEtcd_To_v1beta1_ExternalEtcd(in *ExternalEtcd, out *v1beta1.ExternalEtcd, s conversion.Scope) error { - return autoConvert_upstreamv1beta1_ExternalEtcd_To_v1beta1_ExternalEtcd(in, out, s) -} - -func autoConvert_v1beta1_ExternalEtcd_To_upstreamv1beta1_ExternalEtcd(in *v1beta1.ExternalEtcd, out *ExternalEtcd, s conversion.Scope) error { - out.Endpoints = *(*[]string)(unsafe.Pointer(&in.Endpoints)) - out.CAFile = in.CAFile - out.CertFile = in.CertFile - out.KeyFile = in.KeyFile - return nil -} - -// Convert_v1beta1_ExternalEtcd_To_upstreamv1beta1_ExternalEtcd is an autogenerated conversion function. -func Convert_v1beta1_ExternalEtcd_To_upstreamv1beta1_ExternalEtcd(in *v1beta1.ExternalEtcd, out *ExternalEtcd, s conversion.Scope) error { - return autoConvert_v1beta1_ExternalEtcd_To_upstreamv1beta1_ExternalEtcd(in, out, s) -} - -func autoConvert_upstreamv1beta1_FileDiscovery_To_v1beta1_FileDiscovery(in *FileDiscovery, out *v1beta1.FileDiscovery, s conversion.Scope) error { - out.KubeConfigPath = in.KubeConfigPath - return nil -} - -// Convert_upstreamv1beta1_FileDiscovery_To_v1beta1_FileDiscovery is an autogenerated conversion function. -func Convert_upstreamv1beta1_FileDiscovery_To_v1beta1_FileDiscovery(in *FileDiscovery, out *v1beta1.FileDiscovery, s conversion.Scope) error { - return autoConvert_upstreamv1beta1_FileDiscovery_To_v1beta1_FileDiscovery(in, out, s) -} - -func autoConvert_v1beta1_FileDiscovery_To_upstreamv1beta1_FileDiscovery(in *v1beta1.FileDiscovery, out *FileDiscovery, s conversion.Scope) error { - out.KubeConfigPath = in.KubeConfigPath - return nil -} - -// Convert_v1beta1_FileDiscovery_To_upstreamv1beta1_FileDiscovery is an autogenerated conversion function. -func Convert_v1beta1_FileDiscovery_To_upstreamv1beta1_FileDiscovery(in *v1beta1.FileDiscovery, out *FileDiscovery, s conversion.Scope) error { - return autoConvert_v1beta1_FileDiscovery_To_upstreamv1beta1_FileDiscovery(in, out, s) -} - -func autoConvert_upstreamv1beta1_HostPathMount_To_v1beta1_HostPathMount(in *HostPathMount, out *v1beta1.HostPathMount, s conversion.Scope) error { - out.Name = in.Name - out.HostPath = in.HostPath - out.MountPath = in.MountPath - out.ReadOnly = in.ReadOnly - out.PathType = corev1.HostPathType(in.PathType) - return nil -} - -// Convert_upstreamv1beta1_HostPathMount_To_v1beta1_HostPathMount is an autogenerated conversion function. -func Convert_upstreamv1beta1_HostPathMount_To_v1beta1_HostPathMount(in *HostPathMount, out *v1beta1.HostPathMount, s conversion.Scope) error { - return autoConvert_upstreamv1beta1_HostPathMount_To_v1beta1_HostPathMount(in, out, s) -} - -func autoConvert_v1beta1_HostPathMount_To_upstreamv1beta1_HostPathMount(in *v1beta1.HostPathMount, out *HostPathMount, s conversion.Scope) error { - out.Name = in.Name - out.HostPath = in.HostPath - out.MountPath = in.MountPath - out.ReadOnly = in.ReadOnly - out.PathType = corev1.HostPathType(in.PathType) - return nil -} - -// Convert_v1beta1_HostPathMount_To_upstreamv1beta1_HostPathMount is an autogenerated conversion function. -func Convert_v1beta1_HostPathMount_To_upstreamv1beta1_HostPathMount(in *v1beta1.HostPathMount, out *HostPathMount, s conversion.Scope) error { - return autoConvert_v1beta1_HostPathMount_To_upstreamv1beta1_HostPathMount(in, out, s) -} - -func autoConvert_upstreamv1beta1_ImageMeta_To_v1beta1_ImageMeta(in *ImageMeta, out *v1beta1.ImageMeta, s conversion.Scope) error { - out.ImageRepository = in.ImageRepository - out.ImageTag = in.ImageTag - return nil -} - -// Convert_upstreamv1beta1_ImageMeta_To_v1beta1_ImageMeta is an autogenerated conversion function. -func Convert_upstreamv1beta1_ImageMeta_To_v1beta1_ImageMeta(in *ImageMeta, out *v1beta1.ImageMeta, s conversion.Scope) error { - return autoConvert_upstreamv1beta1_ImageMeta_To_v1beta1_ImageMeta(in, out, s) -} - -func autoConvert_v1beta1_ImageMeta_To_upstreamv1beta1_ImageMeta(in *v1beta1.ImageMeta, out *ImageMeta, s conversion.Scope) error { - out.ImageRepository = in.ImageRepository - out.ImageTag = in.ImageTag - return nil -} - -// Convert_v1beta1_ImageMeta_To_upstreamv1beta1_ImageMeta is an autogenerated conversion function. -func Convert_v1beta1_ImageMeta_To_upstreamv1beta1_ImageMeta(in *v1beta1.ImageMeta, out *ImageMeta, s conversion.Scope) error { - return autoConvert_v1beta1_ImageMeta_To_upstreamv1beta1_ImageMeta(in, out, s) -} - -func autoConvert_upstreamv1beta1_InitConfiguration_To_v1beta1_InitConfiguration(in *InitConfiguration, out *v1beta1.InitConfiguration, s conversion.Scope) error { - out.BootstrapTokens = *(*[]v1beta1.BootstrapToken)(unsafe.Pointer(&in.BootstrapTokens)) - if err := Convert_upstreamv1beta1_NodeRegistrationOptions_To_v1beta1_NodeRegistrationOptions(&in.NodeRegistration, &out.NodeRegistration, s); err != nil { - return err - } - if err := Convert_upstreamv1beta1_APIEndpoint_To_v1beta1_APIEndpoint(&in.LocalAPIEndpoint, &out.LocalAPIEndpoint, s); err != nil { - return err - } - return nil -} - -// Convert_upstreamv1beta1_InitConfiguration_To_v1beta1_InitConfiguration is an autogenerated conversion function. -func Convert_upstreamv1beta1_InitConfiguration_To_v1beta1_InitConfiguration(in *InitConfiguration, out *v1beta1.InitConfiguration, s conversion.Scope) error { - return autoConvert_upstreamv1beta1_InitConfiguration_To_v1beta1_InitConfiguration(in, out, s) -} - -func autoConvert_v1beta1_InitConfiguration_To_upstreamv1beta1_InitConfiguration(in *v1beta1.InitConfiguration, out *InitConfiguration, s conversion.Scope) error { - out.BootstrapTokens = *(*[]BootstrapToken)(unsafe.Pointer(&in.BootstrapTokens)) - if err := Convert_v1beta1_NodeRegistrationOptions_To_upstreamv1beta1_NodeRegistrationOptions(&in.NodeRegistration, &out.NodeRegistration, s); err != nil { - return err - } - if err := Convert_v1beta1_APIEndpoint_To_upstreamv1beta1_APIEndpoint(&in.LocalAPIEndpoint, &out.LocalAPIEndpoint, s); err != nil { - return err - } - // WARNING: in.SkipPhases requires manual conversion: does not exist in peer-type - // WARNING: in.Patches requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_upstreamv1beta1_JoinConfiguration_To_v1beta1_JoinConfiguration(in *JoinConfiguration, out *v1beta1.JoinConfiguration, s conversion.Scope) error { - if err := Convert_upstreamv1beta1_NodeRegistrationOptions_To_v1beta1_NodeRegistrationOptions(&in.NodeRegistration, &out.NodeRegistration, s); err != nil { - return err - } - out.CACertPath = in.CACertPath - if err := Convert_upstreamv1beta1_Discovery_To_v1beta1_Discovery(&in.Discovery, &out.Discovery, s); err != nil { - return err - } - out.ControlPlane = (*v1beta1.JoinControlPlane)(unsafe.Pointer(in.ControlPlane)) - return nil -} - -// Convert_upstreamv1beta1_JoinConfiguration_To_v1beta1_JoinConfiguration is an autogenerated conversion function. -func Convert_upstreamv1beta1_JoinConfiguration_To_v1beta1_JoinConfiguration(in *JoinConfiguration, out *v1beta1.JoinConfiguration, s conversion.Scope) error { - return autoConvert_upstreamv1beta1_JoinConfiguration_To_v1beta1_JoinConfiguration(in, out, s) -} - -func autoConvert_v1beta1_JoinConfiguration_To_upstreamv1beta1_JoinConfiguration(in *v1beta1.JoinConfiguration, out *JoinConfiguration, s conversion.Scope) error { - if err := Convert_v1beta1_NodeRegistrationOptions_To_upstreamv1beta1_NodeRegistrationOptions(&in.NodeRegistration, &out.NodeRegistration, s); err != nil { - return err - } - out.CACertPath = in.CACertPath - if err := Convert_v1beta1_Discovery_To_upstreamv1beta1_Discovery(&in.Discovery, &out.Discovery, s); err != nil { - return err - } - out.ControlPlane = (*JoinControlPlane)(unsafe.Pointer(in.ControlPlane)) - // WARNING: in.SkipPhases requires manual conversion: does not exist in peer-type - // WARNING: in.Patches requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_upstreamv1beta1_JoinControlPlane_To_v1beta1_JoinControlPlane(in *JoinControlPlane, out *v1beta1.JoinControlPlane, s conversion.Scope) error { - if err := Convert_upstreamv1beta1_APIEndpoint_To_v1beta1_APIEndpoint(&in.LocalAPIEndpoint, &out.LocalAPIEndpoint, s); err != nil { - return err - } - return nil -} - -// Convert_upstreamv1beta1_JoinControlPlane_To_v1beta1_JoinControlPlane is an autogenerated conversion function. -func Convert_upstreamv1beta1_JoinControlPlane_To_v1beta1_JoinControlPlane(in *JoinControlPlane, out *v1beta1.JoinControlPlane, s conversion.Scope) error { - return autoConvert_upstreamv1beta1_JoinControlPlane_To_v1beta1_JoinControlPlane(in, out, s) -} - -func autoConvert_v1beta1_JoinControlPlane_To_upstreamv1beta1_JoinControlPlane(in *v1beta1.JoinControlPlane, out *JoinControlPlane, s conversion.Scope) error { - if err := Convert_v1beta1_APIEndpoint_To_upstreamv1beta1_APIEndpoint(&in.LocalAPIEndpoint, &out.LocalAPIEndpoint, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_JoinControlPlane_To_upstreamv1beta1_JoinControlPlane is an autogenerated conversion function. -func Convert_v1beta1_JoinControlPlane_To_upstreamv1beta1_JoinControlPlane(in *v1beta1.JoinControlPlane, out *JoinControlPlane, s conversion.Scope) error { - return autoConvert_v1beta1_JoinControlPlane_To_upstreamv1beta1_JoinControlPlane(in, out, s) -} - -func autoConvert_upstreamv1beta1_LocalEtcd_To_v1beta1_LocalEtcd(in *LocalEtcd, out *v1beta1.LocalEtcd, s conversion.Scope) error { - if err := Convert_upstreamv1beta1_ImageMeta_To_v1beta1_ImageMeta(&in.ImageMeta, &out.ImageMeta, s); err != nil { - return err - } - out.DataDir = in.DataDir - out.ExtraArgs = *(*map[string]string)(unsafe.Pointer(&in.ExtraArgs)) - out.ServerCertSANs = *(*[]string)(unsafe.Pointer(&in.ServerCertSANs)) - out.PeerCertSANs = *(*[]string)(unsafe.Pointer(&in.PeerCertSANs)) - return nil -} - -// Convert_upstreamv1beta1_LocalEtcd_To_v1beta1_LocalEtcd is an autogenerated conversion function. -func Convert_upstreamv1beta1_LocalEtcd_To_v1beta1_LocalEtcd(in *LocalEtcd, out *v1beta1.LocalEtcd, s conversion.Scope) error { - return autoConvert_upstreamv1beta1_LocalEtcd_To_v1beta1_LocalEtcd(in, out, s) -} - -func autoConvert_v1beta1_LocalEtcd_To_upstreamv1beta1_LocalEtcd(in *v1beta1.LocalEtcd, out *LocalEtcd, s conversion.Scope) error { - if err := Convert_v1beta1_ImageMeta_To_upstreamv1beta1_ImageMeta(&in.ImageMeta, &out.ImageMeta, s); err != nil { - return err - } - out.DataDir = in.DataDir - out.ExtraArgs = *(*map[string]string)(unsafe.Pointer(&in.ExtraArgs)) - out.ServerCertSANs = *(*[]string)(unsafe.Pointer(&in.ServerCertSANs)) - out.PeerCertSANs = *(*[]string)(unsafe.Pointer(&in.PeerCertSANs)) - return nil -} - -// Convert_v1beta1_LocalEtcd_To_upstreamv1beta1_LocalEtcd is an autogenerated conversion function. -func Convert_v1beta1_LocalEtcd_To_upstreamv1beta1_LocalEtcd(in *v1beta1.LocalEtcd, out *LocalEtcd, s conversion.Scope) error { - return autoConvert_v1beta1_LocalEtcd_To_upstreamv1beta1_LocalEtcd(in, out, s) -} - -func autoConvert_upstreamv1beta1_Networking_To_v1beta1_Networking(in *Networking, out *v1beta1.Networking, s conversion.Scope) error { - out.ServiceSubnet = in.ServiceSubnet - out.PodSubnet = in.PodSubnet - out.DNSDomain = in.DNSDomain - return nil -} - -// Convert_upstreamv1beta1_Networking_To_v1beta1_Networking is an autogenerated conversion function. -func Convert_upstreamv1beta1_Networking_To_v1beta1_Networking(in *Networking, out *v1beta1.Networking, s conversion.Scope) error { - return autoConvert_upstreamv1beta1_Networking_To_v1beta1_Networking(in, out, s) -} - -func autoConvert_v1beta1_Networking_To_upstreamv1beta1_Networking(in *v1beta1.Networking, out *Networking, s conversion.Scope) error { - out.ServiceSubnet = in.ServiceSubnet - out.PodSubnet = in.PodSubnet - out.DNSDomain = in.DNSDomain - return nil -} - -// Convert_v1beta1_Networking_To_upstreamv1beta1_Networking is an autogenerated conversion function. -func Convert_v1beta1_Networking_To_upstreamv1beta1_Networking(in *v1beta1.Networking, out *Networking, s conversion.Scope) error { - return autoConvert_v1beta1_Networking_To_upstreamv1beta1_Networking(in, out, s) -} - -func autoConvert_upstreamv1beta1_NodeRegistrationOptions_To_v1beta1_NodeRegistrationOptions(in *NodeRegistrationOptions, out *v1beta1.NodeRegistrationOptions, s conversion.Scope) error { - out.Name = in.Name - out.CRISocket = in.CRISocket - out.Taints = *(*[]corev1.Taint)(unsafe.Pointer(&in.Taints)) - out.KubeletExtraArgs = *(*map[string]string)(unsafe.Pointer(&in.KubeletExtraArgs)) - return nil -} - -// Convert_upstreamv1beta1_NodeRegistrationOptions_To_v1beta1_NodeRegistrationOptions is an autogenerated conversion function. -func Convert_upstreamv1beta1_NodeRegistrationOptions_To_v1beta1_NodeRegistrationOptions(in *NodeRegistrationOptions, out *v1beta1.NodeRegistrationOptions, s conversion.Scope) error { - return autoConvert_upstreamv1beta1_NodeRegistrationOptions_To_v1beta1_NodeRegistrationOptions(in, out, s) -} - -func autoConvert_v1beta1_NodeRegistrationOptions_To_upstreamv1beta1_NodeRegistrationOptions(in *v1beta1.NodeRegistrationOptions, out *NodeRegistrationOptions, s conversion.Scope) error { - out.Name = in.Name - out.CRISocket = in.CRISocket - out.Taints = *(*[]corev1.Taint)(unsafe.Pointer(&in.Taints)) - out.KubeletExtraArgs = *(*map[string]string)(unsafe.Pointer(&in.KubeletExtraArgs)) - // WARNING: in.IgnorePreflightErrors requires manual conversion: does not exist in peer-type - // WARNING: in.ImagePullPolicy requires manual conversion: does not exist in peer-type - return nil -} diff --git a/bootstrap/kubeadm/types/upstreamv1beta1/zz_generated.deepcopy.go b/bootstrap/kubeadm/types/upstreamv1beta1/zz_generated.deepcopy.go deleted file mode 100644 index aeaaa3afff3d..000000000000 --- a/bootstrap/kubeadm/types/upstreamv1beta1/zz_generated.deepcopy.go +++ /dev/null @@ -1,530 +0,0 @@ -//go:build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package upstreamv1beta1 - -import ( - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *APIEndpoint) DeepCopyInto(out *APIEndpoint) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIEndpoint. -func (in *APIEndpoint) DeepCopy() *APIEndpoint { - if in == nil { - return nil - } - out := new(APIEndpoint) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *APIServer) DeepCopyInto(out *APIServer) { - *out = *in - in.ControlPlaneComponent.DeepCopyInto(&out.ControlPlaneComponent) - if in.CertSANs != nil { - in, out := &in.CertSANs, &out.CertSANs - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.TimeoutForControlPlane != nil { - in, out := &in.TimeoutForControlPlane, &out.TimeoutForControlPlane - *out = new(v1.Duration) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIServer. -func (in *APIServer) DeepCopy() *APIServer { - if in == nil { - return nil - } - out := new(APIServer) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BootstrapToken) DeepCopyInto(out *BootstrapToken) { - *out = *in - if in.Token != nil { - in, out := &in.Token, &out.Token - *out = new(BootstrapTokenString) - **out = **in - } - if in.TTL != nil { - in, out := &in.TTL, &out.TTL - *out = new(v1.Duration) - **out = **in - } - if in.Expires != nil { - in, out := &in.Expires, &out.Expires - *out = (*in).DeepCopy() - } - if in.Usages != nil { - in, out := &in.Usages, &out.Usages - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Groups != nil { - in, out := &in.Groups, &out.Groups - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BootstrapToken. -func (in *BootstrapToken) DeepCopy() *BootstrapToken { - if in == nil { - return nil - } - out := new(BootstrapToken) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BootstrapTokenDiscovery) DeepCopyInto(out *BootstrapTokenDiscovery) { - *out = *in - if in.CACertHashes != nil { - in, out := &in.CACertHashes, &out.CACertHashes - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BootstrapTokenDiscovery. -func (in *BootstrapTokenDiscovery) DeepCopy() *BootstrapTokenDiscovery { - if in == nil { - return nil - } - out := new(BootstrapTokenDiscovery) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BootstrapTokenString) DeepCopyInto(out *BootstrapTokenString) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BootstrapTokenString. -func (in *BootstrapTokenString) DeepCopy() *BootstrapTokenString { - if in == nil { - return nil - } - out := new(BootstrapTokenString) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterConfiguration) DeepCopyInto(out *ClusterConfiguration) { - *out = *in - out.TypeMeta = in.TypeMeta - in.Etcd.DeepCopyInto(&out.Etcd) - out.Networking = in.Networking - in.APIServer.DeepCopyInto(&out.APIServer) - in.ControllerManager.DeepCopyInto(&out.ControllerManager) - in.Scheduler.DeepCopyInto(&out.Scheduler) - out.DNS = in.DNS - if in.FeatureGates != nil { - in, out := &in.FeatureGates, &out.FeatureGates - *out = make(map[string]bool, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterConfiguration. -func (in *ClusterConfiguration) DeepCopy() *ClusterConfiguration { - if in == nil { - return nil - } - out := new(ClusterConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterConfiguration) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus) { - *out = *in - out.TypeMeta = in.TypeMeta - if in.APIEndpoints != nil { - in, out := &in.APIEndpoints, &out.APIEndpoints - *out = make(map[string]APIEndpoint, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStatus. -func (in *ClusterStatus) DeepCopy() *ClusterStatus { - if in == nil { - return nil - } - out := new(ClusterStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterStatus) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ControlPlaneComponent) DeepCopyInto(out *ControlPlaneComponent) { - *out = *in - if in.ExtraArgs != nil { - in, out := &in.ExtraArgs, &out.ExtraArgs - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.ExtraVolumes != nil { - in, out := &in.ExtraVolumes, &out.ExtraVolumes - *out = make([]HostPathMount, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneComponent. -func (in *ControlPlaneComponent) DeepCopy() *ControlPlaneComponent { - if in == nil { - return nil - } - out := new(ControlPlaneComponent) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DNS) DeepCopyInto(out *DNS) { - *out = *in - out.ImageMeta = in.ImageMeta -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNS. -func (in *DNS) DeepCopy() *DNS { - if in == nil { - return nil - } - out := new(DNS) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Discovery) DeepCopyInto(out *Discovery) { - *out = *in - if in.BootstrapToken != nil { - in, out := &in.BootstrapToken, &out.BootstrapToken - *out = new(BootstrapTokenDiscovery) - (*in).DeepCopyInto(*out) - } - if in.File != nil { - in, out := &in.File, &out.File - *out = new(FileDiscovery) - **out = **in - } - if in.Timeout != nil { - in, out := &in.Timeout, &out.Timeout - *out = new(v1.Duration) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Discovery. -func (in *Discovery) DeepCopy() *Discovery { - if in == nil { - return nil - } - out := new(Discovery) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Etcd) DeepCopyInto(out *Etcd) { - *out = *in - if in.Local != nil { - in, out := &in.Local, &out.Local - *out = new(LocalEtcd) - (*in).DeepCopyInto(*out) - } - if in.External != nil { - in, out := &in.External, &out.External - *out = new(ExternalEtcd) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Etcd. -func (in *Etcd) DeepCopy() *Etcd { - if in == nil { - return nil - } - out := new(Etcd) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExternalEtcd) DeepCopyInto(out *ExternalEtcd) { - *out = *in - if in.Endpoints != nil { - in, out := &in.Endpoints, &out.Endpoints - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalEtcd. -func (in *ExternalEtcd) DeepCopy() *ExternalEtcd { - if in == nil { - return nil - } - out := new(ExternalEtcd) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FileDiscovery) DeepCopyInto(out *FileDiscovery) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FileDiscovery. -func (in *FileDiscovery) DeepCopy() *FileDiscovery { - if in == nil { - return nil - } - out := new(FileDiscovery) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HostPathMount) DeepCopyInto(out *HostPathMount) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostPathMount. -func (in *HostPathMount) DeepCopy() *HostPathMount { - if in == nil { - return nil - } - out := new(HostPathMount) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ImageMeta) DeepCopyInto(out *ImageMeta) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageMeta. -func (in *ImageMeta) DeepCopy() *ImageMeta { - if in == nil { - return nil - } - out := new(ImageMeta) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *InitConfiguration) DeepCopyInto(out *InitConfiguration) { - *out = *in - out.TypeMeta = in.TypeMeta - if in.BootstrapTokens != nil { - in, out := &in.BootstrapTokens, &out.BootstrapTokens - *out = make([]BootstrapToken, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - in.NodeRegistration.DeepCopyInto(&out.NodeRegistration) - out.LocalAPIEndpoint = in.LocalAPIEndpoint -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InitConfiguration. -func (in *InitConfiguration) DeepCopy() *InitConfiguration { - if in == nil { - return nil - } - out := new(InitConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *InitConfiguration) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *JoinConfiguration) DeepCopyInto(out *JoinConfiguration) { - *out = *in - out.TypeMeta = in.TypeMeta - in.NodeRegistration.DeepCopyInto(&out.NodeRegistration) - in.Discovery.DeepCopyInto(&out.Discovery) - if in.ControlPlane != nil { - in, out := &in.ControlPlane, &out.ControlPlane - *out = new(JoinControlPlane) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JoinConfiguration. -func (in *JoinConfiguration) DeepCopy() *JoinConfiguration { - if in == nil { - return nil - } - out := new(JoinConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *JoinConfiguration) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *JoinControlPlane) DeepCopyInto(out *JoinControlPlane) { - *out = *in - out.LocalAPIEndpoint = in.LocalAPIEndpoint -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JoinControlPlane. -func (in *JoinControlPlane) DeepCopy() *JoinControlPlane { - if in == nil { - return nil - } - out := new(JoinControlPlane) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LocalEtcd) DeepCopyInto(out *LocalEtcd) { - *out = *in - out.ImageMeta = in.ImageMeta - if in.ExtraArgs != nil { - in, out := &in.ExtraArgs, &out.ExtraArgs - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.ServerCertSANs != nil { - in, out := &in.ServerCertSANs, &out.ServerCertSANs - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.PeerCertSANs != nil { - in, out := &in.PeerCertSANs, &out.PeerCertSANs - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalEtcd. -func (in *LocalEtcd) DeepCopy() *LocalEtcd { - if in == nil { - return nil - } - out := new(LocalEtcd) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Networking) DeepCopyInto(out *Networking) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Networking. -func (in *Networking) DeepCopy() *Networking { - if in == nil { - return nil - } - out := new(Networking) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeRegistrationOptions) DeepCopyInto(out *NodeRegistrationOptions) { - *out = *in - if in.Taints != nil { - in, out := &in.Taints, &out.Taints - *out = make([]corev1.Taint, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.KubeletExtraArgs != nil { - in, out := &in.KubeletExtraArgs, &out.KubeletExtraArgs - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeRegistrationOptions. -func (in *NodeRegistrationOptions) DeepCopy() *NodeRegistrationOptions { - if in == nil { - return nil - } - out := new(NodeRegistrationOptions) - in.DeepCopyInto(out) - return out -} diff --git a/bootstrap/kubeadm/types/utils.go b/bootstrap/kubeadm/types/utils.go index 7372d9378be7..57505e7ec819 100644 --- a/bootstrap/kubeadm/types/utils.go +++ b/bootstrap/kubeadm/types/utils.go @@ -27,50 +27,41 @@ import ( "sigs.k8s.io/controller-runtime/pkg/scheme" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" - "sigs.k8s.io/cluster-api/bootstrap/kubeadm/types/upstreamv1beta1" "sigs.k8s.io/cluster-api/bootstrap/kubeadm/types/upstreamv1beta2" "sigs.k8s.io/cluster-api/bootstrap/kubeadm/types/upstreamv1beta3" "sigs.k8s.io/cluster-api/util/version" ) var ( - v1beta1KubeadmVersion = semver.MustParse("1.13.0") v1beta2KubeadmVersion = semver.MustParse("1.15.0") v1beta3KubeadmVersion = semver.MustParse("1.22.0") clusterConfigurationVersionTypeMap = map[schema.GroupVersion]conversion.Convertible{ upstreamv1beta3.GroupVersion: &upstreamv1beta3.ClusterConfiguration{}, upstreamv1beta2.GroupVersion: &upstreamv1beta2.ClusterConfiguration{}, - upstreamv1beta1.GroupVersion: &upstreamv1beta1.ClusterConfiguration{}, } clusterStatusVersionTypeMap = map[schema.GroupVersion]conversion.Convertible{ // ClusterStatus has been removed in v1beta3, so we don't need an entry for v1beta3 upstreamv1beta2.GroupVersion: &upstreamv1beta2.ClusterStatus{}, - upstreamv1beta1.GroupVersion: &upstreamv1beta1.ClusterStatus{}, } initConfigurationVersionTypeMap = map[schema.GroupVersion]conversion.Convertible{ upstreamv1beta3.GroupVersion: &upstreamv1beta3.InitConfiguration{}, upstreamv1beta2.GroupVersion: &upstreamv1beta2.InitConfiguration{}, - upstreamv1beta1.GroupVersion: &upstreamv1beta1.InitConfiguration{}, } joinConfigurationVersionTypeMap = map[schema.GroupVersion]conversion.Convertible{ upstreamv1beta3.GroupVersion: &upstreamv1beta3.JoinConfiguration{}, upstreamv1beta2.GroupVersion: &upstreamv1beta2.JoinConfiguration{}, - upstreamv1beta1.GroupVersion: &upstreamv1beta1.JoinConfiguration{}, } ) // KubeVersionToKubeadmAPIGroupVersion maps a Kubernetes version to the correct Kubeadm API Group supported. func KubeVersionToKubeadmAPIGroupVersion(v semver.Version) (schema.GroupVersion, error) { switch { - case version.Compare(v, v1beta1KubeadmVersion, version.WithoutPreReleases()) < 0: - return schema.GroupVersion{}, errors.New("the bootstrap provider for kubeadm doesn't support Kubernetes version lower than v1.13.0") case version.Compare(v, v1beta2KubeadmVersion, version.WithoutPreReleases()) < 0: - // NOTE: All the Kubernetes version >= v1.13 and < v1.15 should use the kubeadm API version v1beta1 - return upstreamv1beta1.GroupVersion, nil + return schema.GroupVersion{}, errors.New("the bootstrap provider for kubeadm doesn't support Kubernetes version lower than v1.15.0") case version.Compare(v, v1beta3KubeadmVersion, version.WithoutPreReleases()) < 0: // NOTE: All the Kubernetes version >= v1.15 and < v1.22 should use the kubeadm API version v1beta2 return upstreamv1beta2.GroupVersion, nil diff --git a/bootstrap/kubeadm/types/utils_test.go b/bootstrap/kubeadm/types/utils_test.go index 25af247aa3a4..49c9450b953c 100644 --- a/bootstrap/kubeadm/types/utils_test.go +++ b/bootstrap/kubeadm/types/utils_test.go @@ -25,7 +25,6 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" - "sigs.k8s.io/cluster-api/bootstrap/kubeadm/types/upstreamv1beta1" "sigs.k8s.io/cluster-api/bootstrap/kubeadm/types/upstreamv1beta2" "sigs.k8s.io/cluster-api/bootstrap/kubeadm/types/upstreamv1beta3" ) @@ -49,28 +48,11 @@ func TestKubeVersionToKubeadmAPIGroupVersion(t *testing.T) { wantErr: true, }, { - name: "pass with minimum kubernetes alpha version for kubeadm API v1beta1", - args: args{ - version: semver.MustParse("1.13.0-alpha.0.734+ba502ee555924a"), - }, - want: upstreamv1beta1.GroupVersion, - wantErr: false, - }, - { - name: "pass with minimum kubernetes version for kubeadm API v1beta1", - args: args{ - version: semver.MustParse("1.13.0"), - }, - want: upstreamv1beta1.GroupVersion, - wantErr: false, - }, - { - name: "pass with kubernetes version for kubeadm API v1beta1", + name: "fails with kubernetes version for kubeadm API v1beta1", args: args{ version: semver.MustParse("1.14.99"), }, - want: upstreamv1beta1.GroupVersion, - wantErr: false, + wantErr: true, }, { name: "pass with minimum kubernetes alpha version for kubeadm API v1beta2", @@ -155,22 +137,6 @@ func TestMarshalClusterConfigurationForVersion(t *testing.T) { want string wantErr bool }{ - { - name: "Generates a v1beta1 kubeadm configuration", - args: args{ - capiObj: &bootstrapv1.ClusterConfiguration{}, - version: semver.MustParse("1.14.9"), - }, - want: "apiServer: {}\n" + - "apiVersion: kubeadm.k8s.io/v1beta1\n" + "" + - "controllerManager: {}\n" + - "dns: {}\n" + - "etcd: {}\n" + - "kind: ClusterConfiguration\n" + - "networking: {}\n" + - "scheduler: {}\n", - wantErr: false, - }, { name: "Generates a v1beta2 kubeadm configuration", args: args{ @@ -230,17 +196,6 @@ func TestMarshalClusterStatusForVersion(t *testing.T) { want string wantErr bool }{ - { - name: "Generates a v1beta1 kubeadm status", - args: args{ - capiObj: &bootstrapv1.ClusterStatus{}, - version: semver.MustParse("1.14.9"), - }, - want: "apiEndpoints: null\n" + - "apiVersion: kubeadm.k8s.io/v1beta1\n" + "" + - "kind: ClusterStatus\n", - wantErr: false, - }, { name: "Generates a v1beta2 kubeadm status", args: args{ @@ -287,20 +242,6 @@ func TestMarshalInitConfigurationForVersion(t *testing.T) { want string wantErr bool }{ - { - name: "Generates a v1beta1 kubeadm configuration", - args: args{ - capiObj: &bootstrapv1.InitConfiguration{}, - version: semver.MustParse("1.14.9"), - }, - want: "apiVersion: kubeadm.k8s.io/v1beta1\n" + - "kind: InitConfiguration\n" + - "localAPIEndpoint:\n" + - " advertiseAddress: \"\"\n" + - " bindPort: 0\n" + - "nodeRegistration: {}\n", - wantErr: false, - }, { name: "Generates a v1beta2 kubeadm configuration", args: args{ @@ -365,18 +306,6 @@ func TestMarshalJoinConfigurationForVersion(t *testing.T) { want string wantErr bool }{ - { - name: "Generates a v1beta1 kubeadm configuration", - args: args{ - capiObj: &bootstrapv1.JoinConfiguration{}, - version: semver.MustParse("1.14.9"), - }, - want: "apiVersion: kubeadm.k8s.io/v1beta1\n" + "" + - "discovery: {}\n" + - "kind: JoinConfiguration\n" + - "nodeRegistration: {}\n", - wantErr: false, - }, { name: "Generates a v1beta2 kubeadm configuration", args: args{ @@ -440,21 +369,6 @@ func TestUnmarshalClusterConfiguration(t *testing.T) { want *bootstrapv1.ClusterConfiguration wantErr bool }{ - { - name: "Parses a v1beta1 kubeadm configuration", - args: args{ - yaml: "apiServer: {}\n" + - "apiVersion: kubeadm.k8s.io/v1beta1\n" + "" + - "controllerManager: {}\n" + - "dns: {}\n" + - "etcd: {}\n" + - "kind: ClusterConfiguration\n" + - "networking: {}\n" + - "scheduler: {}\n", - }, - want: &bootstrapv1.ClusterConfiguration{}, - wantErr: false, - }, { name: "Parses a v1beta2 kubeadm configuration", args: args{ @@ -511,21 +425,11 @@ func TestUnmarshalClusterStatus(t *testing.T) { want *bootstrapv1.ClusterStatus wantErr bool }{ - { - name: "Parses a v1beta1 kubeadm configuration", - args: args{ - yaml: "apiEndpoints: null\n" + - "apiVersion: kubeadm.k8s.io/v1beta1\n" + "" + - "kind: ClusterStatus\n", - }, - want: &bootstrapv1.ClusterStatus{}, - wantErr: false, - }, { name: "Parses a v1beta2 kubeadm configuration", args: args{ yaml: "apiEndpoints: null\n" + - "apiVersion: kubeadm.k8s.io/v1beta1\n" + "" + + "apiVersion: kubeadm.k8s.io/v1beta2\n" + "" + "kind: ClusterStatus\n", }, want: &bootstrapv1.ClusterStatus{}, @@ -566,17 +470,6 @@ func TestUnmarshalInitConfiguration(t *testing.T) { want *bootstrapv1.InitConfiguration wantErr bool }{ - { - name: "Parses a v1beta1 kubeadm configuration", - args: args{ - yaml: "apiVersion: kubeadm.k8s.io/v1beta1\n" + "" + - "kind: InitConfiguration\n" + - "localAPIEndpoint: {}\n" + - "nodeRegistration: {}\n", - }, - want: &bootstrapv1.InitConfiguration{}, - wantErr: false, - }, { name: "Parses a v1beta2 kubeadm configuration", args: args{ @@ -625,17 +518,6 @@ func TestUnmarshalJoinConfiguration(t *testing.T) { want *bootstrapv1.JoinConfiguration wantErr bool }{ - { - name: "Parses a v1beta1 kubeadm configuration", - args: args{ - yaml: "apiVersion: kubeadm.k8s.io/v1beta1\n" + "" + - "caCertPath: \"\"\n" + - "discovery: {}\n" + - "kind: JoinConfiguration\n", - }, - want: &bootstrapv1.JoinConfiguration{}, - wantErr: false, - }, { name: "Parses a v1beta2 kubeadm configuration", args: args{ diff --git a/controlplane/kubeadm/api/v1alpha4/conversion_test.go b/controlplane/kubeadm/api/v1alpha4/conversion_test.go index 988e00fa1b2e..8dc6687a1456 100644 --- a/controlplane/kubeadm/api/v1alpha4/conversion_test.go +++ b/controlplane/kubeadm/api/v1alpha4/conversion_test.go @@ -27,7 +27,6 @@ import ( clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" bootstrapv1alpha4 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" - "sigs.k8s.io/cluster-api/bootstrap/kubeadm/types/upstreamv1beta1" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" utilconversion "sigs.k8s.io/cluster-api/util/conversion" ) @@ -63,32 +62,17 @@ func fuzzFuncs(_ runtimeserializer.CodecFactory) []interface{} { // This function effectively disables any fuzzing for the token by setting // the values for ID and Secret to working alphanumeric values. return []interface{}{ - kubeadmBootstrapTokenStringFuzzer, cabpkBootstrapTokenStringFuzzer, - dnsFuzzer, kubeadmBootstrapTokenStringFuzzerV1Alpha4, kubeadmControlPlaneTemplateResourceSpecFuzzerV1Alpha4, } } -func kubeadmBootstrapTokenStringFuzzer(in *upstreamv1beta1.BootstrapTokenString, _ fuzz.Continue) { - in.ID = fakeID - in.Secret = fakeSecret -} - func cabpkBootstrapTokenStringFuzzer(in *bootstrapv1.BootstrapTokenString, _ fuzz.Continue) { in.ID = fakeID in.Secret = fakeSecret } -func dnsFuzzer(obj *upstreamv1beta1.DNS, c fuzz.Continue) { - c.FuzzNoCustom(obj) - - // TODO:(killianmuldoon) Assess whether we can remove this with the removal of v1alpha3. - // DNS.Type does not exist in v1alpha4, so setting it to empty string in order to avoid v1alpha3 --> v1alpha4 --> v1alpha3 round trip errors. - obj.Type = "" -} - func kubeadmBootstrapTokenStringFuzzerV1Alpha4(in *bootstrapv1alpha4.BootstrapTokenString, _ fuzz.Continue) { in.ID = fakeID in.Secret = fakeSecret diff --git a/controlplane/kubeadm/internal/workload_cluster_test.go b/controlplane/kubeadm/internal/workload_cluster_test.go index b0e900387f42..0c6358e88a06 100644 --- a/controlplane/kubeadm/internal/workload_cluster_test.go +++ b/controlplane/kubeadm/internal/workload_cluster_test.go @@ -638,7 +638,7 @@ func TestUpdateUpdateClusterConfigurationInKubeadmConfigMap(t *testing.T) { }, { name: "converts kubeadm api version during mutation if required", - version: semver.MustParse("1.17.2"), + version: semver.MustParse("1.28.0"), objs: []client.Object{&corev1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ Name: kubeadmConfigKey, @@ -646,14 +646,14 @@ func TestUpdateUpdateClusterConfigurationInKubeadmConfigMap(t *testing.T) { }, Data: map[string]string{ clusterConfigurationKey: yaml.Raw(` - apiVersion: kubeadm.k8s.io/v1beta1 + apiVersion: kubeadm.k8s.io/v1beta2 kind: ClusterConfiguration kubernetesVersion: v1.16.1 `), }, }}, mutator: func(c *bootstrapv1.ClusterConfiguration) { - c.KubernetesVersion = "v1.17.2" + c.KubernetesVersion = "v1.28.0" }, wantConfigMap: &corev1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ @@ -663,12 +663,12 @@ func TestUpdateUpdateClusterConfigurationInKubeadmConfigMap(t *testing.T) { Data: map[string]string{ clusterConfigurationKey: yaml.Raw(` apiServer: {} - apiVersion: kubeadm.k8s.io/v1beta2 + apiVersion: kubeadm.k8s.io/v1beta3 controllerManager: {} dns: {} etcd: {} kind: ClusterConfiguration - kubernetesVersion: v1.17.2 + kubernetesVersion: v1.28.0 networking: {} scheduler: {} `), @@ -821,46 +821,6 @@ func TestUpdateUpdateClusterStatusInKubeadmConfigMap(t *testing.T) { }, }, }, - { - name: "converts kubeadm api version during mutation if required", - version: semver.MustParse("1.17.2"), - objs: []client.Object{&corev1.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{ - Name: kubeadmConfigKey, - Namespace: metav1.NamespaceSystem, - }, - Data: map[string]string{ - clusterStatusKey: yaml.Raw(` - apiEndpoints: - ip-10-0-0-1.ec2.internal: - advertiseAddress: 10.0.0.1 - bindPort: 6443 - apiVersion: kubeadm.k8s.io/v1beta1 - kind: ClusterStatus - `), - }, - }}, - mutator: func(status *bootstrapv1.ClusterStatus) { - status.APIEndpoints["ip-10-0-0-2.ec2.internal"] = bootstrapv1.APIEndpoint{} - }, - wantConfigMap: &corev1.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{ - Name: kubeadmConfigKey, - Namespace: metav1.NamespaceSystem, - }, - Data: map[string]string{ - clusterStatusKey: yaml.Raw(` - apiEndpoints: - ip-10-0-0-1.ec2.internal: - advertiseAddress: 10.0.0.1 - bindPort: 6443 - ip-10-0-0-2.ec2.internal: {} - apiVersion: kubeadm.k8s.io/v1beta2 - kind: ClusterStatus - `), - }, - }, - }, } for _, tt := range tests { @@ -899,7 +859,7 @@ func TestUpdateKubernetesVersionInKubeadmConfigMap(t *testing.T) { name: "updates the config map and changes the kubeadm API version", version: semver.MustParse("1.17.2"), clusterConfigurationData: yaml.Raw(` - apiVersion: kubeadm.k8s.io/v1beta1 + apiVersion: kubeadm.k8s.io/v1beta2 kind: ClusterConfiguration kubernetesVersion: v1.16.1`), }, diff --git a/test/infrastructure/docker/internal/provisioning/cloudinit/adapter_test.go b/test/infrastructure/docker/internal/provisioning/cloudinit/adapter_test.go index 1a4fdcea89de..d8292a9ded2d 100644 --- a/test/infrastructure/docker/internal/provisioning/cloudinit/adapter_test.go +++ b/test/infrastructure/docker/internal/provisioning/cloudinit/adapter_test.go @@ -94,12 +94,12 @@ write_files: path: /etc/kubernetes/pki/sa.key permissions: '0600' - content: "---\napiServer:\n certSANs:\n - '10.0.0.223'\n - test1-apiserver-329764956.us-west-2.elb.amazonaws.com\n\ - \ extraArgs:\n cloud-provider: aws\napiVersion: kubeadm.k8s.io/v1beta1\n\ + \ extraArgs:\n cloud-provider: aws\napiVersion: kubeadm.k8s.io/v1beta2\n\ certificatesDir: \"\"\nclusterName: test1\ncontrolPlaneEndpoint: test1-apiserver-329764956.us-west-2.elb.amazonaws.com:6443\n\ controllerManager:\n extraArgs:\n cloud-provider: aws\ndns:\n type: \"\ \"\netcd: {}\nimageRepository: \"\"\nkind: ClusterConfiguration\nkubernetesVersion:\ - \ v1.13.6\nnetworking:\n dnsDomain: cluster.local\n podSubnet: 192.168.0.0/16\n\ - \ serviceSubnet: 10.96.0.0/12\nscheduler: {}\n\n---\napiVersion: kubeadm.k8s.io/v1beta1\n\ + \ v1.16.0\nnetworking:\n dnsDomain: cluster.local\n podSubnet: 192.168.0.0/16\n\ + \ serviceSubnet: 10.96.0.0/12\nscheduler: {}\n\n---\napiVersion: kubeadm.k8s.io/v1beta2\n\ kind: InitConfiguration\nlocalAPIEndpoint:\n advertiseAddress: \"\"\n bindPort:\ \ 0\nnodeRegistration:\n criSocket: unix:///var/run/containerd/containerd.sock\n\ \ kubeletExtraArgs:\n cloud-provider: aws\n name: 'ip-10-0-0-223.us-west-2.compute.internal'\n" @@ -143,7 +143,7 @@ write_files: {Cmd: "chmod", Args: []string{"0640", "/run/kubeadm/kubeadm.yaml"}}, } - commands, err := RawCloudInitToProvisioningCommands(cloudData, kind.Mapping{KubernetesVersion: semver.MustParse("1.13.6")}) + commands, err := RawCloudInitToProvisioningCommands(cloudData, kind.Mapping{KubernetesVersion: semver.MustParse("1.16.0")}) g.Expect(err).ToNot(HaveOccurred()) g.Expect(commands).To(HaveLen(len(expectedCmds))) diff --git a/test/infrastructure/docker/internal/provisioning/cloudinit/writefiles_test.go b/test/infrastructure/docker/internal/provisioning/cloudinit/writefiles_test.go index 95ce798658ef..d9e0a4118bfc 100644 --- a/test/infrastructure/docker/internal/provisioning/cloudinit/writefiles_test.go +++ b/test/infrastructure/docker/internal/provisioning/cloudinit/writefiles_test.go @@ -116,7 +116,7 @@ write_files: --- ClusterConfiguration... --- - apiVersion: kubeadm.k8s.io/v1beta1 + apiVersion: kubeadm.k8s.io/v1beta3 kind: InitConfiguration nodeRegistration: criSocket: unix:///var/run/containerd/containerd.sock @@ -127,7 +127,7 @@ write_files: permissions: '0640' - content: | --- - apiVersion: kubeadm.k8s.io/v1beta1 + apiVersion: kubeadm.k8s.io/v1beta3 kind: JoinConfiguration nodeRegistration: criSocket: unix:///var/run/containerd/containerd.sock @@ -174,7 +174,7 @@ write_files: --- ClusterConfiguration... --- - apiVersion: kubeadm.k8s.io/v1beta1 + apiVersion: kubeadm.k8s.io/v1beta3 kind: InitConfiguration nodeRegistration: criSocket: unix:///var/run/containerd/containerd.sock @@ -185,7 +185,7 @@ write_files: permissions: '0640' - content: | --- - apiVersion: kubeadm.k8s.io/v1beta1 + apiVersion: kubeadm.k8s.io/v1beta3 kind: JoinConfiguration nodeRegistration: criSocket: unix:///var/run/containerd/containerd.sock @@ -236,7 +236,7 @@ write_files: --- ClusterConfiguration... --- - apiVersion: kubeadm.k8s.io/v1beta1 + apiVersion: kubeadm.k8s.io/v1beta3 kind: InitConfiguration nodeRegistration: criSocket: unix:///var/run/containerd/containerd.sock @@ -247,7 +247,7 @@ write_files: permissions: '0640' - content: | --- - apiVersion: kubeadm.k8s.io/v1beta1 + apiVersion: kubeadm.k8s.io/v1beta3 kind: JoinConfiguration nodeRegistration: criSocket: unix:///var/run/containerd/containerd.sock @@ -296,7 +296,7 @@ write_files: --- ClusterConfiguration... --- - apiVersion: kubeadm.k8s.io/v1beta1 + apiVersion: kubeadm.k8s.io/v1beta3 kind: InitConfiguration nodeRegistration: criSocket: unix:///var/run/containerd/containerd.sock @@ -307,7 +307,7 @@ write_files: permissions: '0640' - content: | --- - apiVersion: kubeadm.k8s.io/v1beta1 + apiVersion: kubeadm.k8s.io/v1beta3 kind: JoinConfiguration nodeRegistration: criSocket: unix:///var/run/containerd/containerd.sock