render

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultUniqueNameGenerator

func DefaultUniqueNameGenerator(base string, o interface{}) (string, error)

Types

type BundleRenderer

type BundleRenderer struct {
	BundleValidator    BundleValidator
	ResourceGenerators []ResourceGenerator
}

func (BundleRenderer) Render

func (r BundleRenderer) Render(rv1 bundle.RegistryV1, installNamespace string, opts ...Option) ([]client.Object, error)

type BundleValidator

type BundleValidator []func(v1 *bundle.RegistryV1) []error

BundleValidator validates a RegistryV1 bundle by executing a series of checks on it and collecting any errors that were found

func (BundleValidator) Validate

func (v BundleValidator) Validate(rv1 *bundle.RegistryV1) error

type CertSecretInfo

type CertSecretInfo struct {
	SecretName     string
	CertificateKey string
	PrivateKeyKey  string
}

CertSecretInfo contains describes the certificate secret resource information such as name and certificate and private key keys

type CertificateProvider

type CertificateProvider interface {
	InjectCABundle(obj client.Object, cfg CertificateProvisionerConfig) error
	AdditionalObjects(cfg CertificateProvisionerConfig) ([]unstructured.Unstructured, error)
	GetCertSecretInfo(cfg CertificateProvisionerConfig) CertSecretInfo
}

CertificateProvider encapsulate the creation and modification of object for certificate provisioning in Kubernetes by vendors such as CertManager or the OpenshiftServiceCA operator

type CertificateProvisioner

type CertificateProvisioner CertificateProvisionerConfig

CertificateProvisioner uses a CertificateProvider to modify and generate objects based on its CertificateProvisionerConfig

func CertProvisionerFor

func CertProvisionerFor(deploymentName string, opts Options) CertificateProvisioner

func (CertificateProvisioner) AdditionalObjects

func (c CertificateProvisioner) AdditionalObjects() ([]unstructured.Unstructured, error)

func (CertificateProvisioner) GetCertSecretInfo

func (c CertificateProvisioner) GetCertSecretInfo() *CertSecretInfo

func (CertificateProvisioner) InjectCABundle

func (c CertificateProvisioner) InjectCABundle(obj client.Object) error

type CertificateProvisionerConfig

type CertificateProvisionerConfig struct {
	WebhookServiceName string
	CertName           string
	Namespace          string
	CertProvider       CertificateProvider
}

CertificateProvisionerConfig contains the necessary information for a CertificateProvider to correctly generate and modify object for certificate injection and automation

type Option

type Option func(*Options)

func WithCertificateProvider

func WithCertificateProvider(provider CertificateProvider) Option

func WithTargetNamespaces

func WithTargetNamespaces(namespaces ...string) Option

func WithUniqueNameGenerator

func WithUniqueNameGenerator(generator UniqueNameGenerator) Option

type Options

type Options struct {
	InstallNamespace    string
	TargetNamespaces    []string
	UniqueNameGenerator UniqueNameGenerator
	CertificateProvider CertificateProvider
}

type ResourceGenerator

type ResourceGenerator func(rv1 *bundle.RegistryV1, opts Options) ([]client.Object, error)

ResourceGenerator generates resources given a registry+v1 bundle and options

func (ResourceGenerator) GenerateResources

func (g ResourceGenerator) GenerateResources(rv1 *bundle.RegistryV1, opts Options) ([]client.Object, error)

type ResourceGenerators

type ResourceGenerators []ResourceGenerator

ResourceGenerators aggregates generators. Its GenerateResource method will call all of its generators and return generated resources.

func (ResourceGenerators) GenerateResources

func (r ResourceGenerators) GenerateResources(rv1 *bundle.RegistryV1, opts Options) ([]client.Object, error)

func (ResourceGenerators) ResourceGenerator

func (r ResourceGenerators) ResourceGenerator() ResourceGenerator

type UniqueNameGenerator

type UniqueNameGenerator func(string, interface{}) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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