diff --git a/cmd/kubeadm/app/apis/kubeadm/fuzzer/fuzzer.go b/cmd/kubeadm/app/apis/kubeadm/fuzzer/fuzzer.go index c27bcdbca96..8bff1f2dc04 100644 --- a/cmd/kubeadm/app/apis/kubeadm/fuzzer/fuzzer.go +++ b/cmd/kubeadm/app/apis/kubeadm/fuzzer/fuzzer.go @@ -83,9 +83,6 @@ func fuzzInitConfiguration(obj *kubeadm.InitConfiguration, c fuzz.Continue) { Usages: []string{"foo"}, }, } - - // Pin values for fields that are not present in v1beta1 - obj.CertificateKey = "" } func fuzzNodeRegistration(obj *kubeadm.NodeRegistrationOptions, c fuzz.Continue) { @@ -150,7 +147,4 @@ func fuzzJoinConfiguration(obj *kubeadm.JoinConfiguration, c fuzz.Continue) { func fuzzJoinControlPlane(obj *kubeadm.JoinControlPlane, c fuzz.Continue) { c.FuzzNoCustom(obj) - - // Pin values for fields that are not present in v1beta1 - obj.CertificateKey = "" } diff --git a/cmd/kubeadm/app/apis/kubeadm/scheme/scheme.go b/cmd/kubeadm/app/apis/kubeadm/scheme/scheme.go index 69366d6af03..a7e2c0fa16a 100644 --- a/cmd/kubeadm/app/apis/kubeadm/scheme/scheme.go +++ b/cmd/kubeadm/app/apis/kubeadm/scheme/scheme.go @@ -23,7 +23,6 @@ import ( "k8s.io/apimachinery/pkg/runtime/serializer" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm" - "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta1" "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta2" ) @@ -41,7 +40,6 @@ func init() { // AddToScheme builds the kubeadm scheme using all known versions of the kubeadm api. func AddToScheme(scheme *runtime.Scheme) { utilruntime.Must(kubeadm.AddToScheme(scheme)) - utilruntime.Must(v1beta1.AddToScheme(scheme)) utilruntime.Must(v1beta2.AddToScheme(scheme)) utilruntime.Must(scheme.SetVersionPriority(v1beta2.SchemeGroupVersion)) } diff --git a/cmd/kubeadm/app/apis/kubeadm/v1beta1/bootstraptokenstring.go b/cmd/kubeadm/app/apis/kubeadm/v1beta1/bootstraptokenstring.go deleted file mode 100644 index a287a377927..00000000000 --- a/cmd/kubeadm/app/apis/kubeadm/v1beta1/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 v1beta1 - -import ( - "fmt" - "strings" - - "github.com/pkg/errors" - - bootstrapapi "k8s.io/cluster-bootstrap/token/api" - bootstraputil "k8s.io/cluster-bootstrap/token/util" -) - -// DEPRECATED - This group version of BootstrapTokenString is deprecated by apis/kubeadm/v1beta2/BootstrapTokenString. -// 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 -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(`"%s"`, 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.Replace(string(b), `"`, ``, -1) - // 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/cmd/kubeadm/app/apis/kubeadm/v1beta1/bootstraptokenstring_test.go b/cmd/kubeadm/app/apis/kubeadm/v1beta1/bootstraptokenstring_test.go deleted file mode 100644 index 2601e9b0733..00000000000 --- a/cmd/kubeadm/app/apis/kubeadm/v1beta1/bootstraptokenstring_test.go +++ /dev/null @@ -1,249 +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 v1beta1 - -import ( - "encoding/json" - "reflect" - "testing" - - "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) { - b, err := json.Marshal(rt.bts) - if err != nil { - t.Fatalf("json.Marshal returned an unexpected error: %v", err) - } - if string(b) != rt.expected { - t.Errorf( - "failed BootstrapTokenString.MarshalJSON:\n\texpected: %s\n\t actual: %s", - rt.expected, - string(b), - ) - } - }) - } -} - -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) { - newbts := &BootstrapTokenString{} - err := json.Unmarshal([]byte(rt.input), newbts) - if (err != nil) != rt.expectedError { - t.Errorf("failed BootstrapTokenString.UnmarshalJSON:\n\texpected error: %t\n\t actual error: %v", rt.expectedError, err) - } else if !reflect.DeepEqual(rt.bts, newbts) { - t.Errorf( - "failed BootstrapTokenString.UnmarshalJSON:\n\texpected: %v\n\t actual: %v", - rt.bts, - newbts, - ) - } - }) - } -} - -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) { - if err := roundtrip(rt.input, rt.bts); err != nil { - t.Errorf("failed BootstrapTokenString JSON roundtrip with error: %v", err) - } - }) - } -} - -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 !reflect.DeepEqual(bts, newbts) { - return errors.Errorf( - "expected object: %v\n\t actual: %v", - bts, - newbts, - ) - } - } - 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) { - actual := rt.bts.String() - if actual != rt.expected { - t.Errorf( - "failed BootstrapTokenString.String():\n\texpected: %s\n\t actual: %s", - rt.expected, - actual, - ) - } - }) - } -} - -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) { - actual, err := NewBootstrapTokenString(rt.token) - if (err != nil) != rt.expectedError { - t.Errorf( - "failed NewBootstrapTokenString for the token %q\n\texpected error: %t\n\t actual error: %v", - rt.token, - rt.expectedError, - err, - ) - } else if !reflect.DeepEqual(actual, rt.bts) { - t.Errorf( - "failed NewBootstrapTokenString for the token %q\n\texpected: %v\n\t actual: %v", - rt.token, - rt.bts, - actual, - ) - } - }) - } -} - -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) { - actual, err := NewBootstrapTokenStringFromIDAndSecret(rt.id, rt.secret) - if (err != nil) != rt.expectedError { - t.Errorf( - "failed NewBootstrapTokenStringFromIDAndSecret for the token with id %q and secret %q\n\texpected error: %t\n\t actual error: %v", - rt.id, - rt.secret, - rt.expectedError, - err, - ) - } else if !reflect.DeepEqual(actual, rt.bts) { - t.Errorf( - "failed NewBootstrapTokenStringFromIDAndSecret for the token with id %q and secret %q\n\texpected: %v\n\t actual: %v", - rt.id, - rt.secret, - rt.bts, - actual, - ) - } - }) - } -} diff --git a/cmd/kubeadm/app/apis/kubeadm/v1beta1/conversion.go b/cmd/kubeadm/app/apis/kubeadm/v1beta1/conversion.go deleted file mode 100644 index cc50b68018c..00000000000 --- a/cmd/kubeadm/app/apis/kubeadm/v1beta1/conversion.go +++ /dev/null @@ -1,59 +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 v1beta1 - -import ( - "github.com/pkg/errors" - "k8s.io/apimachinery/pkg/conversion" - "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm" -) - -func Convert_kubeadm_InitConfiguration_To_v1beta1_InitConfiguration(in *kubeadm.InitConfiguration, out *InitConfiguration, s conversion.Scope) error { - if err := autoConvert_kubeadm_InitConfiguration_To_v1beta1_InitConfiguration(in, out, s); err != nil { - return err - } - - if in.CertificateKey != "" { - return errors.New("certificateKey field is not supported by v1beta1 config format") - } - - return nil -} - -func Convert_kubeadm_JoinControlPlane_To_v1beta1_JoinControlPlane(in *kubeadm.JoinControlPlane, out *JoinControlPlane, s conversion.Scope) error { - if err := autoConvert_kubeadm_JoinControlPlane_To_v1beta1_JoinControlPlane(in, out, s); err != nil { - return err - } - - if in.CertificateKey != "" { - return errors.New("certificateKey field is not supported by v1beta1 config format") - } - - return nil -} - -func Convert_kubeadm_NodeRegistrationOptions_To_v1beta1_NodeRegistrationOptions(in *kubeadm.NodeRegistrationOptions, out *NodeRegistrationOptions, s conversion.Scope) error { - if err := autoConvert_kubeadm_NodeRegistrationOptions_To_v1beta1_NodeRegistrationOptions(in, out, s); err != nil { - return err - } - - if len(in.IgnorePreflightErrors) > 0 { - return errors.New("ignorePreflightErrors field is not supported by v1beta1 config format") - } - - return nil -} diff --git a/cmd/kubeadm/app/apis/kubeadm/v1beta1/conversion_test.go b/cmd/kubeadm/app/apis/kubeadm/v1beta1/conversion_test.go deleted file mode 100644 index 0609c31e0a7..00000000000 --- a/cmd/kubeadm/app/apis/kubeadm/v1beta1/conversion_test.go +++ /dev/null @@ -1,149 +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 v1beta1 - -import ( - "testing" - - "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm" -) - -func TestInternalToVersionedInitConfigurationConversion(t *testing.T) { - testcases := map[string]struct { - in kubeadm.InitConfiguration - expectedError bool - }{ - "conversion succeeds": { - in: kubeadm.InitConfiguration{}, - expectedError: false, - }, - "certificateKey set causes an error": { - in: kubeadm.InitConfiguration{ - CertificateKey: "secret", - }, - expectedError: true, - }, - "ignorePreflightErrors set causes an error": { - in: kubeadm.InitConfiguration{ - NodeRegistration: kubeadm.NodeRegistrationOptions{ - IgnorePreflightErrors: []string{"SomeUndesirableError"}, - }, - }, - expectedError: true, - }, - } - for name, tc := range testcases { - t.Run(name, func(t *testing.T) { - versioned := &InitConfiguration{} - err := Convert_kubeadm_InitConfiguration_To_v1beta1_InitConfiguration(&tc.in, versioned, nil) - if err == nil && tc.expectedError { - t.Error("unexpected success") - } else if err != nil && !tc.expectedError { - t.Errorf("unexpected error: %v", err) - } - }) - } -} - -func TestInternalToVersionedJoinConfigurationConversion(t *testing.T) { - testcases := map[string]struct { - in kubeadm.JoinConfiguration - expectedError bool - }{ - "conversion succeeds": { - in: kubeadm.JoinConfiguration{}, - expectedError: false, - }, - "ignorePreflightErrors set causes an error": { - in: kubeadm.JoinConfiguration{ - NodeRegistration: kubeadm.NodeRegistrationOptions{ - IgnorePreflightErrors: []string{"SomeUndesirableError"}, - }, - }, - expectedError: true, - }, - } - for name, tc := range testcases { - t.Run(name, func(t *testing.T) { - versioned := &JoinConfiguration{} - err := Convert_kubeadm_JoinConfiguration_To_v1beta1_JoinConfiguration(&tc.in, versioned, nil) - if err == nil && tc.expectedError { - t.Error("unexpected success") - } else if err != nil && !tc.expectedError { - t.Errorf("unexpected error: %v", err) - } - }) - } -} - -func TestInternalToVersionedNodeRegistrationOptionsConversion(t *testing.T) { - testcases := map[string]struct { - in kubeadm.NodeRegistrationOptions - expectedError bool - }{ - "conversion succeeds": { - in: kubeadm.NodeRegistrationOptions{}, - expectedError: false, - }, - "ignorePreflightErrors set causes an error": { - in: kubeadm.NodeRegistrationOptions{ - IgnorePreflightErrors: []string{"SomeUndesirableError"}, - }, - expectedError: true, - }, - } - for name, tc := range testcases { - t.Run(name, func(t *testing.T) { - versioned := &NodeRegistrationOptions{} - err := Convert_kubeadm_NodeRegistrationOptions_To_v1beta1_NodeRegistrationOptions(&tc.in, versioned, nil) - if err == nil && tc.expectedError { - t.Error("unexpected success") - } else if err != nil && !tc.expectedError { - t.Errorf("unexpected error: %v", err) - } - }) - } -} - -func TestInternalToVersionedJoinControlPlaneConversion(t *testing.T) { - testcases := map[string]struct { - in kubeadm.JoinControlPlane - expectedError bool - }{ - "conversion succeeds": { - in: kubeadm.JoinControlPlane{}, - expectedError: false, - }, - "certificateKey set causes an error": { - in: kubeadm.JoinControlPlane{ - CertificateKey: "secret", - }, - expectedError: true, - }, - } - for name, tc := range testcases { - t.Run(name, func(t *testing.T) { - versioned := &JoinControlPlane{} - err := Convert_kubeadm_JoinControlPlane_To_v1beta1_JoinControlPlane(&tc.in, versioned, nil) - if err == nil && tc.expectedError { - t.Error("unexpected success") - } else if err != nil && !tc.expectedError { - t.Errorf("unexpected error: %v", err) - } - }) - } -} diff --git a/cmd/kubeadm/app/apis/kubeadm/v1beta1/defaults.go b/cmd/kubeadm/app/apis/kubeadm/v1beta1/defaults.go deleted file mode 100644 index a241f07cc51..00000000000 --- a/cmd/kubeadm/app/apis/kubeadm/v1beta1/defaults.go +++ /dev/null @@ -1,215 +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 v1beta1 - -import ( - "net/url" - "time" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/kubernetes/cmd/kubeadm/app/constants" -) - -const ( - // DefaultServiceDNSDomain defines default cluster-internal domain name for Services and Pods - DefaultServiceDNSDomain = "cluster.local" - // DefaultServicesSubnet defines default service subnet range - DefaultServicesSubnet = "10.96.0.0/12" - // DefaultClusterDNSIP defines default DNS IP - DefaultClusterDNSIP = "10.96.0.10" - // DefaultKubernetesVersion defines default kubernetes version - DefaultKubernetesVersion = "stable-1" - // DefaultAPIBindPort defines default API port - DefaultAPIBindPort = 6443 - // DefaultCertificatesDir defines default certificate directory - DefaultCertificatesDir = "/etc/kubernetes/pki" - // DefaultImageRepository defines default image registry - DefaultImageRepository = "k8s.gcr.io" - // DefaultManifestsDir defines default manifests directory - DefaultManifestsDir = "/etc/kubernetes/manifests" - // DefaultClusterName defines the default cluster name - DefaultClusterName = "kubernetes" - - // DefaultEtcdDataDir defines default location of etcd where static pods will save data to - DefaultEtcdDataDir = "/var/lib/etcd" - // DefaultProxyBindAddressv4 is the default bind address when the advertise address is v4 - DefaultProxyBindAddressv4 = "0.0.0.0" - // DefaultProxyBindAddressv6 is the default bind address when the advertise address is v6 - DefaultProxyBindAddressv6 = "::" - // DefaultDiscoveryTimeout specifies the default discovery timeout for kubeadm (used unless one is specified in the JoinConfiguration) - DefaultDiscoveryTimeout = 5 * time.Minute -) - -var ( - // DefaultAuditPolicyLogMaxAge is defined as a var so its address can be taken - // It is the number of days to store audit logs - DefaultAuditPolicyLogMaxAge = int32(2) -) - -func addDefaultingFuncs(scheme *runtime.Scheme) error { - return RegisterDefaults(scheme) -} - -// SetDefaults_InitConfiguration assigns default values for the InitConfiguration -func SetDefaults_InitConfiguration(obj *InitConfiguration) { - SetDefaults_ClusterConfiguration(&obj.ClusterConfiguration) - SetDefaults_BootstrapTokens(obj) - SetDefaults_APIEndpoint(&obj.LocalAPIEndpoint) -} - -// SetDefaults_ClusterConfiguration assigns default values for the ClusterConfiguration -func SetDefaults_ClusterConfiguration(obj *ClusterConfiguration) { - if obj.KubernetesVersion == "" { - obj.KubernetesVersion = DefaultKubernetesVersion - } - - if obj.Networking.ServiceSubnet == "" { - obj.Networking.ServiceSubnet = DefaultServicesSubnet - } - - if obj.Networking.DNSDomain == "" { - obj.Networking.DNSDomain = DefaultServiceDNSDomain - } - - if obj.CertificatesDir == "" { - obj.CertificatesDir = DefaultCertificatesDir - } - - if obj.ImageRepository == "" { - obj.ImageRepository = DefaultImageRepository - } - - if obj.ClusterName == "" { - obj.ClusterName = DefaultClusterName - } - - SetDefaults_DNS(obj) - SetDefaults_Etcd(obj) - SetDefaults_APIServer(&obj.APIServer) -} - -// SetDefaults_APIServer assigns default values for the API Server -func SetDefaults_APIServer(obj *APIServer) { - if obj.TimeoutForControlPlane == nil { - obj.TimeoutForControlPlane = &metav1.Duration{ - Duration: constants.DefaultControlPlaneTimeout, - } - } -} - -// SetDefaults_DNS assigns default values for the DNS component -func SetDefaults_DNS(obj *ClusterConfiguration) { - if obj.DNS.Type == "" { - obj.DNS.Type = CoreDNS - } -} - -// SetDefaults_Etcd assigns default values for the proxy -func SetDefaults_Etcd(obj *ClusterConfiguration) { - if obj.Etcd.External == nil && obj.Etcd.Local == nil { - obj.Etcd.Local = &LocalEtcd{} - } - if obj.Etcd.Local != nil { - if obj.Etcd.Local.DataDir == "" { - obj.Etcd.Local.DataDir = DefaultEtcdDataDir - } - } -} - -// SetDefaults_JoinConfiguration assigns default values to a regular node -func SetDefaults_JoinConfiguration(obj *JoinConfiguration) { - if obj.CACertPath == "" { - obj.CACertPath = DefaultCACertPath - } - - SetDefaults_JoinControlPlane(obj.ControlPlane) - SetDefaults_Discovery(&obj.Discovery) -} - -func SetDefaults_JoinControlPlane(obj *JoinControlPlane) { - if obj != nil { - SetDefaults_APIEndpoint(&obj.LocalAPIEndpoint) - } -} - -// SetDefaults_Discovery assigns default values for the discovery process -func SetDefaults_Discovery(obj *Discovery) { - if len(obj.TLSBootstrapToken) == 0 && obj.BootstrapToken != nil { - obj.TLSBootstrapToken = obj.BootstrapToken.Token - } - - if obj.Timeout == nil { - obj.Timeout = &metav1.Duration{ - Duration: DefaultDiscoveryTimeout, - } - } - - if obj.File != nil { - SetDefaults_FileDiscovery(obj.File) - } -} - -// SetDefaults_FileDiscovery assigns default values for file based discovery -func SetDefaults_FileDiscovery(obj *FileDiscovery) { - // Make sure file URL becomes path - if len(obj.KubeConfigPath) != 0 { - u, err := url.Parse(obj.KubeConfigPath) - if err == nil && u.Scheme == "file" { - obj.KubeConfigPath = u.Path - } - } -} - -// SetDefaults_BootstrapTokens sets the defaults for the .BootstrapTokens field -// If the slice is empty, it's defaulted with one token. Otherwise it just loops -// through the slice and sets the defaults for the omitempty fields that are TTL, -// Usages and Groups. Token is NOT defaulted with a random one in the API defaulting -// layer, but set to a random value later at runtime if not set before. -func SetDefaults_BootstrapTokens(obj *InitConfiguration) { - - if obj.BootstrapTokens == nil || len(obj.BootstrapTokens) == 0 { - obj.BootstrapTokens = []BootstrapToken{{}} - } - - for i := range obj.BootstrapTokens { - SetDefaults_BootstrapToken(&obj.BootstrapTokens[i]) - } -} - -// SetDefaults_BootstrapToken sets the defaults for an individual Bootstrap Token -func SetDefaults_BootstrapToken(bt *BootstrapToken) { - if bt.TTL == nil { - bt.TTL = &metav1.Duration{ - Duration: constants.DefaultTokenDuration, - } - } - if len(bt.Usages) == 0 { - bt.Usages = constants.DefaultTokenUsages - } - - if len(bt.Groups) == 0 { - bt.Groups = constants.DefaultTokenGroups - } -} - -// SetDefaults_APIEndpoint sets the defaults for the API server instance deployed on a node. -func SetDefaults_APIEndpoint(obj *APIEndpoint) { - if obj.BindPort == 0 { - obj.BindPort = DefaultAPIBindPort - } -} diff --git a/cmd/kubeadm/app/apis/kubeadm/v1beta1/defaults_unix.go b/cmd/kubeadm/app/apis/kubeadm/v1beta1/defaults_unix.go deleted file mode 100644 index 18510d4c86e..00000000000 --- a/cmd/kubeadm/app/apis/kubeadm/v1beta1/defaults_unix.go +++ /dev/null @@ -1,26 +0,0 @@ -// +build !windows - -/* -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 v1beta1 - -const ( - // DefaultCACertPath defines default location of CA certificate on Linux - DefaultCACertPath = "/etc/kubernetes/pki/ca.crt" - // DefaultUrlScheme defines default socket url prefix - DefaultUrlScheme = "unix" -) diff --git a/cmd/kubeadm/app/apis/kubeadm/v1beta1/defaults_windows.go b/cmd/kubeadm/app/apis/kubeadm/v1beta1/defaults_windows.go deleted file mode 100644 index 3e2ab2bed5d..00000000000 --- a/cmd/kubeadm/app/apis/kubeadm/v1beta1/defaults_windows.go +++ /dev/null @@ -1,26 +0,0 @@ -// +build windows - -/* -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 v1beta1 - -const ( - // DefaultCACertPath defines default location of CA certificate on Windows - DefaultCACertPath = "C:/etc/kubernetes/pki/ca.crt" - // DefaultUrlScheme defines default socket url prefix - DefaultUrlScheme = "npipe" -) diff --git a/cmd/kubeadm/app/apis/kubeadm/v1beta1/doc.go b/cmd/kubeadm/app/apis/kubeadm/v1beta1/doc.go deleted file mode 100644 index af99961863a..00000000000 --- a/cmd/kubeadm/app/apis/kubeadm/v1beta1/doc.go +++ /dev/null @@ -1,281 +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. -*/ - -// +k8s:defaulter-gen=TypeMeta -// +groupName=kubeadm.k8s.io -// +k8s:deepcopy-gen=package -// +k8s:conversion-gen=k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm - -// Package v1beta1 has been deprecated by v1beta2 -// Package v1beta1 defines the v1beta1 version of the kubeadm configuration file format. -// This version graduates the configuration format to BETA and is a big step towards GA. -// -//A list of changes since v1alpha3: -// - "apiServerEndpoint" in InitConfiguration was renamed to "localAPIEndpoint" for better clarity of what the field -// represents. -// - Common fields in ClusterConfiguration such as "*extraArgs" and "*extraVolumes" for control plane components are now moved -// under component structs - i.e. "apiServer", "controllerManager", "scheduler". -// - "auditPolicy" was removed from ClusterConfiguration. Please use "extraArgs" in "apiServer" to configure this feature instead. -// - "unifiedControlPlaneImage" in ClusterConfiguration was changed to a boolean field called "useHyperKubeImage". -// - ClusterConfiguration now has a "dns" field which can be used to select and configure the cluster DNS addon. -// - "featureGates" still exists under ClusterConfiguration, but there are no supported feature gates in 1.13. -// See the Kubernetes 1.13 changelog for further details. -// - Both "localEtcd" and "dns" configurations now support custom image repositories. -// - The "controlPlane*"-related fields in JoinConfiguration were refactored into a sub-structure. -// - "clusterName" was removed from JoinConfiguration and the name is now fetched from the existing cluster. -// -// Migration from old kubeadm config versions -// -// Please convert your v1alpha3 configuration files to v1beta1 using the "kubeadm config migrate" command of kubeadm v1.13.x -// (conversion from older releases of kubeadm config files requires older release of kubeadm as well e.g. -// kubeadm v1.11 should be used to migrate v1alpha1 to v1alpha2; kubeadm v1.12 should be used to translate v1alpha2 to v1alpha3) -// -// Nevertheless, kubeadm v1.13.x will support reading from v1alpha3 version of the kubeadm config file format, but this support -// will be dropped in the v1.14 release. -// -// Basics -// -// The preferred way to configure kubeadm is to pass an YAML configuration file with the --config option. Some of the -// configuration options defined in the kubeadm config file are also available as command line flags, but only -// the most common/simple use case are supported with this approach. -// -// A kubeadm config file could contain multiple configuration types separated using three dashes (“---”). -// -// kubeadm supports the following configuration types: -// -// apiVersion: kubeadm.k8s.io/v1beta1 -// kind: InitConfiguration -// -// apiVersion: kubeadm.k8s.io/v1beta1 -// kind: ClusterConfiguration -// -// apiVersion: kubelet.config.k8s.io/v1beta1 -// kind: KubeletConfiguration -// -// apiVersion: kubeproxy.config.k8s.io/v1alpha1 -// kind: KubeProxyConfiguration -// -// apiVersion: kubeadm.k8s.io/v1beta1 -// kind: JoinConfiguration -// -// To print the defaults for "init" and "join" actions use the following commands: -// kubeadm config print init-defaults -// kubeadm config print join-defaults -// -// The list of configuration types that must be included in a configuration file depends by the action you are -// performing (init or join) and by the configuration options you are going to use (defaults or advanced customization). -// -// If some configuration types are not provided, or provided only partially, kubeadm will use default values; defaults -// provided by kubeadm includes also enforcing consistency of values across components when required (e.g. -// cluster-cidr flag on controller manager and clusterCIDR on kube-proxy). -// -// Users are always allowed to override default values, with the only exception of a small subset of setting with -// relevance for security (e.g. enforce authorization-mode Node and RBAC on api server) -// -// If the user provides a configuration types that is not expected for the action you are performing, kubeadm will -// ignore those types and print a warning. -// -// Kubeadm init configuration types -// -// When executing kubeadm init with the --config option, the following configuration types could be used: -// InitConfiguration, ClusterConfiguration, KubeProxyConfiguration, KubeletConfiguration, but only one -// between InitConfiguration and ClusterConfiguration is mandatory. -// -// apiVersion: kubeadm.k8s.io/v1beta1 -// kind: InitConfiguration -// bootstrapTokens: -// ... -// nodeRegistration: -// ... -// -// The InitConfiguration type should be used to configure runtime settings, that in case of kubeadm init -// are the configuration of the bootstrap token and all the setting which are specific to the node where kubeadm -// is executed, including: -// -// - NodeRegistration, that holds fields that relate to registering the new node to the cluster; -// use it to customize the node name, the CRI socket to use or any other settings that should apply to this -// node only (e.g. the node ip). -// -// - LocalAPIEndpoint, that represents the endpoint of the instance of the API server to be deployed on this node; -// use it e.g. to customize the API server advertise address. -// -// apiVersion: kubeadm.k8s.io/v1beta1 -// kind: ClusterConfiguration -// networking: -// ... -// etcd: -// ... -// apiServer: -// extraArgs: -// ... -// extraVolumes: -// ... -// ... -// -// The ClusterConfiguration type should be used to configure cluster-wide settings, -// including settings for: -// -// - Networking, that holds configuration for the networking topology of the cluster; use it e.g. to customize -// node subnet or services subnet. -// -// - Etcd configurations; use it e.g. to customize the local etcd or to configure the API server -// for using an external etcd cluster. -// -// - kube-apiserver, kube-scheduler, kube-controller-manager configurations; use it to customize control-plane -// components by adding customized setting or overriding kubeadm default settings. -// -// apiVersion: kubeproxy.config.k8s.io/v1alpha1 -// kind: KubeProxyConfiguration -// ... -// -// The KubeProxyConfiguration type should be used to change the configuration passed to kube-proxy instances deployed -// in the cluster. If this object is not provided or provided only partially, kubeadm applies defaults. -// -// See https://kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/ or https://godoc.org/k8s.io/kube-proxy/config/v1alpha1#KubeProxyConfiguration -// for kube proxy official documentation. -// -// apiVersion: kubelet.config.k8s.io/v1beta1 -// kind: KubeletConfiguration -// ... -// -// The KubeletConfiguration type should be used to change the configurations that will be passed to all kubelet instances -// deployed in the cluster. If this object is not provided or provided only partially, kubeadm applies defaults. -// -// See https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/ or https://godoc.org/k8s.io/kubelet/config/v1beta1#KubeletConfiguration -// for kubelet official documentation. -// -// Here is a fully populated example of a single YAML file containing multiple -// configuration types to be used during a `kubeadm init` run. -// -// apiVersion: kubeadm.k8s.io/v1beta1 -// kind: InitConfiguration -// bootstrapTokens: -// - token: "9a08jv.c0izixklcxtmnze7" -// description: "kubeadm bootstrap token" -// ttl: "24h" -// - token: "783bde.3f89s0fje9f38fhf" -// description: "another bootstrap token" -// usages: -// - authentication -// - signing -// groups: -// - system:bootstrappers:kubeadm:default-node-token -// nodeRegistration: -// name: "ec2-10-100-0-1" -// criSocket: "/var/run/dockershim.sock" -// taints: -// - key: "kubeadmNode" -// value: "master" -// effect: "NoSchedule" -// kubeletExtraArgs: -// v: 4 -// localAPIEndpoint: -// advertiseAddress: "10.100.0.1" -// bindPort: 6443 -// --- -// apiVersion: kubeadm.k8s.io/v1beta1 -// kind: ClusterConfiguration -// etcd: -// # one of local or external -// local: -// imageRepository: "k8s.gcr.io" -// imageTag: "3.2.24" -// dataDir: "/var/lib/etcd" -// extraArgs: -// listen-client-urls: "http://10.100.0.1:2379" -// serverCertSANs: -// - "ec2-10-100-0-1.compute-1.amazonaws.com" -// peerCertSANs: -// - "10.100.0.1" -// # external: -// # endpoints: -// # - "10.100.0.1:2379" -// # - "10.100.0.2:2379" -// # caFile: "/etcd/kubernetes/pki/etcd/etcd-ca.crt" -// # certFile: "/etcd/kubernetes/pki/etcd/etcd.crt" -// # keyFile: "/etcd/kubernetes/pki/etcd/etcd.key" -// networking: -// serviceSubnet: "10.96.0.0/12" -// podSubnet: "10.100.0.1/24" -// dnsDomain: "cluster.local" -// kubernetesVersion: "v1.12.0" -// controlPlaneEndpoint: "10.100.0.1:6443" -// apiServer: -// extraArgs: -// authorization-mode: "Node,RBAC" -// extraVolumes: -// - name: "some-volume" -// hostPath: "/etc/some-path" -// mountPath: "/etc/some-pod-path" -// readOnly: false -// pathType: File -// certSANs: -// - "10.100.1.1" -// - "ec2-10-100-0-1.compute-1.amazonaws.com" -// timeoutForControlPlane: 4m0s -// controllerManager: -// extraArgs: -// "node-cidr-mask-size": "20" -// extraVolumes: -// - name: "some-volume" -// hostPath: "/etc/some-path" -// mountPath: "/etc/some-pod-path" -// readOnly: false -// pathType: File -// scheduler: -// extraArgs: -// address: "10.100.0.1" -// extraVolumes: -// - name: "some-volume" -// hostPath: "/etc/some-path" -// mountPath: "/etc/some-pod-path" -// readOnly: false -// pathType: File -// certificatesDir: "/etc/kubernetes/pki" -// imageRepository: "k8s.gcr.io" -// useHyperKubeImage: false -// clusterName: "example-cluster" -// --- -// apiVersion: kubelet.config.k8s.io/v1beta1 -// kind: KubeletConfiguration -// # kubelet specific options here -// --- -// apiVersion: kubeproxy.config.k8s.io/v1alpha1 -// kind: KubeProxyConfiguration -// # kube-proxy specific options here -// -// Kubeadm join configuration types -// -// When executing kubeadm join with the --config option, the JoinConfiguration type should be provided. -// -// apiVersion: kubeadm.k8s.io/v1beta1 -// kind: JoinConfiguration -// ... -// -// The JoinConfiguration type should be used to configure runtime settings, that in case of kubeadm join -// are the discovery method used for accessing the cluster info and all the setting which are specific -// to the node where kubeadm is executed, including: -// -// - NodeRegistration, that holds fields that relate to registering the new node to the cluster; -// use it to customize the node name, the CRI socket to use or any other settings that should apply to this -// node only (e.g. the node ip). -// -// - APIEndpoint, that represents the endpoint of the instance of the API server to be eventually deployed on this node. -// -package v1beta1 // import "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta1" - -//TODO: The BootstrapTokenString object should move out to either k8s.io/client-go or k8s.io/api in the future -//(probably as part of Bootstrap Tokens going GA). It should not be staged under the kubeadm API as it is now. diff --git a/cmd/kubeadm/app/apis/kubeadm/v1beta1/register.go b/cmd/kubeadm/app/apis/kubeadm/v1beta1/register.go deleted file mode 100644 index 4446e361aed..00000000000 --- a/cmd/kubeadm/app/apis/kubeadm/v1beta1/register.go +++ /dev/null @@ -1,68 +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 v1beta1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// GroupName is the group name use in this package -const GroupName = "kubeadm.k8s.io" - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"} - -var ( - // TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api. - // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. - - // SchemeBuilder points to a list of functions added to Scheme. - SchemeBuilder runtime.SchemeBuilder - localSchemeBuilder = &SchemeBuilder - // AddToScheme applies all the stored functions to the scheme. - AddToScheme = localSchemeBuilder.AddToScheme -) - -func init() { - // We only register manually written functions here. The registration of the - // generated functions takes place in the generated files. The separation - // makes the code compile even when the generated files are missing. - localSchemeBuilder.Register(addKnownTypes, addDefaultingFuncs) -} - -// Kind takes an unqualified kind and returns a Group qualified GroupKind -func Kind(kind string) schema.GroupKind { - return SchemeGroupVersion.WithKind(kind).GroupKind() -} - -// Resource takes an unqualified resource and returns a Group qualified GroupResource -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &InitConfiguration{}, - &ClusterConfiguration{}, - &ClusterStatus{}, - &JoinConfiguration{}, - ) - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/cmd/kubeadm/app/apis/kubeadm/v1beta1/types.go b/cmd/kubeadm/app/apis/kubeadm/v1beta1/types.go deleted file mode 100644 index c75980b3e42..00000000000 --- a/cmd/kubeadm/app/apis/kubeadm/v1beta1/types.go +++ /dev/null @@ -1,391 +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 v1beta1 - -import ( - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// DEPRECATED - This group version of InitConfiguration is deprecated by apis/kubeadm/v1beta2/InitConfiguration. -// InitConfiguration contains a list of elements that is specific "kubeadm init"-only runtime -// information. -type InitConfiguration struct { - metav1.TypeMeta `json:",inline"` - - // ClusterConfiguration holds the cluster-wide information, and embeds that struct (which can be (un)marshalled separately as well) - // When InitConfiguration is marshalled to bytes in the external version, this information IS NOT preserved (which can be seen from - // the `json:"-"` tag. This is due to that when InitConfiguration is (un)marshalled, it turns into two YAML documents, one for the - // InitConfiguration and ClusterConfiguration. Hence, the information must not be duplicated, and is therefore omitted here. - ClusterConfiguration `json:"-"` - - // `kubeadm init`-only information. These fields are solely used the first time `kubeadm init` runs. - // After that, the information in the fields IS NOT uploaded to the `kubeadm-config` ConfigMap - // that is used by `kubeadm upgrade` for instance. These fields must be omitempty. - - // 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 - BootstrapTokens []BootstrapToken `json:"bootstrapTokens,omitempty"` - - // NodeRegistration holds fields that relate to registering the new control-plane node to the cluster - 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. - LocalAPIEndpoint APIEndpoint `json:"localAPIEndpoint,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// DEPRECATED - This group version of ClusterConfiguration is deprecated by apis/kubeadm/v1beta2/ClusterConfiguration. -// ClusterConfiguration contains cluster-wide configuration for a kubeadm cluster -type ClusterConfiguration struct { - metav1.TypeMeta `json:",inline"` - - // Etcd holds configuration for etcd. - Etcd Etcd `json:"etcd"` - - // Networking holds configuration for the networking topology of the cluster. - Networking Networking `json:"networking"` - - // KubernetesVersion is the target version of the control plane. - KubernetesVersion string `json:"kubernetesVersion"` - - // 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. - ControlPlaneEndpoint string `json:"controlPlaneEndpoint"` - - // APIServer contains extra settings for the API server control plane component - APIServer APIServer `json:"apiServer,omitempty"` - - // ControllerManager contains extra settings for the controller manager control plane component - ControllerManager ControlPlaneComponent `json:"controllerManager,omitempty"` - - // Scheduler contains extra settings for the scheduler control plane component - Scheduler ControlPlaneComponent `json:"scheduler,omitempty"` - - // DNS defines the options for the DNS add-on installed in the cluster. - DNS DNS `json:"dns"` - - // CertificatesDir specifies where to store or look for all required certificates. - CertificatesDir string `json:"certificatesDir"` - - // 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. - ImageRepository string `json:"imageRepository"` - - // UseHyperKubeImage controls if hyperkube should be used for Kubernetes components instead of their respective separate images - // DEPRECATED: As hyperkube is itself deprecated, this fields is too. It will be removed in future kubeadm config versions, kubeadm - // will print multiple warnings when set to true, and at some point it may become ignored. - UseHyperKubeImage bool `json:"useHyperKubeImage,omitempty"` - - // FeatureGates enabled by the user. - FeatureGates map[string]bool `json:"featureGates,omitempty"` - - // The cluster name - 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" -) - -// DNS defines the DNS addon that should be used in the cluster -type DNS struct { - // Type defines the DNS add-on to be used - Type DNSAddOnType `json:"type"` - - // 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. - 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 - 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. - Taints []v1.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. - 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 "10.96.0.0/12". - ServiceSubnet string `json:"serviceSubnet"` - // PodSubnet is the subnet used by pods. - PodSubnet string `json:"podSubnet"` - // DNSDomain is the dns domain used by k8s services. Defaults to "cluster.local". - DNSDomain string `json:"dnsDomain"` -} - -// 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". - DataDir string `json:"dataDir"` - - // 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 - -// DEPRECATED - This group version of JoinConfiguration is deprecated by apis/kubeadm/v1beta2/JoinConfiguration. -// 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 - NodeRegistration NodeRegistrationOptions `json:"nodeRegistration"` - - // 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". - CACertPath string `json:"caCertPath"` - - // Discovery specifies the options for the kubelet to use during the TLS Bootstrap process - Discovery Discovery `json:"discovery"` - - // ControlPlane defines the additional control plane instance to be deployed on the joining node. - // If nil, no additional control plane instance will be deployed. - 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 - TLSBootstrapToken string `json:"tlsBootstrapToken"` - - // 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. - 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 v1.HostPathType `json:"pathType,omitempty"` -} diff --git a/cmd/kubeadm/app/apis/kubeadm/v1beta1/zz_generated.conversion.go b/cmd/kubeadm/app/apis/kubeadm/v1beta1/zz_generated.conversion.go deleted file mode 100644 index bc2db7ebf3b..00000000000 --- a/cmd/kubeadm/app/apis/kubeadm/v1beta1/zz_generated.conversion.go +++ /dev/null @@ -1,843 +0,0 @@ -// +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 conversion-gen. DO NOT EDIT. - -package v1beta1 - -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" - kubeadm "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm" -) - -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), (*kubeadm.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_APIEndpoint_To_kubeadm_APIEndpoint(a.(*APIEndpoint), b.(*kubeadm.APIEndpoint), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*kubeadm.APIEndpoint)(nil), (*APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_kubeadm_APIEndpoint_To_v1beta1_APIEndpoint(a.(*kubeadm.APIEndpoint), b.(*APIEndpoint), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*APIServer)(nil), (*kubeadm.APIServer)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_APIServer_To_kubeadm_APIServer(a.(*APIServer), b.(*kubeadm.APIServer), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*kubeadm.APIServer)(nil), (*APIServer)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_kubeadm_APIServer_To_v1beta1_APIServer(a.(*kubeadm.APIServer), b.(*APIServer), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*BootstrapToken)(nil), (*kubeadm.BootstrapToken)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_BootstrapToken_To_kubeadm_BootstrapToken(a.(*BootstrapToken), b.(*kubeadm.BootstrapToken), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*kubeadm.BootstrapToken)(nil), (*BootstrapToken)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_kubeadm_BootstrapToken_To_v1beta1_BootstrapToken(a.(*kubeadm.BootstrapToken), b.(*BootstrapToken), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*BootstrapTokenDiscovery)(nil), (*kubeadm.BootstrapTokenDiscovery)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_BootstrapTokenDiscovery_To_kubeadm_BootstrapTokenDiscovery(a.(*BootstrapTokenDiscovery), b.(*kubeadm.BootstrapTokenDiscovery), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*kubeadm.BootstrapTokenDiscovery)(nil), (*BootstrapTokenDiscovery)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_kubeadm_BootstrapTokenDiscovery_To_v1beta1_BootstrapTokenDiscovery(a.(*kubeadm.BootstrapTokenDiscovery), b.(*BootstrapTokenDiscovery), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*BootstrapTokenString)(nil), (*kubeadm.BootstrapTokenString)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_BootstrapTokenString_To_kubeadm_BootstrapTokenString(a.(*BootstrapTokenString), b.(*kubeadm.BootstrapTokenString), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*kubeadm.BootstrapTokenString)(nil), (*BootstrapTokenString)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_kubeadm_BootstrapTokenString_To_v1beta1_BootstrapTokenString(a.(*kubeadm.BootstrapTokenString), b.(*BootstrapTokenString), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterConfiguration)(nil), (*kubeadm.ClusterConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterConfiguration_To_kubeadm_ClusterConfiguration(a.(*ClusterConfiguration), b.(*kubeadm.ClusterConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*kubeadm.ClusterConfiguration)(nil), (*ClusterConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_kubeadm_ClusterConfiguration_To_v1beta1_ClusterConfiguration(a.(*kubeadm.ClusterConfiguration), b.(*ClusterConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterStatus)(nil), (*kubeadm.ClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterStatus_To_kubeadm_ClusterStatus(a.(*ClusterStatus), b.(*kubeadm.ClusterStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*kubeadm.ClusterStatus)(nil), (*ClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_kubeadm_ClusterStatus_To_v1beta1_ClusterStatus(a.(*kubeadm.ClusterStatus), b.(*ClusterStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ControlPlaneComponent)(nil), (*kubeadm.ControlPlaneComponent)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ControlPlaneComponent_To_kubeadm_ControlPlaneComponent(a.(*ControlPlaneComponent), b.(*kubeadm.ControlPlaneComponent), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*kubeadm.ControlPlaneComponent)(nil), (*ControlPlaneComponent)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_kubeadm_ControlPlaneComponent_To_v1beta1_ControlPlaneComponent(a.(*kubeadm.ControlPlaneComponent), b.(*ControlPlaneComponent), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*DNS)(nil), (*kubeadm.DNS)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_DNS_To_kubeadm_DNS(a.(*DNS), b.(*kubeadm.DNS), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*kubeadm.DNS)(nil), (*DNS)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_kubeadm_DNS_To_v1beta1_DNS(a.(*kubeadm.DNS), b.(*DNS), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Discovery)(nil), (*kubeadm.Discovery)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Discovery_To_kubeadm_Discovery(a.(*Discovery), b.(*kubeadm.Discovery), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*kubeadm.Discovery)(nil), (*Discovery)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_kubeadm_Discovery_To_v1beta1_Discovery(a.(*kubeadm.Discovery), b.(*Discovery), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Etcd)(nil), (*kubeadm.Etcd)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Etcd_To_kubeadm_Etcd(a.(*Etcd), b.(*kubeadm.Etcd), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*kubeadm.Etcd)(nil), (*Etcd)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_kubeadm_Etcd_To_v1beta1_Etcd(a.(*kubeadm.Etcd), b.(*Etcd), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ExternalEtcd)(nil), (*kubeadm.ExternalEtcd)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ExternalEtcd_To_kubeadm_ExternalEtcd(a.(*ExternalEtcd), b.(*kubeadm.ExternalEtcd), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*kubeadm.ExternalEtcd)(nil), (*ExternalEtcd)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_kubeadm_ExternalEtcd_To_v1beta1_ExternalEtcd(a.(*kubeadm.ExternalEtcd), b.(*ExternalEtcd), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*FileDiscovery)(nil), (*kubeadm.FileDiscovery)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_FileDiscovery_To_kubeadm_FileDiscovery(a.(*FileDiscovery), b.(*kubeadm.FileDiscovery), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*kubeadm.FileDiscovery)(nil), (*FileDiscovery)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_kubeadm_FileDiscovery_To_v1beta1_FileDiscovery(a.(*kubeadm.FileDiscovery), b.(*FileDiscovery), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*HostPathMount)(nil), (*kubeadm.HostPathMount)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_HostPathMount_To_kubeadm_HostPathMount(a.(*HostPathMount), b.(*kubeadm.HostPathMount), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*kubeadm.HostPathMount)(nil), (*HostPathMount)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_kubeadm_HostPathMount_To_v1beta1_HostPathMount(a.(*kubeadm.HostPathMount), b.(*HostPathMount), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ImageMeta)(nil), (*kubeadm.ImageMeta)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ImageMeta_To_kubeadm_ImageMeta(a.(*ImageMeta), b.(*kubeadm.ImageMeta), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*kubeadm.ImageMeta)(nil), (*ImageMeta)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_kubeadm_ImageMeta_To_v1beta1_ImageMeta(a.(*kubeadm.ImageMeta), b.(*ImageMeta), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*InitConfiguration)(nil), (*kubeadm.InitConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_InitConfiguration_To_kubeadm_InitConfiguration(a.(*InitConfiguration), b.(*kubeadm.InitConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*JoinConfiguration)(nil), (*kubeadm.JoinConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_JoinConfiguration_To_kubeadm_JoinConfiguration(a.(*JoinConfiguration), b.(*kubeadm.JoinConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*kubeadm.JoinConfiguration)(nil), (*JoinConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_kubeadm_JoinConfiguration_To_v1beta1_JoinConfiguration(a.(*kubeadm.JoinConfiguration), b.(*JoinConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*JoinControlPlane)(nil), (*kubeadm.JoinControlPlane)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_JoinControlPlane_To_kubeadm_JoinControlPlane(a.(*JoinControlPlane), b.(*kubeadm.JoinControlPlane), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*LocalEtcd)(nil), (*kubeadm.LocalEtcd)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_LocalEtcd_To_kubeadm_LocalEtcd(a.(*LocalEtcd), b.(*kubeadm.LocalEtcd), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*kubeadm.LocalEtcd)(nil), (*LocalEtcd)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_kubeadm_LocalEtcd_To_v1beta1_LocalEtcd(a.(*kubeadm.LocalEtcd), b.(*LocalEtcd), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Networking)(nil), (*kubeadm.Networking)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Networking_To_kubeadm_Networking(a.(*Networking), b.(*kubeadm.Networking), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*kubeadm.Networking)(nil), (*Networking)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_kubeadm_Networking_To_v1beta1_Networking(a.(*kubeadm.Networking), b.(*Networking), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*NodeRegistrationOptions)(nil), (*kubeadm.NodeRegistrationOptions)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_NodeRegistrationOptions_To_kubeadm_NodeRegistrationOptions(a.(*NodeRegistrationOptions), b.(*kubeadm.NodeRegistrationOptions), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*kubeadm.InitConfiguration)(nil), (*InitConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_kubeadm_InitConfiguration_To_v1beta1_InitConfiguration(a.(*kubeadm.InitConfiguration), b.(*InitConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*kubeadm.JoinControlPlane)(nil), (*JoinControlPlane)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_kubeadm_JoinControlPlane_To_v1beta1_JoinControlPlane(a.(*kubeadm.JoinControlPlane), b.(*JoinControlPlane), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*kubeadm.NodeRegistrationOptions)(nil), (*NodeRegistrationOptions)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_kubeadm_NodeRegistrationOptions_To_v1beta1_NodeRegistrationOptions(a.(*kubeadm.NodeRegistrationOptions), b.(*NodeRegistrationOptions), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1beta1_APIEndpoint_To_kubeadm_APIEndpoint(in *APIEndpoint, out *kubeadm.APIEndpoint, s conversion.Scope) error { - out.AdvertiseAddress = in.AdvertiseAddress - out.BindPort = in.BindPort - return nil -} - -// Convert_v1beta1_APIEndpoint_To_kubeadm_APIEndpoint is an autogenerated conversion function. -func Convert_v1beta1_APIEndpoint_To_kubeadm_APIEndpoint(in *APIEndpoint, out *kubeadm.APIEndpoint, s conversion.Scope) error { - return autoConvert_v1beta1_APIEndpoint_To_kubeadm_APIEndpoint(in, out, s) -} - -func autoConvert_kubeadm_APIEndpoint_To_v1beta1_APIEndpoint(in *kubeadm.APIEndpoint, out *APIEndpoint, s conversion.Scope) error { - out.AdvertiseAddress = in.AdvertiseAddress - out.BindPort = in.BindPort - return nil -} - -// Convert_kubeadm_APIEndpoint_To_v1beta1_APIEndpoint is an autogenerated conversion function. -func Convert_kubeadm_APIEndpoint_To_v1beta1_APIEndpoint(in *kubeadm.APIEndpoint, out *APIEndpoint, s conversion.Scope) error { - return autoConvert_kubeadm_APIEndpoint_To_v1beta1_APIEndpoint(in, out, s) -} - -func autoConvert_v1beta1_APIServer_To_kubeadm_APIServer(in *APIServer, out *kubeadm.APIServer, s conversion.Scope) error { - if err := Convert_v1beta1_ControlPlaneComponent_To_kubeadm_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_kubeadm_APIServer is an autogenerated conversion function. -func Convert_v1beta1_APIServer_To_kubeadm_APIServer(in *APIServer, out *kubeadm.APIServer, s conversion.Scope) error { - return autoConvert_v1beta1_APIServer_To_kubeadm_APIServer(in, out, s) -} - -func autoConvert_kubeadm_APIServer_To_v1beta1_APIServer(in *kubeadm.APIServer, out *APIServer, s conversion.Scope) error { - if err := Convert_kubeadm_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_kubeadm_APIServer_To_v1beta1_APIServer is an autogenerated conversion function. -func Convert_kubeadm_APIServer_To_v1beta1_APIServer(in *kubeadm.APIServer, out *APIServer, s conversion.Scope) error { - return autoConvert_kubeadm_APIServer_To_v1beta1_APIServer(in, out, s) -} - -func autoConvert_v1beta1_BootstrapToken_To_kubeadm_BootstrapToken(in *BootstrapToken, out *kubeadm.BootstrapToken, s conversion.Scope) error { - out.Token = (*kubeadm.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_kubeadm_BootstrapToken is an autogenerated conversion function. -func Convert_v1beta1_BootstrapToken_To_kubeadm_BootstrapToken(in *BootstrapToken, out *kubeadm.BootstrapToken, s conversion.Scope) error { - return autoConvert_v1beta1_BootstrapToken_To_kubeadm_BootstrapToken(in, out, s) -} - -func autoConvert_kubeadm_BootstrapToken_To_v1beta1_BootstrapToken(in *kubeadm.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_kubeadm_BootstrapToken_To_v1beta1_BootstrapToken is an autogenerated conversion function. -func Convert_kubeadm_BootstrapToken_To_v1beta1_BootstrapToken(in *kubeadm.BootstrapToken, out *BootstrapToken, s conversion.Scope) error { - return autoConvert_kubeadm_BootstrapToken_To_v1beta1_BootstrapToken(in, out, s) -} - -func autoConvert_v1beta1_BootstrapTokenDiscovery_To_kubeadm_BootstrapTokenDiscovery(in *BootstrapTokenDiscovery, out *kubeadm.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_kubeadm_BootstrapTokenDiscovery is an autogenerated conversion function. -func Convert_v1beta1_BootstrapTokenDiscovery_To_kubeadm_BootstrapTokenDiscovery(in *BootstrapTokenDiscovery, out *kubeadm.BootstrapTokenDiscovery, s conversion.Scope) error { - return autoConvert_v1beta1_BootstrapTokenDiscovery_To_kubeadm_BootstrapTokenDiscovery(in, out, s) -} - -func autoConvert_kubeadm_BootstrapTokenDiscovery_To_v1beta1_BootstrapTokenDiscovery(in *kubeadm.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_kubeadm_BootstrapTokenDiscovery_To_v1beta1_BootstrapTokenDiscovery is an autogenerated conversion function. -func Convert_kubeadm_BootstrapTokenDiscovery_To_v1beta1_BootstrapTokenDiscovery(in *kubeadm.BootstrapTokenDiscovery, out *BootstrapTokenDiscovery, s conversion.Scope) error { - return autoConvert_kubeadm_BootstrapTokenDiscovery_To_v1beta1_BootstrapTokenDiscovery(in, out, s) -} - -func autoConvert_v1beta1_BootstrapTokenString_To_kubeadm_BootstrapTokenString(in *BootstrapTokenString, out *kubeadm.BootstrapTokenString, s conversion.Scope) error { - out.ID = in.ID - out.Secret = in.Secret - return nil -} - -// Convert_v1beta1_BootstrapTokenString_To_kubeadm_BootstrapTokenString is an autogenerated conversion function. -func Convert_v1beta1_BootstrapTokenString_To_kubeadm_BootstrapTokenString(in *BootstrapTokenString, out *kubeadm.BootstrapTokenString, s conversion.Scope) error { - return autoConvert_v1beta1_BootstrapTokenString_To_kubeadm_BootstrapTokenString(in, out, s) -} - -func autoConvert_kubeadm_BootstrapTokenString_To_v1beta1_BootstrapTokenString(in *kubeadm.BootstrapTokenString, out *BootstrapTokenString, s conversion.Scope) error { - out.ID = in.ID - out.Secret = in.Secret - return nil -} - -// Convert_kubeadm_BootstrapTokenString_To_v1beta1_BootstrapTokenString is an autogenerated conversion function. -func Convert_kubeadm_BootstrapTokenString_To_v1beta1_BootstrapTokenString(in *kubeadm.BootstrapTokenString, out *BootstrapTokenString, s conversion.Scope) error { - return autoConvert_kubeadm_BootstrapTokenString_To_v1beta1_BootstrapTokenString(in, out, s) -} - -func autoConvert_v1beta1_ClusterConfiguration_To_kubeadm_ClusterConfiguration(in *ClusterConfiguration, out *kubeadm.ClusterConfiguration, s conversion.Scope) error { - if err := Convert_v1beta1_Etcd_To_kubeadm_Etcd(&in.Etcd, &out.Etcd, s); err != nil { - return err - } - if err := Convert_v1beta1_Networking_To_kubeadm_Networking(&in.Networking, &out.Networking, s); err != nil { - return err - } - out.KubernetesVersion = in.KubernetesVersion - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint - if err := Convert_v1beta1_APIServer_To_kubeadm_APIServer(&in.APIServer, &out.APIServer, s); err != nil { - return err - } - if err := Convert_v1beta1_ControlPlaneComponent_To_kubeadm_ControlPlaneComponent(&in.ControllerManager, &out.ControllerManager, s); err != nil { - return err - } - if err := Convert_v1beta1_ControlPlaneComponent_To_kubeadm_ControlPlaneComponent(&in.Scheduler, &out.Scheduler, s); err != nil { - return err - } - if err := Convert_v1beta1_DNS_To_kubeadm_DNS(&in.DNS, &out.DNS, s); err != nil { - return err - } - out.CertificatesDir = in.CertificatesDir - out.ImageRepository = in.ImageRepository - out.UseHyperKubeImage = in.UseHyperKubeImage - out.FeatureGates = *(*map[string]bool)(unsafe.Pointer(&in.FeatureGates)) - out.ClusterName = in.ClusterName - return nil -} - -// Convert_v1beta1_ClusterConfiguration_To_kubeadm_ClusterConfiguration is an autogenerated conversion function. -func Convert_v1beta1_ClusterConfiguration_To_kubeadm_ClusterConfiguration(in *ClusterConfiguration, out *kubeadm.ClusterConfiguration, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterConfiguration_To_kubeadm_ClusterConfiguration(in, out, s) -} - -func autoConvert_kubeadm_ClusterConfiguration_To_v1beta1_ClusterConfiguration(in *kubeadm.ClusterConfiguration, out *ClusterConfiguration, s conversion.Scope) error { - // INFO: in.ComponentConfigs opted out of conversion generation - if err := Convert_kubeadm_Etcd_To_v1beta1_Etcd(&in.Etcd, &out.Etcd, s); err != nil { - return err - } - if err := Convert_kubeadm_Networking_To_v1beta1_Networking(&in.Networking, &out.Networking, s); err != nil { - return err - } - out.KubernetesVersion = in.KubernetesVersion - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint - if err := Convert_kubeadm_APIServer_To_v1beta1_APIServer(&in.APIServer, &out.APIServer, s); err != nil { - return err - } - if err := Convert_kubeadm_ControlPlaneComponent_To_v1beta1_ControlPlaneComponent(&in.ControllerManager, &out.ControllerManager, s); err != nil { - return err - } - if err := Convert_kubeadm_ControlPlaneComponent_To_v1beta1_ControlPlaneComponent(&in.Scheduler, &out.Scheduler, s); err != nil { - return err - } - if err := Convert_kubeadm_DNS_To_v1beta1_DNS(&in.DNS, &out.DNS, s); err != nil { - return err - } - out.CertificatesDir = in.CertificatesDir - out.ImageRepository = in.ImageRepository - // INFO: in.CIImageRepository opted out of conversion generation - out.UseHyperKubeImage = in.UseHyperKubeImage - out.FeatureGates = *(*map[string]bool)(unsafe.Pointer(&in.FeatureGates)) - out.ClusterName = in.ClusterName - return nil -} - -// Convert_kubeadm_ClusterConfiguration_To_v1beta1_ClusterConfiguration is an autogenerated conversion function. -func Convert_kubeadm_ClusterConfiguration_To_v1beta1_ClusterConfiguration(in *kubeadm.ClusterConfiguration, out *ClusterConfiguration, s conversion.Scope) error { - return autoConvert_kubeadm_ClusterConfiguration_To_v1beta1_ClusterConfiguration(in, out, s) -} - -func autoConvert_v1beta1_ClusterStatus_To_kubeadm_ClusterStatus(in *ClusterStatus, out *kubeadm.ClusterStatus, s conversion.Scope) error { - out.APIEndpoints = *(*map[string]kubeadm.APIEndpoint)(unsafe.Pointer(&in.APIEndpoints)) - return nil -} - -// Convert_v1beta1_ClusterStatus_To_kubeadm_ClusterStatus is an autogenerated conversion function. -func Convert_v1beta1_ClusterStatus_To_kubeadm_ClusterStatus(in *ClusterStatus, out *kubeadm.ClusterStatus, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterStatus_To_kubeadm_ClusterStatus(in, out, s) -} - -func autoConvert_kubeadm_ClusterStatus_To_v1beta1_ClusterStatus(in *kubeadm.ClusterStatus, out *ClusterStatus, s conversion.Scope) error { - out.APIEndpoints = *(*map[string]APIEndpoint)(unsafe.Pointer(&in.APIEndpoints)) - return nil -} - -// Convert_kubeadm_ClusterStatus_To_v1beta1_ClusterStatus is an autogenerated conversion function. -func Convert_kubeadm_ClusterStatus_To_v1beta1_ClusterStatus(in *kubeadm.ClusterStatus, out *ClusterStatus, s conversion.Scope) error { - return autoConvert_kubeadm_ClusterStatus_To_v1beta1_ClusterStatus(in, out, s) -} - -func autoConvert_v1beta1_ControlPlaneComponent_To_kubeadm_ControlPlaneComponent(in *ControlPlaneComponent, out *kubeadm.ControlPlaneComponent, s conversion.Scope) error { - out.ExtraArgs = *(*map[string]string)(unsafe.Pointer(&in.ExtraArgs)) - out.ExtraVolumes = *(*[]kubeadm.HostPathMount)(unsafe.Pointer(&in.ExtraVolumes)) - return nil -} - -// Convert_v1beta1_ControlPlaneComponent_To_kubeadm_ControlPlaneComponent is an autogenerated conversion function. -func Convert_v1beta1_ControlPlaneComponent_To_kubeadm_ControlPlaneComponent(in *ControlPlaneComponent, out *kubeadm.ControlPlaneComponent, s conversion.Scope) error { - return autoConvert_v1beta1_ControlPlaneComponent_To_kubeadm_ControlPlaneComponent(in, out, s) -} - -func autoConvert_kubeadm_ControlPlaneComponent_To_v1beta1_ControlPlaneComponent(in *kubeadm.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_kubeadm_ControlPlaneComponent_To_v1beta1_ControlPlaneComponent is an autogenerated conversion function. -func Convert_kubeadm_ControlPlaneComponent_To_v1beta1_ControlPlaneComponent(in *kubeadm.ControlPlaneComponent, out *ControlPlaneComponent, s conversion.Scope) error { - return autoConvert_kubeadm_ControlPlaneComponent_To_v1beta1_ControlPlaneComponent(in, out, s) -} - -func autoConvert_v1beta1_DNS_To_kubeadm_DNS(in *DNS, out *kubeadm.DNS, s conversion.Scope) error { - out.Type = kubeadm.DNSAddOnType(in.Type) - if err := Convert_v1beta1_ImageMeta_To_kubeadm_ImageMeta(&in.ImageMeta, &out.ImageMeta, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_DNS_To_kubeadm_DNS is an autogenerated conversion function. -func Convert_v1beta1_DNS_To_kubeadm_DNS(in *DNS, out *kubeadm.DNS, s conversion.Scope) error { - return autoConvert_v1beta1_DNS_To_kubeadm_DNS(in, out, s) -} - -func autoConvert_kubeadm_DNS_To_v1beta1_DNS(in *kubeadm.DNS, out *DNS, s conversion.Scope) error { - out.Type = DNSAddOnType(in.Type) - if err := Convert_kubeadm_ImageMeta_To_v1beta1_ImageMeta(&in.ImageMeta, &out.ImageMeta, s); err != nil { - return err - } - return nil -} - -// Convert_kubeadm_DNS_To_v1beta1_DNS is an autogenerated conversion function. -func Convert_kubeadm_DNS_To_v1beta1_DNS(in *kubeadm.DNS, out *DNS, s conversion.Scope) error { - return autoConvert_kubeadm_DNS_To_v1beta1_DNS(in, out, s) -} - -func autoConvert_v1beta1_Discovery_To_kubeadm_Discovery(in *Discovery, out *kubeadm.Discovery, s conversion.Scope) error { - out.BootstrapToken = (*kubeadm.BootstrapTokenDiscovery)(unsafe.Pointer(in.BootstrapToken)) - out.File = (*kubeadm.FileDiscovery)(unsafe.Pointer(in.File)) - out.TLSBootstrapToken = in.TLSBootstrapToken - out.Timeout = (*v1.Duration)(unsafe.Pointer(in.Timeout)) - return nil -} - -// Convert_v1beta1_Discovery_To_kubeadm_Discovery is an autogenerated conversion function. -func Convert_v1beta1_Discovery_To_kubeadm_Discovery(in *Discovery, out *kubeadm.Discovery, s conversion.Scope) error { - return autoConvert_v1beta1_Discovery_To_kubeadm_Discovery(in, out, s) -} - -func autoConvert_kubeadm_Discovery_To_v1beta1_Discovery(in *kubeadm.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_kubeadm_Discovery_To_v1beta1_Discovery is an autogenerated conversion function. -func Convert_kubeadm_Discovery_To_v1beta1_Discovery(in *kubeadm.Discovery, out *Discovery, s conversion.Scope) error { - return autoConvert_kubeadm_Discovery_To_v1beta1_Discovery(in, out, s) -} - -func autoConvert_v1beta1_Etcd_To_kubeadm_Etcd(in *Etcd, out *kubeadm.Etcd, s conversion.Scope) error { - out.Local = (*kubeadm.LocalEtcd)(unsafe.Pointer(in.Local)) - out.External = (*kubeadm.ExternalEtcd)(unsafe.Pointer(in.External)) - return nil -} - -// Convert_v1beta1_Etcd_To_kubeadm_Etcd is an autogenerated conversion function. -func Convert_v1beta1_Etcd_To_kubeadm_Etcd(in *Etcd, out *kubeadm.Etcd, s conversion.Scope) error { - return autoConvert_v1beta1_Etcd_To_kubeadm_Etcd(in, out, s) -} - -func autoConvert_kubeadm_Etcd_To_v1beta1_Etcd(in *kubeadm.Etcd, out *Etcd, s conversion.Scope) error { - out.Local = (*LocalEtcd)(unsafe.Pointer(in.Local)) - out.External = (*ExternalEtcd)(unsafe.Pointer(in.External)) - return nil -} - -// Convert_kubeadm_Etcd_To_v1beta1_Etcd is an autogenerated conversion function. -func Convert_kubeadm_Etcd_To_v1beta1_Etcd(in *kubeadm.Etcd, out *Etcd, s conversion.Scope) error { - return autoConvert_kubeadm_Etcd_To_v1beta1_Etcd(in, out, s) -} - -func autoConvert_v1beta1_ExternalEtcd_To_kubeadm_ExternalEtcd(in *ExternalEtcd, out *kubeadm.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_kubeadm_ExternalEtcd is an autogenerated conversion function. -func Convert_v1beta1_ExternalEtcd_To_kubeadm_ExternalEtcd(in *ExternalEtcd, out *kubeadm.ExternalEtcd, s conversion.Scope) error { - return autoConvert_v1beta1_ExternalEtcd_To_kubeadm_ExternalEtcd(in, out, s) -} - -func autoConvert_kubeadm_ExternalEtcd_To_v1beta1_ExternalEtcd(in *kubeadm.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_kubeadm_ExternalEtcd_To_v1beta1_ExternalEtcd is an autogenerated conversion function. -func Convert_kubeadm_ExternalEtcd_To_v1beta1_ExternalEtcd(in *kubeadm.ExternalEtcd, out *ExternalEtcd, s conversion.Scope) error { - return autoConvert_kubeadm_ExternalEtcd_To_v1beta1_ExternalEtcd(in, out, s) -} - -func autoConvert_v1beta1_FileDiscovery_To_kubeadm_FileDiscovery(in *FileDiscovery, out *kubeadm.FileDiscovery, s conversion.Scope) error { - out.KubeConfigPath = in.KubeConfigPath - return nil -} - -// Convert_v1beta1_FileDiscovery_To_kubeadm_FileDiscovery is an autogenerated conversion function. -func Convert_v1beta1_FileDiscovery_To_kubeadm_FileDiscovery(in *FileDiscovery, out *kubeadm.FileDiscovery, s conversion.Scope) error { - return autoConvert_v1beta1_FileDiscovery_To_kubeadm_FileDiscovery(in, out, s) -} - -func autoConvert_kubeadm_FileDiscovery_To_v1beta1_FileDiscovery(in *kubeadm.FileDiscovery, out *FileDiscovery, s conversion.Scope) error { - out.KubeConfigPath = in.KubeConfigPath - return nil -} - -// Convert_kubeadm_FileDiscovery_To_v1beta1_FileDiscovery is an autogenerated conversion function. -func Convert_kubeadm_FileDiscovery_To_v1beta1_FileDiscovery(in *kubeadm.FileDiscovery, out *FileDiscovery, s conversion.Scope) error { - return autoConvert_kubeadm_FileDiscovery_To_v1beta1_FileDiscovery(in, out, s) -} - -func autoConvert_v1beta1_HostPathMount_To_kubeadm_HostPathMount(in *HostPathMount, out *kubeadm.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_kubeadm_HostPathMount is an autogenerated conversion function. -func Convert_v1beta1_HostPathMount_To_kubeadm_HostPathMount(in *HostPathMount, out *kubeadm.HostPathMount, s conversion.Scope) error { - return autoConvert_v1beta1_HostPathMount_To_kubeadm_HostPathMount(in, out, s) -} - -func autoConvert_kubeadm_HostPathMount_To_v1beta1_HostPathMount(in *kubeadm.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_kubeadm_HostPathMount_To_v1beta1_HostPathMount is an autogenerated conversion function. -func Convert_kubeadm_HostPathMount_To_v1beta1_HostPathMount(in *kubeadm.HostPathMount, out *HostPathMount, s conversion.Scope) error { - return autoConvert_kubeadm_HostPathMount_To_v1beta1_HostPathMount(in, out, s) -} - -func autoConvert_v1beta1_ImageMeta_To_kubeadm_ImageMeta(in *ImageMeta, out *kubeadm.ImageMeta, s conversion.Scope) error { - out.ImageRepository = in.ImageRepository - out.ImageTag = in.ImageTag - return nil -} - -// Convert_v1beta1_ImageMeta_To_kubeadm_ImageMeta is an autogenerated conversion function. -func Convert_v1beta1_ImageMeta_To_kubeadm_ImageMeta(in *ImageMeta, out *kubeadm.ImageMeta, s conversion.Scope) error { - return autoConvert_v1beta1_ImageMeta_To_kubeadm_ImageMeta(in, out, s) -} - -func autoConvert_kubeadm_ImageMeta_To_v1beta1_ImageMeta(in *kubeadm.ImageMeta, out *ImageMeta, s conversion.Scope) error { - out.ImageRepository = in.ImageRepository - out.ImageTag = in.ImageTag - return nil -} - -// Convert_kubeadm_ImageMeta_To_v1beta1_ImageMeta is an autogenerated conversion function. -func Convert_kubeadm_ImageMeta_To_v1beta1_ImageMeta(in *kubeadm.ImageMeta, out *ImageMeta, s conversion.Scope) error { - return autoConvert_kubeadm_ImageMeta_To_v1beta1_ImageMeta(in, out, s) -} - -func autoConvert_v1beta1_InitConfiguration_To_kubeadm_InitConfiguration(in *InitConfiguration, out *kubeadm.InitConfiguration, s conversion.Scope) error { - if err := Convert_v1beta1_ClusterConfiguration_To_kubeadm_ClusterConfiguration(&in.ClusterConfiguration, &out.ClusterConfiguration, s); err != nil { - return err - } - out.BootstrapTokens = *(*[]kubeadm.BootstrapToken)(unsafe.Pointer(&in.BootstrapTokens)) - if err := Convert_v1beta1_NodeRegistrationOptions_To_kubeadm_NodeRegistrationOptions(&in.NodeRegistration, &out.NodeRegistration, s); err != nil { - return err - } - if err := Convert_v1beta1_APIEndpoint_To_kubeadm_APIEndpoint(&in.LocalAPIEndpoint, &out.LocalAPIEndpoint, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_InitConfiguration_To_kubeadm_InitConfiguration is an autogenerated conversion function. -func Convert_v1beta1_InitConfiguration_To_kubeadm_InitConfiguration(in *InitConfiguration, out *kubeadm.InitConfiguration, s conversion.Scope) error { - return autoConvert_v1beta1_InitConfiguration_To_kubeadm_InitConfiguration(in, out, s) -} - -func autoConvert_kubeadm_InitConfiguration_To_v1beta1_InitConfiguration(in *kubeadm.InitConfiguration, out *InitConfiguration, s conversion.Scope) error { - if err := Convert_kubeadm_ClusterConfiguration_To_v1beta1_ClusterConfiguration(&in.ClusterConfiguration, &out.ClusterConfiguration, s); err != nil { - return err - } - out.BootstrapTokens = *(*[]BootstrapToken)(unsafe.Pointer(&in.BootstrapTokens)) - if err := Convert_kubeadm_NodeRegistrationOptions_To_v1beta1_NodeRegistrationOptions(&in.NodeRegistration, &out.NodeRegistration, s); err != nil { - return err - } - if err := Convert_kubeadm_APIEndpoint_To_v1beta1_APIEndpoint(&in.LocalAPIEndpoint, &out.LocalAPIEndpoint, s); err != nil { - return err - } - // WARNING: in.CertificateKey requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_JoinConfiguration_To_kubeadm_JoinConfiguration(in *JoinConfiguration, out *kubeadm.JoinConfiguration, s conversion.Scope) error { - if err := Convert_v1beta1_NodeRegistrationOptions_To_kubeadm_NodeRegistrationOptions(&in.NodeRegistration, &out.NodeRegistration, s); err != nil { - return err - } - out.CACertPath = in.CACertPath - if err := Convert_v1beta1_Discovery_To_kubeadm_Discovery(&in.Discovery, &out.Discovery, s); err != nil { - return err - } - if in.ControlPlane != nil { - in, out := &in.ControlPlane, &out.ControlPlane - *out = new(kubeadm.JoinControlPlane) - if err := Convert_v1beta1_JoinControlPlane_To_kubeadm_JoinControlPlane(*in, *out, s); err != nil { - return err - } - } else { - out.ControlPlane = nil - } - return nil -} - -// Convert_v1beta1_JoinConfiguration_To_kubeadm_JoinConfiguration is an autogenerated conversion function. -func Convert_v1beta1_JoinConfiguration_To_kubeadm_JoinConfiguration(in *JoinConfiguration, out *kubeadm.JoinConfiguration, s conversion.Scope) error { - return autoConvert_v1beta1_JoinConfiguration_To_kubeadm_JoinConfiguration(in, out, s) -} - -func autoConvert_kubeadm_JoinConfiguration_To_v1beta1_JoinConfiguration(in *kubeadm.JoinConfiguration, out *JoinConfiguration, s conversion.Scope) error { - if err := Convert_kubeadm_NodeRegistrationOptions_To_v1beta1_NodeRegistrationOptions(&in.NodeRegistration, &out.NodeRegistration, s); err != nil { - return err - } - out.CACertPath = in.CACertPath - if err := Convert_kubeadm_Discovery_To_v1beta1_Discovery(&in.Discovery, &out.Discovery, s); err != nil { - return err - } - if in.ControlPlane != nil { - in, out := &in.ControlPlane, &out.ControlPlane - *out = new(JoinControlPlane) - if err := Convert_kubeadm_JoinControlPlane_To_v1beta1_JoinControlPlane(*in, *out, s); err != nil { - return err - } - } else { - out.ControlPlane = nil - } - return nil -} - -// Convert_kubeadm_JoinConfiguration_To_v1beta1_JoinConfiguration is an autogenerated conversion function. -func Convert_kubeadm_JoinConfiguration_To_v1beta1_JoinConfiguration(in *kubeadm.JoinConfiguration, out *JoinConfiguration, s conversion.Scope) error { - return autoConvert_kubeadm_JoinConfiguration_To_v1beta1_JoinConfiguration(in, out, s) -} - -func autoConvert_v1beta1_JoinControlPlane_To_kubeadm_JoinControlPlane(in *JoinControlPlane, out *kubeadm.JoinControlPlane, s conversion.Scope) error { - if err := Convert_v1beta1_APIEndpoint_To_kubeadm_APIEndpoint(&in.LocalAPIEndpoint, &out.LocalAPIEndpoint, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_JoinControlPlane_To_kubeadm_JoinControlPlane is an autogenerated conversion function. -func Convert_v1beta1_JoinControlPlane_To_kubeadm_JoinControlPlane(in *JoinControlPlane, out *kubeadm.JoinControlPlane, s conversion.Scope) error { - return autoConvert_v1beta1_JoinControlPlane_To_kubeadm_JoinControlPlane(in, out, s) -} - -func autoConvert_kubeadm_JoinControlPlane_To_v1beta1_JoinControlPlane(in *kubeadm.JoinControlPlane, out *JoinControlPlane, s conversion.Scope) error { - if err := Convert_kubeadm_APIEndpoint_To_v1beta1_APIEndpoint(&in.LocalAPIEndpoint, &out.LocalAPIEndpoint, s); err != nil { - return err - } - // WARNING: in.CertificateKey requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_LocalEtcd_To_kubeadm_LocalEtcd(in *LocalEtcd, out *kubeadm.LocalEtcd, s conversion.Scope) error { - if err := Convert_v1beta1_ImageMeta_To_kubeadm_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_kubeadm_LocalEtcd is an autogenerated conversion function. -func Convert_v1beta1_LocalEtcd_To_kubeadm_LocalEtcd(in *LocalEtcd, out *kubeadm.LocalEtcd, s conversion.Scope) error { - return autoConvert_v1beta1_LocalEtcd_To_kubeadm_LocalEtcd(in, out, s) -} - -func autoConvert_kubeadm_LocalEtcd_To_v1beta1_LocalEtcd(in *kubeadm.LocalEtcd, out *LocalEtcd, s conversion.Scope) error { - if err := Convert_kubeadm_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_kubeadm_LocalEtcd_To_v1beta1_LocalEtcd is an autogenerated conversion function. -func Convert_kubeadm_LocalEtcd_To_v1beta1_LocalEtcd(in *kubeadm.LocalEtcd, out *LocalEtcd, s conversion.Scope) error { - return autoConvert_kubeadm_LocalEtcd_To_v1beta1_LocalEtcd(in, out, s) -} - -func autoConvert_v1beta1_Networking_To_kubeadm_Networking(in *Networking, out *kubeadm.Networking, s conversion.Scope) error { - out.ServiceSubnet = in.ServiceSubnet - out.PodSubnet = in.PodSubnet - out.DNSDomain = in.DNSDomain - return nil -} - -// Convert_v1beta1_Networking_To_kubeadm_Networking is an autogenerated conversion function. -func Convert_v1beta1_Networking_To_kubeadm_Networking(in *Networking, out *kubeadm.Networking, s conversion.Scope) error { - return autoConvert_v1beta1_Networking_To_kubeadm_Networking(in, out, s) -} - -func autoConvert_kubeadm_Networking_To_v1beta1_Networking(in *kubeadm.Networking, out *Networking, s conversion.Scope) error { - out.ServiceSubnet = in.ServiceSubnet - out.PodSubnet = in.PodSubnet - out.DNSDomain = in.DNSDomain - return nil -} - -// Convert_kubeadm_Networking_To_v1beta1_Networking is an autogenerated conversion function. -func Convert_kubeadm_Networking_To_v1beta1_Networking(in *kubeadm.Networking, out *Networking, s conversion.Scope) error { - return autoConvert_kubeadm_Networking_To_v1beta1_Networking(in, out, s) -} - -func autoConvert_v1beta1_NodeRegistrationOptions_To_kubeadm_NodeRegistrationOptions(in *NodeRegistrationOptions, out *kubeadm.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_v1beta1_NodeRegistrationOptions_To_kubeadm_NodeRegistrationOptions is an autogenerated conversion function. -func Convert_v1beta1_NodeRegistrationOptions_To_kubeadm_NodeRegistrationOptions(in *NodeRegistrationOptions, out *kubeadm.NodeRegistrationOptions, s conversion.Scope) error { - return autoConvert_v1beta1_NodeRegistrationOptions_To_kubeadm_NodeRegistrationOptions(in, out, s) -} - -func autoConvert_kubeadm_NodeRegistrationOptions_To_v1beta1_NodeRegistrationOptions(in *kubeadm.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 - return nil -} diff --git a/cmd/kubeadm/app/apis/kubeadm/v1beta1/zz_generated.deepcopy.go b/cmd/kubeadm/app/apis/kubeadm/v1beta1/zz_generated.deepcopy.go deleted file mode 100644 index d6cdfda335a..00000000000 --- a/cmd/kubeadm/app/apis/kubeadm/v1beta1/zz_generated.deepcopy.go +++ /dev/null @@ -1,552 +0,0 @@ -// +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 deepcopy-gen. DO NOT EDIT. - -package v1beta1 - -import ( - corev1 "k8s.io/api/core/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "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 - return -} - -// 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 - } - return -} - -// 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) - } - return -} - -// 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) - } - return -} - -// 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 - return -} - -// 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 - } - } - return -} - -// 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 - } - } - return -} - -// 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) - } - return -} - -// 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 - return -} - -// 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 - } - return -} - -// 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) - } - return -} - -// 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) - } - return -} - -// 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 - return -} - -// 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 - return -} - -// 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 - return -} - -// 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 - in.ClusterConfiguration.DeepCopyInto(&out.ClusterConfiguration) - 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 - return -} - -// 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 - } - return -} - -// 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 - return -} - -// 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) - } - return -} - -// 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 - return -} - -// 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 - } - } - return -} - -// 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/cmd/kubeadm/app/apis/kubeadm/v1beta1/zz_generated.defaults.go b/cmd/kubeadm/app/apis/kubeadm/v1beta1/zz_generated.defaults.go deleted file mode 100644 index 95a8e67963f..00000000000 --- a/cmd/kubeadm/app/apis/kubeadm/v1beta1/zz_generated.defaults.go +++ /dev/null @@ -1,66 +0,0 @@ -// +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 defaulter-gen. DO NOT EDIT. - -package v1beta1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// RegisterDefaults adds defaulters functions to the given scheme. -// Public to allow building arbitrary schemes. -// All generated defaulters are covering - they call all nested defaulters. -func RegisterDefaults(scheme *runtime.Scheme) error { - scheme.AddTypeDefaultingFunc(&ClusterConfiguration{}, func(obj interface{}) { SetObjectDefaults_ClusterConfiguration(obj.(*ClusterConfiguration)) }) - scheme.AddTypeDefaultingFunc(&ClusterStatus{}, func(obj interface{}) { SetObjectDefaults_ClusterStatus(obj.(*ClusterStatus)) }) - scheme.AddTypeDefaultingFunc(&InitConfiguration{}, func(obj interface{}) { SetObjectDefaults_InitConfiguration(obj.(*InitConfiguration)) }) - scheme.AddTypeDefaultingFunc(&JoinConfiguration{}, func(obj interface{}) { SetObjectDefaults_JoinConfiguration(obj.(*JoinConfiguration)) }) - return nil -} - -func SetObjectDefaults_ClusterConfiguration(in *ClusterConfiguration) { - SetDefaults_ClusterConfiguration(in) - SetDefaults_APIServer(&in.APIServer) -} - -func SetObjectDefaults_ClusterStatus(in *ClusterStatus) { -} - -func SetObjectDefaults_InitConfiguration(in *InitConfiguration) { - SetDefaults_InitConfiguration(in) - SetObjectDefaults_ClusterConfiguration(&in.ClusterConfiguration) - for i := range in.BootstrapTokens { - a := &in.BootstrapTokens[i] - SetDefaults_BootstrapToken(a) - } - SetDefaults_APIEndpoint(&in.LocalAPIEndpoint) -} - -func SetObjectDefaults_JoinConfiguration(in *JoinConfiguration) { - SetDefaults_JoinConfiguration(in) - SetDefaults_Discovery(&in.Discovery) - if in.Discovery.File != nil { - SetDefaults_FileDiscovery(in.Discovery.File) - } - if in.ControlPlane != nil { - SetDefaults_JoinControlPlane(in.ControlPlane) - SetDefaults_APIEndpoint(&in.ControlPlane.LocalAPIEndpoint) - } -} diff --git a/cmd/kubeadm/app/util/config/common_test.go b/cmd/kubeadm/app/util/config/common_test.go index 327f396baaa..4900e5c5540 100644 --- a/cmd/kubeadm/app/util/config/common_test.go +++ b/cmd/kubeadm/app/util/config/common_test.go @@ -71,12 +71,7 @@ func TestValidateSupportedVersion(t *testing.T) { Version: "v1beta1", }, allowDeprecated: true, - }, - { - gv: schema.GroupVersion{ - Group: KubeadmGroupName, - Version: "v1beta1", - }, + expectedErr: true, }, { gv: schema.GroupVersion{ @@ -225,7 +220,7 @@ func TestMigrateOldConfigFromFile(t *testing.T) { { desc: "InitConfiguration only gets migrated", oldCfg: dedent.Dedent(` - apiVersion: kubeadm.k8s.io/v1beta1 + apiVersion: kubeadm.k8s.io/v1beta2 kind: InitConfiguration `), expectedKinds: []string{ @@ -237,7 +232,7 @@ func TestMigrateOldConfigFromFile(t *testing.T) { { desc: "ClusterConfiguration only gets migrated", oldCfg: dedent.Dedent(` - apiVersion: kubeadm.k8s.io/v1beta1 + apiVersion: kubeadm.k8s.io/v1beta2 kind: ClusterConfiguration `), expectedKinds: []string{ @@ -249,7 +244,7 @@ func TestMigrateOldConfigFromFile(t *testing.T) { { desc: "JoinConfiguration only gets migrated", oldCfg: dedent.Dedent(` - apiVersion: kubeadm.k8s.io/v1beta1 + apiVersion: kubeadm.k8s.io/v1beta2 kind: JoinConfiguration discovery: bootstrapToken: @@ -265,10 +260,10 @@ func TestMigrateOldConfigFromFile(t *testing.T) { { desc: "Init + Cluster Configurations are migrated", oldCfg: dedent.Dedent(` - apiVersion: kubeadm.k8s.io/v1beta1 + apiVersion: kubeadm.k8s.io/v1beta2 kind: InitConfiguration --- - apiVersion: kubeadm.k8s.io/v1beta1 + apiVersion: kubeadm.k8s.io/v1beta2 kind: ClusterConfiguration `), expectedKinds: []string{ @@ -280,10 +275,10 @@ func TestMigrateOldConfigFromFile(t *testing.T) { { desc: "Init + Join Configurations are migrated", oldCfg: dedent.Dedent(` - apiVersion: kubeadm.k8s.io/v1beta1 + apiVersion: kubeadm.k8s.io/v1beta2 kind: InitConfiguration --- - apiVersion: kubeadm.k8s.io/v1beta1 + apiVersion: kubeadm.k8s.io/v1beta2 kind: JoinConfiguration discovery: bootstrapToken: @@ -301,10 +296,10 @@ func TestMigrateOldConfigFromFile(t *testing.T) { { desc: "Cluster + Join Configurations are migrated", oldCfg: dedent.Dedent(` - apiVersion: kubeadm.k8s.io/v1beta1 + apiVersion: kubeadm.k8s.io/v1beta2 kind: ClusterConfiguration --- - apiVersion: kubeadm.k8s.io/v1beta1 + apiVersion: kubeadm.k8s.io/v1beta2 kind: JoinConfiguration discovery: bootstrapToken: @@ -322,13 +317,13 @@ func TestMigrateOldConfigFromFile(t *testing.T) { { desc: "Init + Cluster + Join Configurations are migrated", oldCfg: dedent.Dedent(` - apiVersion: kubeadm.k8s.io/v1beta1 + apiVersion: kubeadm.k8s.io/v1beta2 kind: InitConfiguration --- - apiVersion: kubeadm.k8s.io/v1beta1 + apiVersion: kubeadm.k8s.io/v1beta2 kind: ClusterConfiguration --- - apiVersion: kubeadm.k8s.io/v1beta1 + apiVersion: kubeadm.k8s.io/v1beta2 kind: JoinConfiguration discovery: bootstrapToken: