controller

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 54 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResourceCAPTenant = iota
	ResourceCAPApplicationVersion
	ResourceCAPApplication
	ResourceCAPTenantOperation
	ResourceJob
	ResourceSecret
	ResourceGateway
	ResourceCertificate
	ResourceDNSEntry
	ResourceOperatorDomains
	ResourceVirtualService
	ResourceDestinationRule
)
View Source
const (
	CAPApplicationEventMissingSecrets               = "MissingSecrets"
	CAPApplicationEventPrimaryGatewayModified       = "PrimaryGatewayModified"
	CAPApplicationEventMissingIngressGatewayInfo    = "MissingIngressGatewayInfo"
	CAPApplicationEventProviderTenantCreated        = "ProviderTenantCreated"
	CAPApplicationEventNewCAVTriggeredTenantUpgrade = "NewCAVTriggeredTenantUpgrade"
)
View Source
const (
	EventActionProcessingSecrets         = "ProcessingSecrets"
	EventActionProcessingDomainResources = "ProcessingDomainResources"
	EventActionProviderTenantProcessing  = "ProviderTenantProcessing"
	EventActionCheckForVersion           = "CheckForVersion"
)
View Source
const (
	CategoryWorkload = "Workload"
	CategoryService  = "Service"
)
View Source
const (
	CAPTenantEventProcessingStarted                 = "ProcessingStarted"
	CAPTenantEventProvisioningFailed                = "ProvisioningFailed"
	CAPTenantEventProvisioningCompleted             = "ProvisioningCompleted"
	CAPTenantEventProvisioningOperationCreated      = "ProvisioningOperationCreated"
	CAPTenantEventDeprovisioningFailed              = "DeprovisioningFailed"
	CAPTenantEventDeprovisioningCompleted           = "DeprovisioningCompleted"
	CAPTenantEventDeprovisioningOperationCreated    = "DeprovisioningOperationCreated"
	CAPTenantEventUpgradeFailed                     = "UpgradeFailed"
	CAPTenantEventUpgradeCompleted                  = "UpgradeCompleted"
	CAPTenantEventUpgradeOperationCreated           = "UpgradeOperationCreated"
	CAPTenantEventTenantNetworkingModified          = "TenantNetworkingModified"
	CAPTenantEventVirtualServiceModificationFailed  = "VirtualServiceModificationFailed"
	CAPTenantEventDestinationRuleModificationFailed = "DestinationRuleModificationFailed"
	CAPTenantEventInvalidReference                  = "InvalidReference"
	CAPTenantEventAutoVersionUpdate                 = "AutoVersionUpdate"
)
View Source
const (
	EventActionReconcileTenantNetworking = "ReconcileTenantNetworking"
	EventActionPrepare                   = "Prepare"
	EventActionUpgrade                   = "Upgrade"
)
View Source
const (
	EnvMTXJobImage            = "MTX_JOB_IMAGE"
	MTXJobImageAllowedPattern = "^ghcr\\.io/sap/cap-operator"
	MTXJobImageDefault        = "ghcr.io/sap/cap-operator/mtx-job"
	EnvIsMTXSEnabled          = "IS_MTXS_ENABLED"
)
View Source
const (
	CAPTenantOperationConditionReasonStepProcessing      string = "StepProcessing"
	CAPTenantOperationConditionReasonStepCompleted       string = "StepCompleted"
	CAPTenantOperationConditionReasonStepFailed          string = "StepFailed"
	CAPTenantOperationConditionReasonStepInitiated       string = "StepInitiated"
	CAPTenantOperationConditionReasonStepProcessingError string = "StepProcessingError"
)
View Source
const (
	EventActionCreateJob = "CreateJob"
	EventActionTrackJob  = "TrackJob"
)
View Source
const (
	CAPOperator              = "CAPOperator"
	OperatorDomainLabel      = CAPOperator + "." + OperatorDomains
	OperatorDomainNamePrefix = "cap-operator-domains-"
)
View Source
const (
	LabelOwnerIdentifierHash           = "sme.sap.com/owner-identifier-hash"
	LabelOwnerGeneration               = "sme.sap.com/owner-generation"
	LabelWorkloadName                  = "sme.sap.com/workload-name"
	LabelWorkloadType                  = "sme.sap.com/workload-type"
	LabelResourceCategory              = "sme.sap.com/category"
	LabelBTPApplicationIdentifierHash  = "sme.sap.com/btp-app-identifier-hash"
	LabelTenantType                    = "sme.sap.com/tenant-type"
	LabelTenantId                      = "sme.sap.com/btp-tenant-id"
	LabelTenantOperationType           = "sme.sap.com/tenant-operation-type"
	LabelTenantOperationStep           = "sme.sap.com/tenant-operation-step"
	LabelCAVVersion                    = "sme.sap.com/cav-version"
	LabelRelevantDNSTarget             = "sme.sap.com/relevant-dns-target-hash"
	LabelDisableKarydia                = "x4.sap.com/disable-karydia"
	AnnotationOwnerIdentifier          = "sme.sap.com/owner-identifier"
	AnnotationBTPApplicationIdentifier = "sme.sap.com/btp-app-identifier"
	AnnotationResourceHash             = "sme.sap.com/resource-hash"
	AnnotationControllerClass          = "sme.sap.com/controller-class"
	AnnotationIstioSidecarInject       = "sidecar.istio.io/inject"
	AnnotationGardenerDNSTarget        = "dns.gardener.cloud/dnsnames"
	AnnotationKubernetesDNSTarget      = "external-dns.alpha.kubernetes.io/hostname"
	FinalizerCAPApplication            = "sme.sap.com/capapplication"
	FinalizerCAPApplicationVersion     = "sme.sap.com/capapplicationversion"
	FinalizerCAPTenant                 = "sme.sap.com/captenant"
	FinalizerCAPTenantOperation        = "sme.sap.com/captenantoperation"
	GardenerDNSClassIdentifier         = "dns.gardener.cloud/class"
)
View Source
const (
	CertificateSuffix     = "certificate"
	GardenerDNSClassValue = "garden"
	GatewaySuffix         = "gw"
	IstioSystemNamespace  = "istio-system"
	SecretSuffix          = "secret"
)
View Source
const (
	ProviderTenantType = "provider"
	ConsumerTenantType = "consumer"
)
View Source
const (
	EnvCAPOpAppVersion      = "CAPOP_APP_VERSION"
	EnvCAPOpTenantID        = "CAPOP_TENANT_ID"
	EnvCAPOpTenantSubDomain = "CAPOP_TENANT_SUBDOMAIN"
	EnvCAPOpTenantOperation = "CAPOP_TENANT_OPERATION"
	EnvVCAPServices         = "VCAP_SERVICES"
)
View Source
const (
	App = "app"
)
View Source
const (
	CAPTenantOperationEventInvalidReference = "InvalidReference"
)
View Source
const (
	OperatorDomains = "OperatorDomains"
)
View Source
const PrimaryDnsSuffix = "primary-dns"
View Source
const RouterHttpCookieName = "CAPOP_ROUTER_STICKY"

Use a different name for sticky cookie than the one from approuter (JSESSIONID) used for session handling

View Source
const (
	ServiceSuffix = "-svc"
)

Variables

View Source
var TenantOperationStatusMap = map[v1alpha1.CAPTenantOperationType]StatusInfo{
	v1alpha1.CAPTenantOperationTypeProvisioning: {
		// contains filtered or unexported fields
	},
	v1alpha1.CAPTenantOperationTypeUpgrade: {
		// contains filtered or unexported fields
	},
	v1alpha1.CAPTenantOperationTypeDeprovisioning: {
		// contains filtered or unexported fields
	},
}

maps tenant operation types (and their status) to CAPTenant status changes

Functions

This section is empty.

Types

type CAPTenantStateHandlerFunc

type CAPTenantStateHandlerFunc func(ctx context.Context, c *Controller, cat *v1alpha1.CAPTenant, target StateCondition, ctop *v1alpha1.CAPTenantOperation) (*ReconcileResult, error)

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func NewController

func NewController(client kubernetes.Interface, crdClient versioned.Interface, istioClient istio.Interface, gardenerCertificateClient gardenerCert.Interface, certManagerCertificateClient certManager.Interface, gardenerDNSClient gardenerDNS.Interface) *Controller

func (*Controller) Event

func (c *Controller) Event(main runtime.Object, related runtime.Object, eventType, reason, action, message string)

func (*Controller) Start

func (c *Controller) Start(ctx context.Context)

type DeploymentParameters

type DeploymentParameters struct {
	CA              *v1alpha1.CAPApplication
	CAV             *v1alpha1.CAPApplicationVersion
	OwnerRef        *metav1.OwnerReference
	WorkloadDetails v1alpha1.WorkloadDetails
	VCAPSecretName  string
}

type IdentifiedCAPTenantOperations

type IdentifiedCAPTenantOperations struct {
	// contains filtered or unexported fields
}

type JobState

type JobState string
const (
	JobStateComplete   JobState = "Complete"
	JobStateFailed     JobState = "Failed"
	JobStateProcessing JobState = "Processing"
)

type NamespacedResourceKey

type NamespacedResourceKey struct {
	Namespace string
	Name      string
}

type OperatorGatewayMissingError

type OperatorGatewayMissingError struct{}

func (*OperatorGatewayMissingError) Error

func (err *OperatorGatewayMissingError) Error() string

type ProvisioningPayload

type ProvisioningPayload struct {
	SubscribedSubdomain string `json:"subscribedSubdomain"`
	EventType           string `json:"eventType"`
}

type QueueItem

type QueueItem struct {
	Key         int
	ResourceKey NamespacedResourceKey
}

type ReconcileResult

type ReconcileResult struct {
	// contains filtered or unexported fields
}

func NewReconcileResult

func NewReconcileResult() *ReconcileResult

func NewReconcileResultWithResource

func NewReconcileResultWithResource(rid int, resourceName string, resourceNamespace string, requeueAfter time.Duration) *ReconcileResult

func (*ReconcileResult) AddResource

func (r *ReconcileResult) AddResource(rid int, resourceName string, resourceNamespace string, after time.Duration)

type RequeueItem

type RequeueItem struct {
	// contains filtered or unexported fields
}

type RouterDestination

type RouterDestination struct {
	Name                 string `json:"name"`
	URL                  string `json:"url"`
	ProxyHost            string `json:"proxyHost,omitempty"`
	ProxyPort            string `json:"proxyPort,omitempty"`
	ForwardAuthToken     bool   `json:"forwardAuthToken,omitempty"`
	StrictSSL            bool   `json:"strictSSL,omitempty"`
	Timeout              *int64 `json:"timeout,omitempty"`
	SetXForwardedHeaders bool   `json:"setXForwardedHeaders,omitempty"`
	ProxyType            string `json:"proxyType,omitempty"`
}

See https://www.npmjs.com/package/@sap/approuter#destinations

type StateCondition

type StateCondition struct {
	// contains filtered or unexported fields
}

type StatusInfo

type StatusInfo struct {
	// contains filtered or unexported fields
}

type TargetStateHandler

type TargetStateHandler struct {
	// contains filtered or unexported fields
}

type UpgradePayload

type UpgradePayload struct {
	Tenants      []string `json:"tenants"`
	AutoUnDeploy bool     `json:"autoUndeploy"`
}

Jump to

Keyboard shortcuts

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