render

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: Apache-2.0 Imports: 11 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

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 {
	ServiceName  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 FakeCertProvider added in v1.6.0

type FakeCertProvider struct {
	InjectCABundleFn    func(obj client.Object, cfg CertificateProvisionerConfig) error
	AdditionalObjectsFn func(cfg CertificateProvisionerConfig) ([]unstructured.Unstructured, error)
	GetCertSecretInfoFn func(cfg CertificateProvisionerConfig) CertSecretInfo
}

func (FakeCertProvider) AdditionalObjects added in v1.6.0

func (FakeCertProvider) GetCertSecretInfo added in v1.6.0

func (FakeCertProvider) InjectCABundle added in v1.6.0

type Option

type Option func(*Options)

func WithCertificateProvider

func WithCertificateProvider(provider CertificateProvider) Option

func WithTargetNamespaces

func WithTargetNamespaces(namespaces ...string) Option

WithTargetNamespaces sets the target namespaces to be used when rendering the bundle The value will only be used if len(namespaces) > 0. Otherwise, the default value for the bundle derived from its install mode support will be used (if such a value can be defined).

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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