generate

package
v0.0.0-...-b4c1b16 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TokenType      string = "token"
	ClientCertType string = "cert"

	ClusterScope   string = "cluster"
	NamespaceScope string = "namespace"
)

Variables

This section is empty.

Functions

func GetClusterName

func GetClusterName(kubeConfig string) (string, error)

func KubeConfig

func KubeConfig(input Params)

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(client kubernetes.Interface) *Client

func (*Client) ApprovalK8sCSR

func (kt *Client) ApprovalK8sCSR(name string) error

func (*Client) ClientSet

func (c *Client) ClientSet() kubernetes.Interface

func (*Client) GenerateBinding

func (kt *Client) GenerateBinding(roleBindingType, saNameSpace, username string, clusterRoles []string, namespaces []string) error

func (*Client) GetClusterRoleNames

func (kt *Client) GetClusterRoleNames() []string

func (*Client) GetServiceAccountNames

func (kt *Client) GetServiceAccountNames(nameSpace string) []string

func (*Client) ReCreateK8sCSR

func (kt *Client) ReCreateK8sCSR(cn, csrStr string) error

func (*Client) WaitForK8sCsrReady

func (kt *Client) WaitForK8sCsrReady(name string) (csr *certv1beta1.CertificateSigningRequest, err error)

type Generator

type Generator interface {
	ParseParams(p *Params)
	PreGenerate(p *Params)
	PostGenerate(p *Params)
	Generate(p *Params)
}

type Params

type Params struct {
	Type                    string
	ClusterEndpoint         string
	ClusterName             string
	ClusterCA               string
	ClientCert              string
	ClientKey               string
	Token                   string
	SaveAs                  string
	Username                string
	Scope                   string
	Namespaces              string
	ClusterRoles            []string
	ExistedSA               bool
	ServiceAccountNamespace string
}

func (Params) NamespaceSlice

func (p Params) NamespaceSlice() (res []string)

func (Params) SaveAsFile

func (p Params) SaveAsFile() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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