diff --git a/cmd/kubeadm/app/cmd/join.go b/cmd/kubeadm/app/cmd/join.go index b7ce3fc940e..d489081d137 100644 --- a/cmd/kubeadm/app/cmd/join.go +++ b/cmd/kubeadm/app/cmd/join.go @@ -124,7 +124,7 @@ var ( // supported by this api will be exposed as a flag. type joinOptions struct { cfgPath string - token string + token string `datapolicy:"token"` controlPlane bool ignorePreflightErrors []string externalcfg *kubeadmapiv1beta2.JoinConfiguration diff --git a/cmd/kubeadm/app/cmd/options/token.go b/cmd/kubeadm/app/cmd/options/token.go index fb45162d2f6..ac043df3153 100644 --- a/cmd/kubeadm/app/cmd/options/token.go +++ b/cmd/kubeadm/app/cmd/options/token.go @@ -39,7 +39,7 @@ func NewBootstrapTokenOptions() *BootstrapTokenOptions { // TODO: In the future, we might want to group the flags in a better way than adding them all individually like this type BootstrapTokenOptions struct { *kubeadmapiv1beta2.BootstrapToken - TokenStr string + TokenStr string `datapolicy:"token"` } // AddTokenFlag adds the --token flag to the given flagset diff --git a/cmd/kubeadm/app/phases/kubeconfig/kubeconfig.go b/cmd/kubeadm/app/phases/kubeconfig/kubeconfig.go index e0ca88bed6a..48c5af8ef1b 100644 --- a/cmd/kubeadm/app/phases/kubeconfig/kubeconfig.go +++ b/cmd/kubeadm/app/phases/kubeconfig/kubeconfig.go @@ -53,7 +53,7 @@ type clientCertAuth struct { // tokenAuth struct holds info required to use a token to provide authentication info in a kubeconfig object type tokenAuth struct { - Token string + Token string `datapolicy:"token"` } // kubeConfigSpec struct holds info required to build a KubeConfig object @@ -61,8 +61,8 @@ type kubeConfigSpec struct { CACert *x509.Certificate APIServer string ClientName string - TokenAuth *tokenAuth - ClientCertAuth *clientCertAuth + TokenAuth *tokenAuth `datapolicy:"token"` + ClientCertAuth *clientCertAuth `datapolicy:"security-key"` } // CreateJoinControlPlaneKubeConfigFiles will create and write to disk the kubeconfig files required by kubeadm diff --git a/cmd/kubeadm/app/phases/selfhosting/selfhosting_volumes.go b/cmd/kubeadm/app/phases/selfhosting/selfhosting_volumes.go index 91ffa338ee0..a877ec34e53 100644 --- a/cmd/kubeadm/app/phases/selfhosting/selfhosting_volumes.go +++ b/cmd/kubeadm/app/phases/selfhosting/selfhosting_volumes.go @@ -29,7 +29,7 @@ import ( "k8s.io/kubernetes/cmd/kubeadm/app/util/apiclient" ) -type tlsKeyPair struct { +type tlsKeyPairPath struct { name string cert string key string @@ -310,8 +310,8 @@ func createOpaqueSecretFromFile(secretName, file string) (*v1.Secret, error) { }, nil } -func getTLSKeyPairs() []*tlsKeyPair { - return []*tlsKeyPair{ +func getTLSKeyPairs() []*tlsKeyPairPath { + return []*tlsKeyPairPath{ { name: kubeadmconstants.CACertAndKeyBaseName, cert: kubeadmconstants.CACertName,