cert-manager/cmd/ctl/pkg/create/create.go
joshvanl 02666fde10 Adds create CertificateSingingRequest form Certificate command
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-06-15 15:17:35 +01:00

44 lines
1.3 KiB
Go

/*
Copyright 2020 The cert-manager Authors.
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
http://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 create
import (
"context"
"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericclioptions"
cmdutil "k8s.io/kubectl/pkg/cmd/util"
"github.com/jetstack/cert-manager/cmd/ctl/pkg/create/certificaterequest"
)
func NewCmdCreate(ctx context.Context, ioStreams genericclioptions.IOStreams, factory cmdutil.Factory) *cobra.Command {
cmds := NewCmdCreateBare()
cmds.AddCommand(certificaterequest.NewCmdCreateCR(ctx, ioStreams, factory))
return cmds
}
// Create a bare Create Command, without any subcommands
func NewCmdCreateBare() *cobra.Command {
return &cobra.Command{
Use: "create",
Short: "Create cert-manager resources",
Long: `Create cert-manager resources e.g. a CertificateRequest`,
}
}