k8s

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package k8s contains kubernetes related functionality for the csp adapter (such as cache storage and results output)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// GetConsumptionTokenSecret retrieves the secret containing consumption token info from k8s
	GetConsumptionTokenSecret() (*corev1.Secret, error)
	// UpdateConsumptionTokenSecret stores data into the secret containing consumption token info
	UpdateConsumptionTokenSecret(data map[string]string) error
	// UpdateCSPConfigOutput stores config to k8s as a configmap with a static/constant name
	UpdateCSPConfigOutput(marshalledData []byte) error
	// UpdateUserNotification creates/updates a RancherUserNotification based on isInCompliance and the provided message
	UpdateUserNotification(isInCompliance bool, message string) error
	// GetRancherHostname finds the hostname for the core rancher install from the settings.
	GetRancherHostname() (string, error)
	// GetRancherVersion finds the version of rancher from the settings
	GetRancherVersion() (string, error)
}

type Clients

type Clients struct {
	ConfigMaps    v1.ConfigMapClient
	Secrets       v1.SecretController
	Notifications mgmtv3.RancherUserNotificationClient
	Settings      mgmtv3.SettingClient
}

func New

func New(ctx context.Context, rest *rest.Config) (*Clients, error)

func (*Clients) GetConsumptionTokenSecret

func (c *Clients) GetConsumptionTokenSecret() (*corev1.Secret, error)

func (*Clients) GetRancherHostname

func (c *Clients) GetRancherHostname() (string, error)

func (*Clients) GetRancherVersion

func (c *Clients) GetRancherVersion() (string, error)

func (*Clients) UpdateCSPConfigOutput

func (c *Clients) UpdateCSPConfigOutput(marshalledData []byte) error

func (*Clients) UpdateConsumptionTokenSecret

func (c *Clients) UpdateConsumptionTokenSecret(data map[string]string) error

func (*Clients) UpdateUserNotification

func (c *Clients) UpdateUserNotification(isInCompliance bool, message string) error

Jump to

Keyboard shortcuts

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