func init()

in hack/operatorhub/cmd/root.go [36:122]


func init() {
	viper.SetEnvKeyReplacer(strings.NewReplacer("-", "_"))

	Cmd.PersistentFlags().StringVarP(
		&flags.ConfigPath,
		flags.ConfFlag,
		"c",
		"./config.yaml",
		"Path to configuration file (OHUB_CONF)",
	)

	Cmd.PersistentFlags().StringVarP(
		&flags.APIKey,
		flags.APIKeyFlags,
		"a",
		"",
		"API key to use when communicating with Red Hat certification API. Used in both the bundle, and generate-manifests sub-commands. (OHUB_API_KEY)",
	)

	Cmd.PersistentFlags().StringVarP(
		&flags.ProjectID,
		flags.ProjectIDFlag,
		"p",
		"",
		"Red Hat project id within the Red Hat technology portal (OHUB_PROJECT_ID)",
	)

	Cmd.PersistentFlags().BoolVarP(
		&flags.DryRun,
		flags.DryRunFlag,
		"Y",
		true,
		"Run dry run of all operations. Default: true. To un-set --dry-run=false (OHUB_DRY_RUN)",
	)

	Cmd.PersistentFlags().BoolVar(
		&flags.EnableVault,
		flags.EnableVaultFlag,
		true,
		"Enable vault functionality to try and automatically read from given vault keys (uses VAULT_* environment variables) (OHUB_ENABLE_VAULT)",
	)

	Cmd.PersistentFlags().StringVar(
		&flags.VaultAddress,
		flags.VaultAddressFlag,
		"",
		"Vault address to use when enable-vault is set (VAULT_ADDR)",
	)

	Cmd.PersistentFlags().StringVar(
		&flags.VaultToken,
		flags.VaultTokenFlag,
		"",
		"Vault token to use when enable-vault is set (VAULT_TOKEN)",
	)

	Cmd.PersistentFlags().StringVar(
		&flags.RedhatVaultSecret,
		flags.RedhatVaultSecretFlag,
		"secret/ci/elastic-cloud-on-k8s/operatorhub-release-redhat",
		`When --enable-vault is set, attempts to read the following flags from a given vault secret:
	* container sub-command flags concerning redhat interactions:
		** registry-password
		** project-id
		** api-key
(OHUB_REDHAT_VAULT_SECRET)`,
	)

	Cmd.PersistentFlags().StringVar(
		&flags.GithubVaultSecret,
		flags.GithubVaultSecretFlag,
		"secret/ci/elastic-cloud-on-k8s/operatorhub-release-github",
		`When --enable-vault is set, attempts to read the following flags from a given vault secret:
	* bundle sub-command flags concerning generating operator bundle and creating PRs:
		** github-token
		** github-username
		** github-fullname
		** github-email
(OHUB_GITHUB_VAULT_SECRET)`,
	)

	Cmd.AddCommand(
		bundle.Command(),
		container.Command(),
		manifests.Command(),
	)
}