bootstrap

package
v0.0.0-...-a3639e1 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: Apache-2.0 Imports: 34 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IdentifyCPFSNs

func IdentifyCPFSNs(r client.Reader, operatorNs string) (string, error)

Types

type Bootstrap

type Bootstrap struct {
	client.Client
	client.Reader
	Config *rest.Config
	record.EventRecorder
	*deploy.Manager
	SaasEnable           bool
	MultiInstancesEnable bool
	CSOperators          []CSOperator
	CSData               apiv3.CSData
}

func NewBootstrap

func NewBootstrap(mgr manager.Manager) (bs *Bootstrap, err error)

NewBootstrap is the way to create a NewBootstrap struct

func (*Bootstrap) CheckCRD

func (b *Bootstrap) CheckCRD(apiGroupVersion string, kind string) (bool, error)

CheckCRD returns true if the given crd is existent

func (*Bootstrap) CheckClusterType

func (b *Bootstrap) CheckClusterType(ns string) (bool, error)

func (*Bootstrap) CheckCsSubscription

func (b *Bootstrap) CheckCsSubscription() error

func (*Bootstrap) CheckDeployStatus

func (b *Bootstrap) CheckDeployStatus(ctx context.Context) (operatorDeployed bool, servicesDeployed bool)

func (*Bootstrap) CheckOperatorCatalog

func (b *Bootstrap) CheckOperatorCatalog(ns string) error

func (*Bootstrap) CheckWarningCondition

func (b *Bootstrap) CheckWarningCondition(instance *apiv3.CommonService) error

CheckWarningCondition

func (*Bootstrap) CleanNamespaceScopeResources

func (b *Bootstrap) CleanNamespaceScopeResources() error

CleanNamespaceScopeResources will delete the v3 NamesapceScopes resources and namespace scope operator NamespaceScope resources include common-service, nss-managedby-odlm, nss-odlm-scope, and odlm-scope-managedby-odlm

func (*Bootstrap) Cleanup

func (b *Bootstrap) Cleanup(operatorNs string, resource *Resource) error

func (*Bootstrap) CleanupWebhookResources

func (b *Bootstrap) CleanupWebhookResources() error

func (*Bootstrap) ConfigCertManagerOperandManagedByOperator

func (b *Bootstrap) ConfigCertManagerOperandManagedByOperator(ctx context.Context) error

func (*Bootstrap) ConfigODLMOperandManagedByOperator

func (b *Bootstrap) ConfigODLMOperandManagedByOperator(ctx context.Context) error

ConfigODLMOperandManagedByOperator gets all OperandRegistry and OperandConfig which are managed by CS operator To confirm that the deployment of CRs are in the correct ServicesNamespace

func (*Bootstrap) CreateCsCR

func (b *Bootstrap) CreateCsCR() error

func (*Bootstrap) CreateCsMaps

func (b *Bootstrap) CreateCsMaps() error

CreateCsMaps will create a new common-service-maps configmap if not exists

func (*Bootstrap) CreateEDBImageMaps

func (b *Bootstrap) CreateEDBImageMaps() error

CreateEDBImageConfig creates a ConfigMap contains EDB image reference

func (*Bootstrap) CreateKeycloakThemesConfigMap

func (b *Bootstrap) CreateKeycloakThemesConfigMap() error

CreateKeycloakThemesConfigMap creates a ConfigMap contains Keycloak themes

func (*Bootstrap) CreateNamespace

func (b *Bootstrap) CreateNamespace(name string) error

func (*Bootstrap) CreateNsScopeConfigmap

func (b *Bootstrap) CreateNsScopeConfigmap() error

CreateNsScopeConfigmap creates nss configmap for operators

func (*Bootstrap) CreateOrUpdateFromYaml

func (b *Bootstrap) CreateOrUpdateFromYaml(yamlContent []byte, alwaysUpdate ...bool) error

func (*Bootstrap) DeleteFromYaml

func (b *Bootstrap) DeleteFromYaml(objectTemplate string, data interface{}) error

DeleteFromYaml takes [objectTemplate, b.CSData] and delete the object according to the objectTemplate

func (*Bootstrap) DeployCertManagerCR

func (b *Bootstrap) DeployCertManagerCR() error

func (*Bootstrap) DeployResource

func (b *Bootstrap) DeployResource(cr, placeholder string) bool

deployResource deploys the given resource CR

func (*Bootstrap) GetObjs

func (b *Bootstrap) GetObjs(objectTemplate string, data interface{}, alwaysUpdate ...bool) ([]*unstructured.Unstructured, error)

func (*Bootstrap) GetOperandConfig

func (b *Bootstrap) GetOperandConfig(ctx context.Context, name, namespace string) (*odlm.OperandConfig, error)

GetOperandConfig returns the OperandConfig instance of "name" from "namespace" namespace

func (*Bootstrap) GetOperandRegistry

func (b *Bootstrap) GetOperandRegistry(ctx context.Context, name, namespace string) (*odlm.OperandRegistry, error)

GetOperandRegistry returns the OperandRegistry instance of "name" from "namespace" namespace

func (*Bootstrap) GetSubscription

func (b *Bootstrap) GetSubscription(ctx context.Context, name, namespace string) (*unstructured.Unstructured, error)

GetSubscription returns the subscription instance of "name" from "namespace" namespace

func (*Bootstrap) InitResources

func (b *Bootstrap) InitResources(instance *apiv3.CommonService, forceUpdateODLMCRs bool) error

InitResources initialize resources at the bootstrap of operator

func (*Bootstrap) InstallOrUpdateOpcon

func (b *Bootstrap) InstallOrUpdateOpcon(forceUpdateODLMCRs bool) error

InstallOrUpdateOpcon will install or update OperandConfig when Opcon CRD is existent

func (*Bootstrap) InstallOrUpdateOperatorConfig

func (b *Bootstrap) InstallOrUpdateOperatorConfig(config string, forceUpdateODLMCRs bool) error

InstallOrUpdateOpcon will install or update OperandConfig when Opcon CRD is existent

func (*Bootstrap) InstallOrUpdateOpreg

func (b *Bootstrap) InstallOrUpdateOpreg(forceUpdateODLMCRs bool, installPlanApproval olmv1alpha1.Approval) error

InstallOrUpdateOpreg will install or update OperandRegistry when Opreg CRD is existent

func (*Bootstrap) IsBYOCert

func (b *Bootstrap) IsBYOCert() (bool, error)

1. try to get cs-ca-certificate-secret 2. try to get cs-ca-certificate if we get secret but not get the cert, it is BYOC

func (*Bootstrap) ListCerts

ListCerts returns the Certificate instance list with "options"

func (*Bootstrap) ListIssuer

func (b *Bootstrap) ListIssuer(ctx context.Context, opts ...client.ListOption) *certmanagerv1.IssuerList

ListIssuer returns the Iusser instance list with "options"

func (*Bootstrap) ListNssCRs

func (b *Bootstrap) ListNssCRs(ctx context.Context, namespace string) (*nssv1.NamespaceScopeList, error)

ListNssCRs returns the NameSpaceScopes instance list with "options"

func (*Bootstrap) ListOperandConfig

func (b *Bootstrap) ListOperandConfig(ctx context.Context, opts ...client.ListOption) *odlm.OperandConfigList

ListOperandConfig returns the OperandConfig instance with "options"

func (*Bootstrap) ListOperandRegistry

func (b *Bootstrap) ListOperandRegistry(ctx context.Context, opts ...client.ListOption) *odlm.OperandRegistryList

ListOperandRegistry returns the OperandRegistry instance with "options"

func (*Bootstrap) ListOperatorConfig

func (b *Bootstrap) ListOperatorConfig(ctx context.Context, opts ...client.ListOption) *odlm.OperatorConfigList

ListOperatorConfig returns the OperatorConfig instance with "options"

func (*Bootstrap) ListSubscriptions

func (b *Bootstrap) ListSubscriptions(ctx context.Context, namespace string, listOptions client.ListOptions) (*unstructured.UnstructuredList, error)

GetSubscription returns the subscription instances from a namespace

func (*Bootstrap) PropagateCPPConfig

func (b *Bootstrap) PropagateCPPConfig(instance *corev1.ConfigMap) error

func (*Bootstrap) PropagateDefaultCR

func (b *Bootstrap) PropagateDefaultCR(instance *apiv3.CommonService) error

func (*Bootstrap) ResourceExists

func (b *Bootstrap) ResourceExists(dc discovery.DiscoveryInterface, apiGroupVersion, kind string) (bool, error)

ResourceExists returns true if the given resource kind exists in the given api groupversion

func (*Bootstrap) UpdateCsOpApproval

func (b *Bootstrap) UpdateCsOpApproval() error

update approval mode for the common service operator use label to find the subscription need this function because common service operator is not in operandRegistry

func (*Bootstrap) UpdateResourceLabel

func (b *Bootstrap) UpdateResourceLabel(instance *apiv3.CommonService) error

func (*Bootstrap) UpdateResourceWithLabel

func (b *Bootstrap) UpdateResourceWithLabel(resources *unstructured.UnstructuredList, labels map[string]string) error

func (*Bootstrap) WaitResourceReady

func (b *Bootstrap) WaitResourceReady(apiGroupVersion string, kind string) error

WaitResourceReady returns true only when the specific resource CRD is created and wait for infinite time

type CSOperator

type CSOperator struct {
	Name       string
	CRD        string
	RBAC       string
	CR         string
	Deployment string
	Kind       string
	APIVersion string
}

type Resource

type Resource struct {
	Name    string
	Version string
	Group   string
	Kind    string
	Scope   string
}

Jump to

Keyboard shortcuts

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