...

Source file src/k8s.io/kubectl/pkg/cmd/auth/auth.go

Documentation: k8s.io/kubectl/pkg/cmd/auth

     1  /*
     2  Copyright 2014 The Kubernetes Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package auth
    18  
    19  import (
    20  	"github.com/spf13/cobra"
    21  
    22  	"k8s.io/cli-runtime/pkg/genericiooptions"
    23  	cmdutil "k8s.io/kubectl/pkg/cmd/util"
    24  )
    25  
    26  // NewCmdAuth returns an initialized Command instance for 'auth' sub command
    27  func NewCmdAuth(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command {
    28  	// Parent command to which all subcommands are added.
    29  	cmds := &cobra.Command{
    30  		Use:   "auth",
    31  		Short: "Inspect authorization",
    32  		Long:  `Inspect authorization.`,
    33  		Run:   cmdutil.DefaultSubCommandRun(streams.ErrOut),
    34  	}
    35  
    36  	cmds.AddCommand(NewCmdCanI(f, streams))
    37  	cmds.AddCommand(NewCmdReconcile(f, streams))
    38  	cmds.AddCommand(NewCmdWhoAmI(f, streams))
    39  
    40  	return cmds
    41  }
    42  

View as plain text