airshipctl/cmd/secret/secret.go
uday.ruddarraju 8fccf09753 Adding encrypt and decrypt subcommands to secret command
Design document: https://docs.google.com/document/d/1EjiCuXoiy8DEEXe15KxVJ4iWrwogCyG113_0LdzcWzQ/edit?usp=drive_web&ouid=102644738301620637153

This is the third of multiple patchsets to support
encryption and decryption in airshipctl

Complete feature: https://review.opendev.org/#/c/742695/

Change-Id: Ibe1060a83d11233cccaa3d3989765968a4dbed76
2020-10-06 08:37:56 -07:00

40 lines
1.3 KiB
Go

/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package secret
import (
"github.com/spf13/cobra"
"opendev.org/airship/airshipctl/cmd/secret/decrypt"
"opendev.org/airship/airshipctl/cmd/secret/encrypt"
"opendev.org/airship/airshipctl/cmd/secret/generate"
"opendev.org/airship/airshipctl/pkg/config"
)
// NewSecretCommand creates a new command for managing airshipctl secrets
func NewSecretCommand(cfgFactory config.Factory) *cobra.Command {
secretRootCmd := &cobra.Command{
Use: "secret",
// TODO(howell): Make this more expressive
Short: "Manage secrets",
}
secretRootCmd.AddCommand(generate.NewGenerateCommand())
secretRootCmd.AddCommand(encrypt.NewEncryptCommand(cfgFactory))
secretRootCmd.AddCommand(decrypt.NewDecryptCommand(cfgFactory))
return secretRootCmd
}