kubeadm: make output/BootstrapToken use bootstraptoken/v1

This commit is contained in:
Lubomir I. Ivanov 2021-09-28 16:32:32 +03:00
parent 47af311ea4
commit 73d528dce9
3 changed files with 5 additions and 9 deletions

View File

@ -24,7 +24,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer"
kubeadmapiv1beta2 "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta2"
bootstraptokenv1 "k8s.io/kubernetes/cmd/kubeadm/app/apis/bootstraptoken/v1"
"k8s.io/kubernetes/cmd/kubeadm/app/apis/output"
)
@ -38,7 +38,7 @@ func Funcs(codecs runtimeserializer.CodecFactory) []interface{} {
func fuzzBootstrapToken(obj *output.BootstrapToken, c fuzz.Continue) {
c.FuzzNoCustom(obj)
obj.Token = &kubeadmapiv1beta2.BootstrapTokenString{ID: "uvxdac", Secret: "fq35fuyue3kd4gda"}
obj.Token = &bootstraptokenv1.BootstrapTokenString{ID: "uvxdac", Secret: "fq35fuyue3kd4gda"}
obj.Description = ""
obj.TTL = &metav1.Duration{Duration: time.Hour * 24}
obj.Usages = []string{"authentication", "signing"}

View File

@ -19,18 +19,16 @@ package output
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kubeadmapiv1beta2 "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta2"
bootstraptokenv1 "k8s.io/kubernetes/cmd/kubeadm/app/apis/bootstraptoken/v1"
)
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// BootstrapToken represents information for the output produced by 'kubeadm token list'
// This is a copy of BootstrapToken struct from ../kubeadm/types.go with 2 additions:
// metav1.TypeMeta and metav1.ObjectMeta
// BootstrapToken represents information for the bootstrap token output produced by kubeadm
type BootstrapToken struct {
metav1.TypeMeta
kubeadmapiv1beta2.BootstrapToken
bootstraptokenv1.BootstrapToken
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

View File

@ -25,8 +25,6 @@ import (
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// BootstrapToken represents information for the bootstrap token output produced by kubeadm
// This is a copy of BootstrapToken struct from ../kubeadm/types.go with 2 additions:
// metav1.TypeMeta and metav1.ObjectMeta
type BootstrapToken struct {
metav1.TypeMeta `json:",inline"`