secrets

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2018 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
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"
)
View Source
const CreateBasicAuthSecretRecommendedCommandName = "new-basicauth"

CreateBasicAuthSecretRecommendedCommandName represents name of subcommand for `oc secrets` command

View Source
const CreateDockerConfigSecretRecommendedName = "new-dockercfg"
View Source
const CreateSSHAuthSecretRecommendedCommandName = "new-sshauth"

CreateSSHAuthSecretRecommendedCommandName represents name of subcommand for `oc secrets` command

View Source
const LinkSecretRecommendedName = "link"

LinkSecretRecommendedName `oc secrets link`

View Source
const NewSecretRecommendedCommandName = "new"
View Source
const SecretsRecommendedName = "secrets"
View Source
const UnlinkSecretRecommendedName = "unlink"

Variables

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 NewCmdCreateSecret(name, fullName string, f kcmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command

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 NewCmdSecrets(name, fullName string, f kcmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command

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 {
	SecretName      string
	Username        string
	Password        string
	CertificatePath string
	GitConfigPath   string

	PromptForPassword bool

	Reader io.Reader
	Out    io.Writer

	SecretsInterface kcoreclient.SecretInterface
}

CreateBasicAuthSecretOptions holds the credential needed to authenticate against SCM servers.

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) CreateBasicAuthSecret

func (o *CreateBasicAuthSecretOptions) CreateBasicAuthSecret() error

CreateBasicAuthSecret saves created Secret structure and prints the secret name to the output on success.

func (CreateBasicAuthSecretOptions) GetOut

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

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

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 kcoreclient.SecretInterface

	Out io.Writer
}

func (*CreateDockerConfigOptions) Complete

func (o *CreateDockerConfigOptions) Complete(f kcmdutil.Factory, args []string) error

func (CreateDockerConfigOptions) CreateDockerSecret

func (o CreateDockerConfigOptions) CreateDockerSecret() error

func (CreateDockerConfigOptions) GetOut

func (o CreateDockerConfigOptions) GetOut() io.Writer

func (CreateDockerConfigOptions) NewDockerSecret

func (o CreateDockerConfigOptions) NewDockerSecret() (*api.Secret, error)

func (CreateDockerConfigOptions) Validate

func (o CreateDockerConfigOptions) Validate() error

type CreateSSHAuthSecretOptions

type CreateSSHAuthSecretOptions struct {
	SecretName      string
	PrivateKeyPath  string
	CertificatePath string
	GitConfigPath   string

	PromptForPassword bool

	Out io.Writer

	SecretsInterface kcoreclient.SecretInterface
}

CreateSSHAuthSecretOptions holds the credential needed to authenticate against SCM servers.

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) CreateSSHAuthSecret

func (o *CreateSSHAuthSecretOptions) CreateSSHAuthSecret() error

CreateSSHAuthSecret saves created Secret structure and prints the secret name to the output on success.

func (CreateSSHAuthSecretOptions) GetOut

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

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

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 kcoreclient.SecretInterface

	// 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 kcmdutil.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
}

func (KnownSecretType) Matches

func (ks KnownSecretType) Matches(secretContent map[string][]byte) bool

type LinkSecretOptions

type LinkSecretOptions struct {
	SecretOptions

	ForMount bool
	ForPull  bool
	// contains filtered or unexported fields
}

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
	KubeCoreClient kcoreclient.CoreInterface

	Out io.Writer
	// 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 *kapi.ServiceAccount) sets.String

GetMountSecretNames Get a list of the names of the mount secrets associated with a service account

func (SecretOptions) GetOut

func (o SecretOptions) GetOut() io.Writer

GetOut Retrieve the output writer

func (SecretOptions) GetPullSecretNames

func (o SecretOptions) GetPullSecretNames(serviceaccount *kapi.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 []*kapi.Secret) sets.String

GetSecretNames Get a list of the names of the secrets in a set of them

func (SecretOptions) GetSecrets

func (o SecretOptions) GetSecrets(allowNonExisting bool) ([]*kapi.Secret, bool, error)

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() (*kapi.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
}

func (UnlinkSecretOptions) UnlinkSecrets

func (o UnlinkSecretOptions) UnlinkSecrets() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL