mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +00:00
Merge pull request #84286 from bart0sh/PR0083-kubeadm-Token-remove-ObjectMeta
kubeadm: remove ObjectMeta from output.BootstrapTooken
This commit is contained in:
commit
01d20c689f
@ -36,7 +36,6 @@ func Funcs(codecs runtimeserializer.CodecFactory) []interface{} {
|
|||||||
func fuzzBootstrapToken(obj *output.BootstrapToken, c fuzz.Continue) {
|
func fuzzBootstrapToken(obj *output.BootstrapToken, c fuzz.Continue) {
|
||||||
c.FuzzNoCustom(obj)
|
c.FuzzNoCustom(obj)
|
||||||
|
|
||||||
obj.ObjectMeta = metav1.ObjectMeta{}
|
|
||||||
obj.Token = &kubeadmapiv1beta2.BootstrapTokenString{ID: "uvxdac", Secret: "fq35fuyue3kd4gda"}
|
obj.Token = &kubeadmapiv1beta2.BootstrapTokenString{ID: "uvxdac", Secret: "fq35fuyue3kd4gda"}
|
||||||
obj.Description = ""
|
obj.Description = ""
|
||||||
obj.TTL = &metav1.Duration{Duration: time.Hour * 24}
|
obj.TTL = &metav1.Duration{Duration: time.Hour * 24}
|
||||||
|
@ -28,7 +28,6 @@ import (
|
|||||||
// metav1.TypeMeta and metav1.ObjectMeta
|
// metav1.TypeMeta and metav1.ObjectMeta
|
||||||
type BootstrapToken struct {
|
type BootstrapToken struct {
|
||||||
metav1.TypeMeta
|
metav1.TypeMeta
|
||||||
metav1.ObjectMeta
|
|
||||||
|
|
||||||
kubeadmapiv1beta2.BootstrapToken
|
kubeadmapiv1beta2.BootstrapToken
|
||||||
}
|
}
|
||||||
|
@ -27,8 +27,7 @@ import (
|
|||||||
// This is a copy of BoostrapToken struct from ../kubeadm/types.go with 2 additions:
|
// This is a copy of BoostrapToken struct from ../kubeadm/types.go with 2 additions:
|
||||||
// metav1.TypeMeta and metav1.ObjectMeta
|
// metav1.TypeMeta and metav1.ObjectMeta
|
||||||
type BootstrapToken struct {
|
type BootstrapToken struct {
|
||||||
metav1.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
metav1.ObjectMeta `json:",inline"`
|
|
||||||
|
|
||||||
kubeadmapiv1beta2.BootstrapToken
|
kubeadmapiv1beta2.BootstrapToken
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,6 @@ func RegisterConversions(s *runtime.Scheme) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func autoConvert_v1alpha1_BootstrapToken_To_output_BootstrapToken(in *BootstrapToken, out *output.BootstrapToken, s conversion.Scope) error {
|
func autoConvert_v1alpha1_BootstrapToken_To_output_BootstrapToken(in *BootstrapToken, out *output.BootstrapToken, s conversion.Scope) error {
|
||||||
out.ObjectMeta = in.ObjectMeta
|
|
||||||
out.BootstrapToken = in.BootstrapToken
|
out.BootstrapToken = in.BootstrapToken
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -58,7 +57,6 @@ func Convert_v1alpha1_BootstrapToken_To_output_BootstrapToken(in *BootstrapToken
|
|||||||
}
|
}
|
||||||
|
|
||||||
func autoConvert_output_BootstrapToken_To_v1alpha1_BootstrapToken(in *output.BootstrapToken, out *BootstrapToken, s conversion.Scope) error {
|
func autoConvert_output_BootstrapToken_To_v1alpha1_BootstrapToken(in *output.BootstrapToken, out *BootstrapToken, s conversion.Scope) error {
|
||||||
out.ObjectMeta = in.ObjectMeta
|
|
||||||
out.BootstrapToken = in.BootstrapToken
|
out.BootstrapToken = in.BootstrapToken
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,6 @@ import (
|
|||||||
func (in *BootstrapToken) DeepCopyInto(out *BootstrapToken) {
|
func (in *BootstrapToken) DeepCopyInto(out *BootstrapToken) {
|
||||||
*out = *in
|
*out = *in
|
||||||
out.TypeMeta = in.TypeMeta
|
out.TypeMeta = in.TypeMeta
|
||||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
|
||||||
in.BootstrapToken.DeepCopyInto(&out.BootstrapToken)
|
in.BootstrapToken.DeepCopyInto(&out.BootstrapToken)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,6 @@ import (
|
|||||||
func (in *BootstrapToken) DeepCopyInto(out *BootstrapToken) {
|
func (in *BootstrapToken) DeepCopyInto(out *BootstrapToken) {
|
||||||
*out = *in
|
*out = *in
|
||||||
out.TypeMeta = in.TypeMeta
|
out.TypeMeta = in.TypeMeta
|
||||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
|
||||||
in.BootstrapToken.DeepCopyInto(&out.BootstrapToken)
|
in.BootstrapToken.DeepCopyInto(&out.BootstrapToken)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -358,7 +358,6 @@ func TestTokenOutput(t *testing.T) {
|
|||||||
expected: `{
|
expected: `{
|
||||||
"kind": "BootstrapToken",
|
"kind": "BootstrapToken",
|
||||||
"apiVersion": "output.kubeadm.k8s.io/v1alpha1",
|
"apiVersion": "output.kubeadm.k8s.io/v1alpha1",
|
||||||
"creationTimestamp": null,
|
|
||||||
"token": "abcdef.1234567890123456",
|
"token": "abcdef.1234567890123456",
|
||||||
"description": "valid bootstrap tooken",
|
"description": "valid bootstrap tooken",
|
||||||
"usages": [
|
"usages": [
|
||||||
@ -380,7 +379,6 @@ func TestTokenOutput(t *testing.T) {
|
|||||||
extraGroups: []string{"system:bootstrappers:kubeadm:default-node-token"},
|
extraGroups: []string{"system:bootstrappers:kubeadm:default-node-token"},
|
||||||
outputFormat: "yaml",
|
outputFormat: "yaml",
|
||||||
expected: `apiVersion: output.kubeadm.k8s.io/v1alpha1
|
expected: `apiVersion: output.kubeadm.k8s.io/v1alpha1
|
||||||
creationTimestamp: null
|
|
||||||
description: valid bootstrap tooken
|
description: valid bootstrap tooken
|
||||||
groups:
|
groups:
|
||||||
- system:bootstrappers:kubeadm:default-node-token
|
- system:bootstrappers:kubeadm:default-node-token
|
||||||
|
Loading…
Reference in New Issue
Block a user