Documentation ¶
Index ¶
- Constants
- Variables
- func NewCmdCreateBasicAuthSecret(name, fullName string, f kcmdutil.Factory, streams genericclioptions.IOStreams, ...) *cobra.Command
- func NewCmdCreateDockerConfigSecret(name, fullName string, f kcmdutil.Factory, streams genericclioptions.IOStreams, ...) *cobra.Command
- func NewCmdCreateSSHAuthSecret(name, fullName string, f kcmdutil.Factory, streams genericclioptions.IOStreams, ...) *cobra.Command
- func NewCmdCreateSecret(name, fullName string, f kcmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command
- func NewCmdLinkSecret(name, fullName string, f kcmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command
- func NewCmdSecrets(name, fullName string, f kcmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command
- func NewCmdUnlinkSecret(name, fullName string, f kcmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command
- type CreateBasicAuthSecretOptions
- type CreateDockerConfigOptions
- type CreateSSHAuthSecretOptions
- type CreateSecretOptions
- type KnownSecretType
- type LinkSecretOptions
- type SecretOptions
- func (o *SecretOptions) Complete(f kcmdutil.Factory, args []string) error
- func (o SecretOptions) GetMountSecretNames(serviceaccount *corev1.ServiceAccount) sets.String
- func (o SecretOptions) GetPullSecretNames(serviceaccount *corev1.ServiceAccount) sets.String
- func (o SecretOptions) GetSecretNames(secrets []*corev1.Secret) sets.String
- func (o SecretOptions) GetSecrets(allowNonExisting bool) ([]*corev1.Secret, bool, error)
- func (o SecretOptions) GetServiceAccount() (*corev1.ServiceAccount, error)
- func (o SecretOptions) Validate() error
- type UnlinkSecretOptions
Constants ¶
const ( // SourceUsername is the key of the optional username for basic authentication subcommand SourceUsername = "username" // SourcePassword is the key of the optional password or token for basic authentication subcommand SourcePassword = "password" // SourceCertificate is the key of the optional certificate authority for basic authentication subcommand SourceCertificate = "ca.crt" // SourcePrivateKey is the key of the required SSH private key for SSH authentication subcommand SourcePrivateKey = "ssh-privatekey" // SourceGitconfig is the key of the optional gitconfig content for both basic and SSH authentication subcommands SourceGitConfig = ".gitconfig" )
const CreateBasicAuthSecretRecommendedCommandName = "new-basicauth"
CreateBasicAuthSecretRecommendedCommandName represents name of subcommand for `oc secrets` command
const CreateDockerConfigSecretRecommendedName = "new-dockercfg"
const CreateSSHAuthSecretRecommendedCommandName = "new-sshauth"
CreateSSHAuthSecretRecommendedCommandName represents name of subcommand for `oc secrets` command
const LinkSecretRecommendedName = "link"
LinkSecretRecommendedName `oc secrets link`
const NewSecretRecommendedCommandName = "new"
const SecretsRecommendedName = "secrets"
const UnlinkSecretRecommendedName = "unlink"
Variables ¶
var ( KnownSecretTypes = []KnownSecretType{ {coreapiv1.SecretTypeDockercfg, sets.NewString(coreapiv1.DockerConfigKey)}, {coreapiv1.SecretTypeDockerConfigJson, sets.NewString(coreapiv1.DockerConfigJsonKey)}, } )
Functions ¶
func NewCmdCreateBasicAuthSecret ¶
func NewCmdCreateBasicAuthSecret(name, fullName string, f kcmdutil.Factory, streams genericclioptions.IOStreams, newSecretFullName, ocEditFullName string) *cobra.Command
NewCmdCreateBasicAuthSecret implements the OpenShift cli secrets new-basicauth subcommand
func NewCmdCreateDockerConfigSecret ¶
func NewCmdCreateDockerConfigSecret(name, fullName string, f kcmdutil.Factory, streams genericclioptions.IOStreams, newSecretFullName, ocEditFullName string) *cobra.Command
NewCmdCreateDockerConfigSecret creates a command object for making a dockercfg secret
func NewCmdCreateSSHAuthSecret ¶
func NewCmdCreateSSHAuthSecret(name, fullName string, f kcmdutil.Factory, streams genericclioptions.IOStreams, newSecretFullName, ocEditFullName string) *cobra.Command
NewCmdCreateSSHAuthSecret implements the OpenShift cli secrets new-sshauth subcommand
func NewCmdCreateSecret ¶
func NewCmdLinkSecret ¶
func NewCmdLinkSecret(name, fullName string, f kcmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command
NewCmdLinkSecret creates a command object for linking a secret reference to a service account
func NewCmdSecrets ¶
func NewCmdUnlinkSecret ¶
func NewCmdUnlinkSecret(name, fullName string, f kcmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command
NewCmdUnlinkSecret creates a command object for detaching one or more secret references from a service account
Types ¶
type CreateBasicAuthSecretOptions ¶
type CreateBasicAuthSecretOptions struct { PrintFlags *genericclioptions.PrintFlags Printer printers.ResourcePrinter SecretName string Username string Password string CertificatePath string GitConfigPath string PromptForPassword bool SecretsInterface corev1client.SecretInterface genericclioptions.IOStreams }
CreateBasicAuthSecretOptions holds the credential needed to authenticate against SCM servers.
func NewCreateBasicAuthSecretOptions ¶
func NewCreateBasicAuthSecretOptions(streams genericclioptions.IOStreams) *CreateBasicAuthSecretOptions
func (*CreateBasicAuthSecretOptions) Complete ¶
func (o *CreateBasicAuthSecretOptions) Complete(f kcmdutil.Factory, args []string) error
Complete fills CreateBasicAuthSecretOptions fields with data and checks for mutual exclusivity between flags from different option groups.
func (*CreateBasicAuthSecretOptions) NewBasicAuthSecret ¶
func (o *CreateBasicAuthSecretOptions) NewBasicAuthSecret() (*corev1.Secret, error)
NewBasicAuthSecret builds up the Secret structure containing secret name, type and data structure containing desired credentials.
func (*CreateBasicAuthSecretOptions) Run ¶
func (o *CreateBasicAuthSecretOptions) Run() error
CreateBasicAuthSecret saves created Secret structure and prints the secret name to the output on success.
func (CreateBasicAuthSecretOptions) Validate ¶
func (o CreateBasicAuthSecretOptions) Validate() error
Validate check if all necessary fields from CreateBasicAuthSecretOptions are present.
type CreateDockerConfigOptions ¶
type CreateDockerConfigOptions struct { PrintFlags *genericclioptions.PrintFlags Printer printers.ResourcePrinter SecretName string RegistryLocation string Username string Password string EmailAddress string SecretsInterface corev1client.SecretInterface genericclioptions.IOStreams }
func NewCreateDockerConfigOptions ¶
func NewCreateDockerConfigOptions(streams genericclioptions.IOStreams) *CreateDockerConfigOptions
func (*CreateDockerConfigOptions) Complete ¶
func (o *CreateDockerConfigOptions) Complete(f kcmdutil.Factory, args []string) error
func (CreateDockerConfigOptions) NewDockerSecret ¶
func (o CreateDockerConfigOptions) NewDockerSecret() (*corev1.Secret, error)
func (CreateDockerConfigOptions) Run ¶
func (o CreateDockerConfigOptions) Run() error
func (CreateDockerConfigOptions) Validate ¶
func (o CreateDockerConfigOptions) Validate() error
type CreateSSHAuthSecretOptions ¶
type CreateSSHAuthSecretOptions struct { PrintFlags *genericclioptions.PrintFlags Printer printers.ResourcePrinter SecretName string PrivateKeyPath string CertificatePath string GitConfigPath string PromptForPassword bool SecretsInterface corev1client.SecretInterface genericclioptions.IOStreams }
CreateSSHAuthSecretOptions holds the credential needed to authenticate against SCM servers.
func NewCreateSSHAuthSecretOptions ¶
func NewCreateSSHAuthSecretOptions(streams genericclioptions.IOStreams) *CreateSSHAuthSecretOptions
func (*CreateSSHAuthSecretOptions) Complete ¶
func (o *CreateSSHAuthSecretOptions) Complete(f kcmdutil.Factory, args []string) error
Complete fills CreateSSHAuthSecretOptions fields with data and checks whether necessary arguments were provided.
func (*CreateSSHAuthSecretOptions) NewSSHAuthSecret ¶
func (o *CreateSSHAuthSecretOptions) NewSSHAuthSecret() (*corev1.Secret, error)
NewSSHAuthSecret builds up the Secret structure containing secret name, type and data structure containing desired credentials.
func (*CreateSSHAuthSecretOptions) Run ¶
func (o *CreateSSHAuthSecretOptions) Run() error
CreateSSHAuthSecret saves created Secret structure and prints the secret name to the output on success.
func (CreateSSHAuthSecretOptions) Validate ¶
func (o CreateSSHAuthSecretOptions) Validate(args []string) error
Validate check if all necessary fields from CreateSSHAuthSecretOptions are present.
type CreateSecretOptions ¶
type CreateSecretOptions struct { PrintFlags *genericclioptions.PrintFlags Printer printers.ResourcePrinter // Name of the resulting secret Name string // SecretTypeName is the type to use when creating the secret. It is checked against known types. SecretTypeName string // Files/Directories to read from. // Directory sources are listed and any direct file children included (but subfolders are not traversed) Sources []string SecretsInterface corev1client.SecretInterface // Controls whether to output warnings Quiet bool AllowUnknownTypes bool genericclioptions.IOStreams }
func NewCreateSecretOptions ¶
func NewCreateSecretOptions(streams genericclioptions.IOStreams) *CreateSecretOptions
func (*CreateSecretOptions) BundleSecret ¶
func (o *CreateSecretOptions) BundleSecret() (*corev1.Secret, error)
func (*CreateSecretOptions) Complete ¶
func (o *CreateSecretOptions) Complete(args []string, f kcmdutil.Factory) error
func (*CreateSecretOptions) Run ¶
func (o *CreateSecretOptions) Run() error
func (*CreateSecretOptions) Validate ¶
func (o *CreateSecretOptions) Validate() error
type KnownSecretType ¶
type KnownSecretType struct { Type coreapiv1.SecretType RequiredContents sets.String }
type LinkSecretOptions ¶
type LinkSecretOptions struct { SecretOptions ForMount bool ForPull bool // contains filtered or unexported fields }
func NewLinkSecretOptions ¶
func NewLinkSecretOptions(streams genericclioptions.IOStreams) *LinkSecretOptions
func (*LinkSecretOptions) Complete ¶
func (o *LinkSecretOptions) Complete(f kcmdutil.Factory, args []string) error
func (LinkSecretOptions) LinkSecrets ¶
func (o LinkSecretOptions) LinkSecrets() error
func (LinkSecretOptions) Validate ¶
func (o LinkSecretOptions) Validate() error
type SecretOptions ¶
type SecretOptions struct { TargetName string SecretNames []string Namespace string BuilderFunc func() *resource.Builder KubeClient corev1client.CoreV1Interface // contains filtered or unexported fields }
SecretOptions Structure holding state for processing secret linking and unlinking.
func (*SecretOptions) Complete ¶
func (o *SecretOptions) Complete(f kcmdutil.Factory, args []string) error
Complete Parses the command line arguments and populates SecretOptions
func (SecretOptions) GetMountSecretNames ¶
func (o SecretOptions) GetMountSecretNames(serviceaccount *corev1.ServiceAccount) sets.String
GetMountSecretNames Get a list of the names of the mount secrets associated with a service account
func (SecretOptions) GetPullSecretNames ¶
func (o SecretOptions) GetPullSecretNames(serviceaccount *corev1.ServiceAccount) sets.String
GetPullSecretNames Get a list of the names of the pull secrets associated with a service account.
func (SecretOptions) GetSecretNames ¶
func (o SecretOptions) GetSecretNames(secrets []*corev1.Secret) sets.String
GetSecretNames Get a list of the names of the secrets in a set of them
func (SecretOptions) GetSecrets ¶
GetSecrets Return a list of secret objects in the default namespace If allowNonExisting is set to true, we will return the non-existing secrets as well.
func (SecretOptions) GetServiceAccount ¶
func (o SecretOptions) GetServiceAccount() (*corev1.ServiceAccount, error)
GetServiceAccount Retrieve the service account object specified by the command
func (SecretOptions) Validate ¶
func (o SecretOptions) Validate() error
Validate Ensures that all arguments have appropriate values
type UnlinkSecretOptions ¶
type UnlinkSecretOptions struct { SecretOptions PrintFlags *genericclioptions.PrintFlags Printer printers.ResourcePrinter genericclioptions.IOStreams }
func NewUnlinkSecretOptions ¶
func NewUnlinkSecretOptions(streams genericclioptions.IOStreams) *UnlinkSecretOptions
func (*UnlinkSecretOptions) Complete ¶
func (o *UnlinkSecretOptions) Complete(f kcmdutil.Factory, args []string) error
func (UnlinkSecretOptions) Run ¶
func (o UnlinkSecretOptions) Run() error