{"modulePath":"github.phpd.cn/openshift/origin","version":"v3.6.1+incompatible","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package secrets\n\n## Constants\n\n```go\nconst (\n\t// SourceUsername is the key of the optional username for basic authentication subcommand\n\tSourceUsername = scmauth.UsernameSecret\n\t// SourcePassword is the key of the optional password or token for basic authentication subcommand\n\tSourcePassword = scmauth.PasswordSecret\n\t// SourceCertificate is the key of the optional certificate authority for basic authentication subcommand\n\tSourceCertificate = scmauth.CACertName\n\t// SourcePrivateKey is the key of the required SSH private key for SSH authentication subcommand\n\tSourcePrivateKey = scmauth.SSHPrivateKeyMethodName\n\t// SourceGitconfig is the key of the optional gitconfig content for both basic and SSH authentication subcommands\n\tSourceGitConfig = scmauth.GitConfigName\n)\n```\n\n```go\nconst CreateBasicAuthSecretRecommendedCommandName = \"new-basicauth\"\n```\nCreateBasicAuthSecretRecommendedCommandName represents name of subcommand for \\`oc secrets\\` command\n\n```go\nconst CreateDockerConfigSecretRecommendedName = \"new-dockercfg\"\n```\n\n```go\nconst CreateSSHAuthSecretRecommendedCommandName = \"new-sshauth\"\n```\nCreateSSHAuthSecretRecommendedCommandName represents name of subcommand for \\`oc secrets\\` command\n\n```go\nconst LinkSecretRecommendedName = \"link\"\n```\nLinkSecretRecommendedName \\`oc secrets link\\`\n\n```go\nconst NewSecretRecommendedCommandName = \"new\"\n```\n\n```go\nconst SecretsRecommendedName = \"secrets\"\n```\n\n```go\nconst UnlinkSecretRecommendedName = \"unlink\"\n```\n\n## Variables\n\n```go\nvar (\n\tKnownSecretTypes = []KnownSecretType{\n\t\t{kapi.SecretTypeDockercfg, sets.NewString(kapi.DockerConfigKey)},\n\t\t{kapi.SecretTypeDockerConfigJson, sets.NewString(kapi.DockerConfigJsonKey)},\n\t}\n)\n```\n\n## Functions\n\n```go\nfunc NewCmdCreateBasicAuthSecret(name, fullName string, f kcmdutil.Factory, reader io.Reader, out io.Writer, newSecretFullName, ocEditFullName string) *cobra.Command\n```\nNewCmdCreateBasicAuthSecret implements the OpenShift cli secrets new-basicauth subcommand\n\n```go\nfunc NewCmdCreateDockerConfigSecret(name, fullName string, f kcmdutil.Factory, out io.Writer, newSecretFullName, ocEditFullName string) *cobra.Command\n```\nNewCmdCreateDockerConfigSecret creates a command object for making a dockercfg secret\n\n```go\nfunc NewCmdCreateSSHAuthSecret(name, fullName string, f kcmdutil.Factory, out io.Writer, newSecretFullName, ocEditFullName string) *cobra.Command\n```\nNewCmdCreateSSHAuthSecret implements the OpenShift cli secrets new-sshauth subcommand\n\n```go\nfunc NewCmdCreateSecret(name, fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command\n```\n\n```go\nfunc NewCmdLinkSecret(name, fullName string, f kcmdutil.Factory, out io.Writer) *cobra.Command\n```\nNewCmdLinkSecret creates a command object for linking a secret reference to a service account\n\n```go\nfunc NewCmdSecrets(name, fullName string, f *clientcmd.Factory, reader io.Reader, out, errOut io.Writer, ocEditFullName string) *cobra.Command\n```\n\n```go\nfunc NewCmdUnlinkSecret(name, fullName string, f kcmdutil.Factory, out io.Writer) *cobra.Command\n```\nNewCmdUnlinkSecret creates a command object for detaching one or more secret references from a service account\n\n## Types\n\n```go\ntype CreateBasicAuthSecretOptions struct {\n\tSecretName      string\n\tUsername        string\n\tPassword        string\n\tCertificatePath string\n\tGitConfigPath   string\n\n\tPromptForPassword bool\n\n\tReader io.Reader\n\tOut    io.Writer\n\n\tSecretsInterface kcoreclient.SecretInterface\n}\n```\nCreateBasicAuthSecretOptions holds the credential needed to authenticate against SCM servers.\n\n```go\nfunc (o *CreateBasicAuthSecretOptions) Complete(f kcmdutil.Factory, args []string) error\n```\nComplete fills CreateBasicAuthSecretOptions fields with data and checks for mutual exclusivity between flags from different option groups.\n\n```go\nfunc (o *CreateBasicAuthSecretOptions) CreateBasicAuthSecret() error\n```\nCreateBasicAuthSecret saves created Secret structure and prints the secret name to the output on success.\n\n```go\nfunc (o CreateBasicAuthSecretOptions) GetOut() io.Writer\n```\nGetOut 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.\n\n```go\nfunc (o *CreateBasicAuthSecretOptions) NewBasicAuthSecret() (*api.Secret, error)\n```\nNewBasicAuthSecret builds up the Secret structure containing secret name, type and data structure containing desired credentials.\n\n```go\nfunc (o CreateBasicAuthSecretOptions) Validate() error\n```\nValidate check if all necessary fields from CreateBasicAuthSecretOptions are present.\n\n```go\ntype CreateDockerConfigOptions struct {\n\tSecretName       string\n\tRegistryLocation string\n\tUsername         string\n\tPassword         string\n\tEmailAddress     string\n\n\tSecretsInterface kcoreclient.SecretInterface\n\n\tOut io.Writer\n}\n```\n\n```go\nfunc (o *CreateDockerConfigOptions) Complete(f kcmdutil.Factory, args []string) error\n```\n\n```go\nfunc (o CreateDockerConfigOptions) CreateDockerSecret() error\n```\n\n```go\nfunc (o CreateDockerConfigOptions) GetOut() io.Writer\n```\n\n```go\nfunc (o CreateDockerConfigOptions) NewDockerSecret() (*api.Secret, error)\n```\n\n```go\nfunc (o CreateDockerConfigOptions) Validate() error\n```\n\n```go\ntype CreateSSHAuthSecretOptions struct {\n\tSecretName      string\n\tPrivateKeyPath  string\n\tCertificatePath string\n\tGitConfigPath   string\n\n\tPromptForPassword bool\n\n\tOut io.Writer\n\n\tSecretsInterface kcoreclient.SecretInterface\n}\n```\nCreateSSHAuthSecretOptions holds the credential needed to authenticate against SCM servers.\n\n```go\nfunc (o *CreateSSHAuthSecretOptions) Complete(f kcmdutil.Factory, args []string) error\n```\nComplete fills CreateSSHAuthSecretOptions fields with data and checks whether necessary arguments were provided.\n\n```go\nfunc (o *CreateSSHAuthSecretOptions) CreateSSHAuthSecret() error\n```\nCreateSSHAuthSecret saves created Secret structure and prints the secret name to the output on success.\n\n```go\nfunc (o CreateSSHAuthSecretOptions) GetOut() io.Writer\n```\nGetOut 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.\n\n```go\nfunc (o *CreateSSHAuthSecretOptions) NewSSHAuthSecret() (*api.Secret, error)\n```\nNewSSHAuthSecret builds up the Secret structure containing secret name, type and data structure containing desired credentials.\n\n```go\nfunc (o CreateSSHAuthSecretOptions) Validate() error\n```\nValidate check if all necessary fields from CreateSSHAuthSecretOptions are present.\n\n```go\ntype CreateSecretOptions struct {\n\t// Name of the resulting secret\n\tName string\n\n\t// SecretTypeName is the type to use when creating the secret.  It is checked against known types.\n\tSecretTypeName string\n\n\t// Files/Directories to read from.\n\t// Directory sources are listed and any direct file children included (but subfolders are not traversed)\n\tSources []string\n\n\tSecretsInterface kcoreclient.SecretInterface\n\n\t// Writer to write warnings to\n\tStderr io.Writer\n\n\tOut io.Writer\n\n\t// Controls whether to output warnings\n\tQuiet bool\n\n\tAllowUnknownTypes bool\n}\n```\n\n```go\nfunc NewCreateSecretOptions() *CreateSecretOptions\n```\n\n```go\nfunc (o *CreateSecretOptions) BundleSecret() (*kapi.Secret, error)\n```\n\n```go\nfunc (o *CreateSecretOptions) Complete(args []string, f *clientcmd.Factory) error\n```\n\n```go\nfunc (o *CreateSecretOptions) CreateSecret() (*kapi.Secret, error)\n```\n\n```go\nfunc (o *CreateSecretOptions) Validate() error\n```\n\n```go\ntype KnownSecretType struct {\n\tType             kapi.SecretType\n\tRequiredContents sets.String\n}\n```\n\n```go\nfunc (ks KnownSecretType) Matches(secretContent map[string][]byte) bool\n```\n\n```go\ntype LinkSecretOptions struct {\n\tSecretOptions\n\n\tForMount bool\n\tForPull  bool\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (o *LinkSecretOptions) Complete(f kcmdutil.Factory, args []string) error\n```\n\n```go\nfunc (o LinkSecretOptions) LinkSecrets() error\n```\n\n```go\nfunc (o LinkSecretOptions) Validate() error\n```\n\n```go\ntype SecretOptions struct {\n\tTargetName  string\n\tSecretNames []string\n\n\tNamespace string\n\n\tMapper         meta.RESTMapper\n\tTyper          runtime.ObjectTyper\n\tClientMapper   resource.ClientMapper\n\tKubeCoreClient kcoreclient.CoreInterface\n\n\tOut io.Writer\n\t// contains filtered or unexported fields\n}\n```\nSecretOptions Structure holding state for processing secret linking and unlinking.\n\n```go\nfunc (o *SecretOptions) Complete(f kcmdutil.Factory, args []string) error\n```\nComplete Parses the command line arguments and populates SecretOptions\n\n```go\nfunc (o SecretOptions) GetMountSecretNames(serviceaccount *kapi.ServiceAccount) sets.String\n```\nGetMountSecretNames Get a list of the names of the mount secrets associated with a service account\n\n```go\nfunc (o SecretOptions) GetOut() io.Writer\n```\nGetOut Retrieve the output writer\n\n```go\nfunc (o SecretOptions) GetPullSecretNames(serviceaccount *kapi.ServiceAccount) sets.String\n```\nGetPullSecretNames Get a list of the names of the pull secrets associated with a service account.\n\n```go\nfunc (o SecretOptions) GetSecretNames(secrets []*kapi.Secret) sets.String\n```\nGetSecretNames Get a list of the names of the secrets in a set of them\n\n```go\nfunc (o SecretOptions) GetSecrets(allowNonExisting bool) ([]*kapi.Secret, bool, error)\n```\nGetSecrets 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.\n\n```go\nfunc (o SecretOptions) GetServiceAccount() (*kapi.ServiceAccount, error)\n```\nGetServiceAccount Retrieve the service account object specified by the command\n\n```go\nfunc (o SecretOptions) Validate() error\n```\nValidate Ensures that all arguments have appropriate values\n\n```go\ntype UnlinkSecretOptions struct {\n\tSecretOptions\n}\n```\n\n```go\nfunc (o UnlinkSecretOptions) UnlinkSecrets() error\n```\n\n","path":"github.phpd.cn/openshift/origin/pkg/cmd/cli/secrets","name":"secrets","synopsis":"","isRedistributable":true}
