Documentation ¶
Index ¶
- Constants
- func GetTokenSecretNamePrefix(serviceAccountName string) string
- func NewCmdServiceAccounts(name, fullName string, f kcmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command
- func NewCommandCreateKubeconfig(name, fullname string, f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command
- func NewCommandGetServiceAccountToken(name, fullname string, f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command
- func NewCommandNewServiceAccountToken(name, fullname string, f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command
- type CreateKubeconfigOptions
- type GetServiceAccountTokenOptions
- type ServiceAccountTokenOptions
Constants ¶
View Source
const (
CreateKubeconfigRecommendedName = "create-kubeconfig"
)
View Source
const (
GetServiceAccountTokenRecommendedName = "get-token"
)
View Source
const (
NewServiceAccountTokenRecommendedName = "new-token"
)
View Source
const ServiceAccountsRecommendedName = "serviceaccounts"
Variables ¶
This section is empty.
Functions ¶
func GetTokenSecretNamePrefix ¶
GetTokenSecretNamePrefix creates the prefix used for the generated SA token secret. This is compatible with kube up until long names, at which point we hash the SA name and leave the "token-" intact. Upstream clips the value and generates a random string. TODO fix the upstream implementation to be more like this.
func NewCmdServiceAccounts ¶
Types ¶
type CreateKubeconfigOptions ¶
type CreateKubeconfigOptions struct { SAName string SAClient corev1client.ServiceAccountInterface SecretsClient corev1client.SecretInterface RawConfig clientcmdapi.Config ContextNamespace string genericclioptions.IOStreams }
func NewCreateKubeconfigOptions ¶
func NewCreateKubeconfigOptions(streams genericclioptions.IOStreams) *CreateKubeconfigOptions
func (*CreateKubeconfigOptions) Run ¶
func (o *CreateKubeconfigOptions) Run() error
func (*CreateKubeconfigOptions) Validate ¶
func (o *CreateKubeconfigOptions) Validate() error
type GetServiceAccountTokenOptions ¶
type GetServiceAccountTokenOptions struct { SAName string SAClient corev1client.ServiceAccountInterface SecretsClient corev1client.SecretInterface genericclioptions.IOStreams }
func NewGetServiceAccountTokenOptions ¶
func NewGetServiceAccountTokenOptions(streams genericclioptions.IOStreams) *GetServiceAccountTokenOptions
func (*GetServiceAccountTokenOptions) Run ¶
func (o *GetServiceAccountTokenOptions) Run() error
func (*GetServiceAccountTokenOptions) Validate ¶
func (o *GetServiceAccountTokenOptions) Validate() error
type ServiceAccountTokenOptions ¶
type ServiceAccountTokenOptions struct { SAName string SAClient corev1client.ServiceAccountInterface SecretsClient corev1client.SecretInterface Labels map[string]string Timeout time.Duration genericclioptions.IOStreams }
func NewServiceAccountTokenOptions ¶
func NewServiceAccountTokenOptions(streams genericclioptions.IOStreams) *ServiceAccountTokenOptions
func (*ServiceAccountTokenOptions) Run ¶
func (o *ServiceAccountTokenOptions) Run() error
Run creates a new token secret, waits for the service account token controller to fulfill it, then adds the token to the service account
func (*ServiceAccountTokenOptions) Validate ¶
func (o *ServiceAccountTokenOptions) Validate() error
Click to show internal directories.
Click to hide internal directories.