Documentation
¶
Index ¶
- Constants
- func BuildNamespaceObject(name string, labels, annotations map[string]string) *corev1.Namespace
- func DefaultUniqueNameGenerator(base string, o interface{}) string
- type BundleRenderer
- type BundleValidator
- type CertSecretInfo
- type CertificateProvider
- type CertificateProvisioner
- type CertificateProvisionerConfig
- type Option
- func WithCertificateProvider(provider CertificateProvider) Option
- func WithDeploymentConfig(deploymentConfig *config.DeploymentConfig) Option
- func WithSelfManagedInstallNamespace(ns string) Option
- func WithTargetNamespaces(namespaces ...string) Option
- func WithUniqueNameGenerator(generator UniqueNameGenerator) Option
- type Options
- type ResourceGenerator
- type ResourceGenerators
- type UniqueNameGenerator
Constants ¶
const ( // AnnotationSuggestedNamespaceTemplate is a CSV annotation carrying a JSON // Namespace template whose metadata seeds the system-managed namespace. AnnotationSuggestedNamespaceTemplate = "operatorframework.io/suggested-namespace-template" // AnnotationSuggestedNamespace is a CSV annotation carrying the preferred // namespace name for the operator. AnnotationSuggestedNamespace = "operatorframework.io/suggested-namespace" )
Variables ¶
This section is empty.
Functions ¶
func BuildNamespaceObject ¶ added in v1.12.0
BuildNamespaceObject returns the Namespace object to include in the rendered set, seeding the given labels and annotations.
Types ¶
type BundleRenderer ¶
type BundleRenderer struct {
BundleValidator BundleValidator
ResourceGenerators []ResourceGenerator
}
func (BundleRenderer) Render ¶
func (r BundleRenderer) Render(rv1 bundle.RegistryV1, 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 ¶
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 Option ¶
type Option func(*Options)
func WithCertificateProvider ¶
func WithCertificateProvider(provider CertificateProvider) Option
func WithDeploymentConfig ¶ added in v1.8.0
func WithDeploymentConfig(deploymentConfig *config.DeploymentConfig) Option
WithDeploymentConfig sets the deployment configuration to apply to CSV deployments. If deploymentConfig is nil, no customizations are applied.
func WithSelfManagedInstallNamespace ¶ added in v1.12.0
WithSelfManagedInstallNamespace renders namespace-scoped resources into ns and treats it as a caller-managed namespace: it is assumed to already exist and no Namespace object is emitted. Without this option the renderer defaults to the bundle's system-managed namespace (resolved from CSV annotations, else "<packageName>-system") and emits a Namespace object for it.
func WithTargetNamespaces ¶
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
// DeploymentConfig contains optional customizations to apply to CSV deployments.
// If nil, no customizations are applied.
DeploymentConfig *config.DeploymentConfig
// SelfManagedInstallNamespace, when true, means the caller supplies InstallNamespace and
// manages that namespace itself: it is assumed to already exist and no Namespace object is
// rendered. When false (the default), the renderer resolves the bundle's system-managed
// namespace and emits a Namespace object for it (see WithSelfManagedInstallNamespace).
SelfManagedInstallNamespace bool
// InstallNamespaceLabels and InstallNamespaceAnnotations seed metadata (e.g. PSA) on the
// emitted Namespace object. They are defaulted from the bundle's suggested-namespace-template
// annotation during Render setup and only consulted when SelfManagedInstallNamespace is false.
InstallNamespaceLabels map[string]string
InstallNamespaceAnnotations map[string]string
}
type ResourceGenerator ¶
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