Merge pull request #95991 from serathius/datapolicy-kubeadm

Add datapolicy tags to cmd/kubeadm directory
This commit is contained in:
Kubernetes Prow Robot 2020-11-03 22:50:17 -08:00 committed by GitHub
commit acc3910964
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

View File

@ -124,7 +124,7 @@ var (
// supported by this api will be exposed as a flag. // supported by this api will be exposed as a flag.
type joinOptions struct { type joinOptions struct {
cfgPath string cfgPath string
token string token string `datapolicy:"token"`
controlPlane bool controlPlane bool
ignorePreflightErrors []string ignorePreflightErrors []string
externalcfg *kubeadmapiv1beta2.JoinConfiguration externalcfg *kubeadmapiv1beta2.JoinConfiguration

View File

@ -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 // 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 { type BootstrapTokenOptions struct {
*kubeadmapiv1beta2.BootstrapToken *kubeadmapiv1beta2.BootstrapToken
TokenStr string TokenStr string `datapolicy:"token"`
} }
// AddTokenFlag adds the --token flag to the given flagset // AddTokenFlag adds the --token flag to the given flagset

View File

@ -53,7 +53,7 @@ type clientCertAuth struct {
// tokenAuth struct holds info required to use a token to provide authentication info in a kubeconfig object // tokenAuth struct holds info required to use a token to provide authentication info in a kubeconfig object
type tokenAuth struct { type tokenAuth struct {
Token string Token string `datapolicy:"token"`
} }
// kubeConfigSpec struct holds info required to build a KubeConfig object // kubeConfigSpec struct holds info required to build a KubeConfig object
@ -61,8 +61,8 @@ type kubeConfigSpec struct {
CACert *x509.Certificate CACert *x509.Certificate
APIServer string APIServer string
ClientName string ClientName string
TokenAuth *tokenAuth TokenAuth *tokenAuth `datapolicy:"token"`
ClientCertAuth *clientCertAuth ClientCertAuth *clientCertAuth `datapolicy:"security-key"`
} }
// CreateJoinControlPlaneKubeConfigFiles will create and write to disk the kubeconfig files required by kubeadm // CreateJoinControlPlaneKubeConfigFiles will create and write to disk the kubeconfig files required by kubeadm

View File

@ -29,7 +29,7 @@ import (
"k8s.io/kubernetes/cmd/kubeadm/app/util/apiclient" "k8s.io/kubernetes/cmd/kubeadm/app/util/apiclient"
) )
type tlsKeyPair struct { type tlsKeyPairPath struct {
name string name string
cert string cert string
key string key string
@ -310,8 +310,8 @@ func createOpaqueSecretFromFile(secretName, file string) (*v1.Secret, error) {
}, nil }, nil
} }
func getTLSKeyPairs() []*tlsKeyPair { func getTLSKeyPairs() []*tlsKeyPairPath {
return []*tlsKeyPair{ return []*tlsKeyPairPath{
{ {
name: kubeadmconstants.CACertAndKeyBaseName, name: kubeadmconstants.CACertAndKeyBaseName,
cert: kubeadmconstants.CACertName, cert: kubeadmconstants.CACertName,