k8s

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigMapInformer

func GetConfigMapInformer(ctx context.Context, nsName string, cmName string) cache.SharedIndexInformer

GetConfigMapInformer returns shared informer for given config map

Types

type Client

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

func NewK8sClient

func NewK8sClient() (*Client, error)

NewK8sClient gets the new k8s go client

func NewK8sClientDoOrDie

func NewK8sClientDoOrDie() *Client

NewK8sClient gets the new k8s go client

func NewK8sManagerClient added in v0.0.4

func NewK8sManagerClient(client client.Client) *Client

NewK8sManagerClient func will be used in future and all others should migrate to this

func (*Client) ClientInterface

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

func (*Client) CreateOrUpdateServiceAccount added in v0.0.4

func (c *Client) CreateOrUpdateServiceAccount(ctx context.Context, saName string, ns string, roleARN string, regionalEndpointDisabled bool) error

CreateServiceAccount adds the service account

func (*Client) GetConfigMap

func (c *Client) GetConfigMap(ctx context.Context, ns string, name string) *v1.ConfigMap

func (*Client) GetNamespace added in v0.0.8

func (c *Client) GetNamespace(ctx context.Context, ns string) (*v1.Namespace, error)

GetNamespace gets the namespace metadata. This will be used to validate if the namespace is annotated for privileged namespace.

func (*Client) GetServiceAccount added in v0.10.0

func (c *Client) GetServiceAccount(ctx context.Context, ns string, name string) *v1.ServiceAccount

GetServiceAccount returns the service account with a given name in a given namespace

func (*Client) IamrolesCount

func (c *Client) IamrolesCount(ctx context.Context, ns string) (int, error)

IamrolesCount function lists the "Iamrole" for a provided namespace

func (*Client) SetUpEventHandler

func (c *Client) SetUpEventHandler(ctx context.Context) record.EventRecorder

SetUpEventHandler sets up event handler with client-go recorder instead of creating events directly

type Iface

type Iface interface {
	IamrolesCount(ctx context.Context, ns string)
	GetConfigMap(ctx context.Context, ns string, name string) *v1.ConfigMap
	SetUpEventHandler(ctx context.Context) record.EventRecorder
	GetNamespace(ctx context.Context, ns string) *v1.Namespace
	CreateOrUpdateServiceAccount(ctx context.Context, saName string, ns string) error
}

Iface defines required functions to be implemented by receivers

Jump to

Keyboard shortcuts

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