crd

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// CRDLongName is a string indicating what prefix we will use on the CLI
	CRDLongName = "configuration"

	// CRDName is the internal prefix for our resource that will be prefixed to
	// CRDGroupName
	CRDName = "configurations"

	// CRDVersion indicates what version of the CRD APIs we will be using
	CRDVersion = "v1"

	// PluginName indicates the internal configuration manager name for this plugin
	PluginName = "k8s/crd"

	// CRDForcedRefreshInterval is used to poll for any CRDs in case some were missed
	// in push-notifications
	CRDForcedRefreshInterval = 10 * time.Minute
)

Variables

View Source
var (
	// CRDGroupName is the main interface TLD that we tie our CRD under
	CRDGroupName = "secretless" + os.Getenv("SECRETLESS_CRD_SUFFIX") + ".io"

	// CRDFQDNName is the fully-qualified resource ID
	CRDFQDNName = CRDName + "." + CRDGroupName
)
View Source
var CRDShortNames = []string{
	"sbconfig",
}

CRDShortNames indicates what shorter resource strings we can use on the CLI

Functions

func InjectCRD

func InjectCRD() error

InjectCRD adds our CRD to K8s if it is missing

func NewConfigChannel

func NewConfigChannel(configSpec string) (<-chan config_v2.Config, error)

NewConfigChannel returns a CRD-based ConfigurationManager channel object TODO: Also return the name of configuration provider module

func NewKubernetesConfig

func NewKubernetesConfig() (config *rest.Config, err error)

NewKubernetesConfig tries to guess the current k8s configuration for the CRD plugin to use

func RegisterCRDListener

func RegisterCRDListener(namespace string, configSpec string, resourceEventHandler ResourceEventHandler) error

RegisterCRDListener registers a CRD push-notification handler to the available k8s cluster

Types

type ResourceEventHandler

type ResourceEventHandler interface {
	CRDAdded(*api_v1.Configuration)
	CRDDeleted(*api_v1.Configuration)
	CRDUpdated(*api_v1.Configuration, *api_v1.Configuration)
}

ResourceEventHandler is the interface for handling CRD push notification

Jump to

Keyboard shortcuts

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