re_create

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:     "re-create",
	Aliases: []string{"r"},
	Short:   "Re-create a secret from a Secret that was previously created with kube-create-secret.",
	Long: "Re-create a secret from a Secret that was previously created with kube-create-secret.\n\n" +
		fmt.Sprintf("Flags can be set via environment variables that are prefixed with %s_ prefix. For example --kubeseal-controller-namespace can be set via %s_KUBESEAL_CONTROLLER_NAMESPACE\n", constants.FLAGENV_PREFIX, constants.FLAGENV_PREFIX),
	Example: "  kube-create-secret re-create -f secret.yml\n" +
		"  kube-create-secret re-create -f secret.json\n" +
		"  kube-create-secret re-create -f secret1.yml -f secret2.yml\n" +
		"  cat secret.yml | kube-create-secret re-create -f -\n" +
		"  kube-create-secret re-create -f secret.yml -o json\n" +
		"  kube-create-secret re-create -f secret.yml -o json -o sealed-secret\n",
	RunE: func(cmd *cobra.Command, args []string) error {
		if len(config.InputFiles) == 0 {
			return fmt.Errorf("reguired flag \"filename\" not set")
		}

		core.InputReaders = []core.InputReader{
			read.NewStdInReader(),
			read.NewFileReader(),
		}
		core.Unmarshallers = []core.Unmarshaller{
			unmarshal.NewReCreateJsonUnmarshaller(),
			unmarshal.NewReCreateYamlUnmarshaller(),
			unmarshal.NewReCreateJsonSealedSecretUnmarshaller(),
			unmarshal.NewReCreateYamlSealedSecretUnmarshaller(),
		}
		core.Marshallers = []core.Marshaller{
			marshal.NewYamlMarshaller(),
			marshal.NewJsonMarshaller(),
			marshal.NewSealedSecretMarshaller(),
		}
		core.OutputWriters = []core.OutputWriter{
			write.NewStdOutWriter(),
		}

		config.InputReader = os.Stdin
		kubesealConfig.ConfigOverrides = configOverrides
		config.Extra[marshal.SEALED_SECRET_EXTRA_CONFIG_KEY] = kubesealConfig

		return core.Create(config)
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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