Documentation ¶
Index ¶
- Constants
- Variables
- func NewCmdAddSecret(name, fullName string, f *cmdutil.Factory, out io.Writer) *cobra.Command
- func NewCmdCreateBasicAuthSecret(name, fullName string, f *kcmdutil.Factory, reader io.Reader, out io.Writer, ...) *cobra.Command
- func NewCmdCreateDockerConfigSecret(name, fullName string, f *cmdutil.Factory, out io.Writer, ...) *cobra.Command
- func NewCmdCreateSSHAuthSecret(name, fullName string, f *kcmdutil.Factory, out io.Writer, ...) *cobra.Command
- func NewCmdCreateSecret(name, fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command
- func NewCmdSecrets(name, fullName string, f *clientcmd.Factory, reader io.Reader, out io.Writer, ...) *cobra.Command
- type AddSecretOptions
- type CreateBasicAuthSecretOptions
- func (o *CreateBasicAuthSecretOptions) Complete(f *kcmdutil.Factory, args []string) error
- func (o *CreateBasicAuthSecretOptions) CreateBasicAuthSecret() error
- func (o CreateBasicAuthSecretOptions) GetOut() io.Writer
- func (o *CreateBasicAuthSecretOptions) NewBasicAuthSecret() (*api.Secret, error)
- func (o CreateBasicAuthSecretOptions) Validate() error
- type CreateDockerConfigOptions
- func (o *CreateDockerConfigOptions) Complete(f *cmdutil.Factory, args []string) error
- func (o CreateDockerConfigOptions) CreateDockerSecret() error
- func (o CreateDockerConfigOptions) GetOut() io.Writer
- func (o CreateDockerConfigOptions) NewDockerSecret() (*api.Secret, error)
- func (o CreateDockerConfigOptions) Validate() error
- type CreateSSHAuthSecretOptions
- func (o *CreateSSHAuthSecretOptions) Complete(f *kcmdutil.Factory, args []string) error
- func (o *CreateSSHAuthSecretOptions) CreateSSHAuthSecret() error
- func (o CreateSSHAuthSecretOptions) GetOut() io.Writer
- func (o *CreateSSHAuthSecretOptions) NewSSHAuthSecret() (*api.Secret, error)
- func (o CreateSSHAuthSecretOptions) Validate() error
- type CreateSecretOptions
- type KnownSecretType
Constants ¶
const ( // SourceUsername is the key of the optional username for basic authentication subcommand SourceUsername = scmauth.UsernameSecret // SourcePassword is the key of the optional password or token for basic authentication subcommand SourcePassword = scmauth.PasswordSecret // SourceCertificate is the key of the optional certificate authority for basic authentication subcommand SourceCertificate = scmauth.CACertName // SourcePrivateKey is the key of the required SSH private key for SSH authentication subcommand SourcePrivateKey = scmauth.SSHPrivateKeyMethodName // SourceGitconfig is the key of the optional gitconfig content for both basic and SSH authentication subcommands SourceGitConfig = scmauth.GitConfigName )
const (
AddSecretRecommendedName = "add"
)
const (
// CreateBasicAuthSecretRecommendedCommandName represents name of subcommand for `oc secrets` command
CreateBasicAuthSecretRecommendedCommandName = "new-basicauth"
)
const (
CreateDockerConfigSecretRecommendedName = "new-dockercfg"
)
const (
// CreateSSHAuthSecretRecommendedCommandName represents name of subcommand for `oc secrets` command
CreateSSHAuthSecretRecommendedCommandName = "new-sshauth"
)
const (
NewSecretRecommendedCommandName = "new"
)
const SecretsRecommendedName = "secrets"
Variables ¶
var ( KnownSecretTypes = []KnownSecretType{ {kapi.SecretTypeDockercfg, sets.NewString(kapi.DockerConfigKey)}, {kapi.SecretTypeDockerConfigJson, sets.NewString(kapi.DockerConfigJsonKey)}, } )
Functions ¶
func NewCmdAddSecret ¶
NewCmdAddSecret creates a command object for adding a secret reference to a service account
func NewCmdCreateBasicAuthSecret ¶ added in v1.0.7
func NewCmdCreateBasicAuthSecret(name, fullName string, f *kcmdutil.Factory, reader io.Reader, out io.Writer, newSecretFullName, ocEditFullName string) *cobra.Command
NewCmdCreateBasicAuthSecret implements the OpenShift cli secrets new-basicauth subcommand
func NewCmdCreateDockerConfigSecret ¶
func NewCmdCreateDockerConfigSecret(name, fullName string, f *cmdutil.Factory, out io.Writer, newSecretFullName, ocEditFullName string) *cobra.Command
NewCmdCreateDockerConfigSecret creates a command object for making a dockercfg secret
func NewCmdCreateSSHAuthSecret ¶ added in v1.0.7
func NewCmdCreateSSHAuthSecret(name, fullName string, f *kcmdutil.Factory, out io.Writer, newSecretFullName, ocEditFullName string) *cobra.Command
NewCmdCreateSSHAuthSecret implements the OpenShift cli secrets new-sshauth subcommand
func NewCmdCreateSecret ¶
Types ¶
type AddSecretOptions ¶
type AddSecretOptions struct { TargetName string SecretNames []string ForMount bool ForPull bool Namespace string Mapper meta.RESTMapper Typer runtime.ObjectTyper ClientMapper resource.ClientMapper ClientInterface client.Interface Out io.Writer }
func (AddSecretOptions) AddSecrets ¶
func (o AddSecretOptions) AddSecrets() error
func (AddSecretOptions) GetOut ¶
func (o AddSecretOptions) GetOut() io.Writer
func (AddSecretOptions) Validate ¶
func (o AddSecretOptions) Validate() error
type CreateBasicAuthSecretOptions ¶ added in v1.0.7
type CreateBasicAuthSecretOptions struct { SecretName string Username string Password string CertificatePath string GitConfigPath string PromptForPassword bool Reader io.Reader Out io.Writer SecretsInterface client.SecretsInterface }
CreateBasicAuthSecretOptions holds the credential needed to authenticate against SCM servers.
func (*CreateBasicAuthSecretOptions) Complete ¶ added in v1.0.7
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) CreateBasicAuthSecret ¶ added in v1.0.7
func (o *CreateBasicAuthSecretOptions) CreateBasicAuthSecret() error
CreateBasicAuthSecret saves created Secret structure and prints the secret name to the output on success.
func (CreateBasicAuthSecretOptions) GetOut ¶ added in v1.0.7
func (o CreateBasicAuthSecretOptions) GetOut() io.Writer
GetOut check if the CreateBasicAuthSecretOptions Out Writer is set. Returns it if the Writer is present, if not returns Writer on which all Write calls succeed without doing anything.
func (*CreateBasicAuthSecretOptions) NewBasicAuthSecret ¶ added in v1.0.7
func (o *CreateBasicAuthSecretOptions) NewBasicAuthSecret() (*api.Secret, error)
NewBasicAuthSecret builds up the Secret structure containing secret name, type and data structure containing desired credentials.
func (CreateBasicAuthSecretOptions) Validate ¶ added in v1.0.7
func (o CreateBasicAuthSecretOptions) Validate() error
Validate check if all necessary fields from CreateBasicAuthSecretOptions are present.
type CreateDockerConfigOptions ¶
type CreateDockerConfigOptions struct { SecretName string RegistryLocation string Username string Password string EmailAddress string SecretsInterface client.SecretsInterface Out io.Writer }
func (*CreateDockerConfigOptions) Complete ¶
func (o *CreateDockerConfigOptions) Complete(f *cmdutil.Factory, args []string) error
func (CreateDockerConfigOptions) CreateDockerSecret ¶
func (o CreateDockerConfigOptions) CreateDockerSecret() error
func (CreateDockerConfigOptions) GetOut ¶
func (o CreateDockerConfigOptions) GetOut() io.Writer
func (CreateDockerConfigOptions) NewDockerSecret ¶ added in v1.0.7
func (o CreateDockerConfigOptions) NewDockerSecret() (*api.Secret, error)
func (CreateDockerConfigOptions) Validate ¶
func (o CreateDockerConfigOptions) Validate() error
type CreateSSHAuthSecretOptions ¶ added in v1.0.7
type CreateSSHAuthSecretOptions struct { SecretName string PrivateKeyPath string CertificatePath string GitConfigPath string PromptForPassword bool Out io.Writer SecretsInterface client.SecretsInterface }
CreateSSHAuthSecretOptions holds the credential needed to authenticate against SCM servers.
func (*CreateSSHAuthSecretOptions) Complete ¶ added in v1.0.7
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) CreateSSHAuthSecret ¶ added in v1.0.7
func (o *CreateSSHAuthSecretOptions) CreateSSHAuthSecret() error
CreateSSHAuthSecret saves created Secret structure and prints the secret name to the output on success.
func (CreateSSHAuthSecretOptions) GetOut ¶ added in v1.0.7
func (o CreateSSHAuthSecretOptions) GetOut() io.Writer
GetOut check if the CreateSSHAuthSecretOptions Out Writer is set. Returns it if the Writer is present, if not returns Writer on which all Write calls succeed without doing anything.
func (*CreateSSHAuthSecretOptions) NewSSHAuthSecret ¶ added in v1.0.7
func (o *CreateSSHAuthSecretOptions) NewSSHAuthSecret() (*api.Secret, error)
NewSSHAuthSecret builds up the Secret structure containing secret name, type and data structure containing desired credentials.
func (CreateSSHAuthSecretOptions) Validate ¶ added in v1.0.7
func (o CreateSSHAuthSecretOptions) Validate() error
Validate check if all necessary fields from CreateSSHAuthSecretOptions are present.
type CreateSecretOptions ¶
type CreateSecretOptions struct { // 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 kclient.SecretsInterface // Writer to write warnings to Stderr io.Writer Out io.Writer // Controls whether to output warnings Quiet bool AllowUnknownTypes bool }
func NewCreateSecretOptions ¶
func NewCreateSecretOptions() *CreateSecretOptions
func (*CreateSecretOptions) BundleSecret ¶
func (o *CreateSecretOptions) BundleSecret() (*kapi.Secret, error)
func (*CreateSecretOptions) Complete ¶
func (o *CreateSecretOptions) Complete(args []string, f *clientcmd.Factory) error
func (*CreateSecretOptions) CreateSecret ¶
func (o *CreateSecretOptions) CreateSecret() (*kapi.Secret, error)
func (*CreateSecretOptions) Validate ¶
func (o *CreateSecretOptions) Validate() error
type KnownSecretType ¶
type KnownSecretType struct { Type kapi.SecretType RequiredContents sets.String }