eventing

package
v0.0.0-...-11b31ba Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FinalizerName             = "eventing.operator.kyma-project.io/finalizer"
	ControllerName            = "eventing-manager-controller"
	NatsServerNotAvailableMsg = "NATS server is not available"

	PublisherSecretEMSHostKey = "ems-publish-host" //nolint:gosec // no hardcoded secret, just the key where to find it

	TokenEndpointFormat                   = "%s?grant_type=%s&response_type=token" //nolint:gosec // no hardcoded secret, just the format for specifying it in the URL
	NamespacePrefix                       = "/"
	EventMeshPublishEndpointForSubscriber = "/sap/ems/v1"
	EventMeshPublishEndpointForPublisher  = "/sap/ems/v1/events"

	SubscriptionExistsErrMessage = "cannot delete the eventing module as subscription exists"
)
View Source
const (
	EMSecretMessagingMissing      = "messaging is missing from EM secret"
	EMSecretNamespaceMissing      = "namespace is missing from EM secret"
	EventMeshSecretMissingMessage = "The specified EventMesh secret is not found. Please provide an existing secret."
	EventMeshSecretMalformatted   = "The EventMesh secret data is not formatted properly." //nolint:gosec // just an error message
)
View Source
const RequeueTimeForStatusCheck = 10

Variables

View Source
var (
	ErrSubscriptionExists      = errors.New(SubscriptionExistsErrMessage)
	ErrUnsupportedBackedType   = errors.New("backend type not supported")
	ErrNatsModuleMissing       = errors.New("NATS module has to be installed")
	ErrAPIGatewayModuleMissing = errors.New("API-Gateway module is needed for EventMesh backend. APIRules CRD is not installed")
)
View Source
var (
	ErrEMSecretMessagingMissing    = errors.New(EMSecretMessagingMissing)
	ErrEMSecretNamespaceMissing    = errors.New(EMSecretNamespaceMissing)
	ErrEventMeshSecretMissing      = errors.New(EventMeshSecretMissingMessage)
	ErrEventMeshSecretMalformatted = errors.New(EventMeshSecretMalformatted)
)
View Source
var ErrCannotBuildNATSURL = errors.New("NATS CR is not found to build NATS server URL")
View Source
var ErrDomainConfigMissing = errors.New("domain configuration missing")
View Source
var IsDeploymentReady = func(deployment *kappsv1.Deployment) bool {
	return deployment.Status.AvailableReplicas == *deployment.Spec.Replicas &&
		deployment.Status.ReadyReplicas == *deployment.Spec.Replicas &&
		deployment.Status.UpdatedReplicas == *deployment.Spec.Replicas
}

IsDeploymentReady is a variable to able to mock this function in tests.

Functions

func IsMalformattedSecretErr

func IsMalformattedSecretErr(err error) bool

IsMalformattedSecretErr checks if the error is of type ErrEventMeshSecretMalformatted.

Types

type Broker

type Broker struct {
	BrokerType string `json:"type,omitempty"`
}

type Message

type Message struct {
	Broker Broker           `json:"broker,omitempty"`
	OA2    OAuthCredentials `json:"oa2,omitempty"`
	URI    string           `json:"uri,omitempty"`
}

type NatsConfigHandler

type NatsConfigHandler interface {
	GetNatsConfig(ctx context.Context, eventing v1alpha1.Eventing) (*env.NATSConfig, error)
}

func NewNatsConfigHandler

func NewNatsConfigHandler(
	kubeClient k8s.Client,
	opts *options.Options,
) NatsConfigHandler

type NatsConfigHandlerImpl

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

func (*NatsConfigHandlerImpl) GetNatsConfig

func (n *NatsConfigHandlerImpl) GetNatsConfig(ctx context.Context, eventing v1alpha1.Eventing) (*env.NATSConfig, error)

type OAuthCredentials

type OAuthCredentials struct {
	ClientID      string `json:"clientid,omitempty"`
	ClientSecret  string `json:"clientsecret,omitempty"`
	GrantType     string `json:"granttype,omitempty"`
	TokenEndpoint string `json:"tokenendpoint,omitempty"`
}

type Reconciler

type Reconciler struct {
	client.Client
	// contains filtered or unexported fields
}

Reconciler reconciles an Eventing object

func NewReconciler

func NewReconciler(
	client client.Client,
	kubeClient k8s.Client,
	dynamicClient dynamic.Interface,
	scheme *runtime.Scheme,
	logger *logger.Logger,
	recorder record.EventRecorder,
	manager eventing.Manager,
	backendConfig env.BackendConfig,
	subManagerFactory subscriptionmanager.ManagerFactory,
	opts *options.Options,
	allowedEventingCR *operatorv1alpha1.Eventing,
	natsConnectionBuilder natsconnection.Builder,
) *Reconciler

func (*Reconciler) GetEventMeshSubManager

func (r *Reconciler) GetEventMeshSubManager() manager.Manager

func (*Reconciler) InitStateProcessing

func (r *Reconciler) InitStateProcessing(eventing *operatorv1alpha1.Eventing)

InitStateProcessing initializes the state of the EventingStatus if it is not set.

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, req kctrl.Request) (kctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*Reconciler) SetEventMeshSubManager

func (r *Reconciler) SetEventMeshSubManager(eventMeshSubManager manager.Manager)

func (*Reconciler) SetKubeClient

func (r *Reconciler) SetKubeClient(kubeClient k8s.Client)

func (*Reconciler) SetupWithManager

func (r *Reconciler) SetupWithManager(mgr kctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

func (*Reconciler) SkipEnqueueOnCreate

func (r *Reconciler) SkipEnqueueOnCreate() func(event.CreateEvent) bool

func (*Reconciler) SkipEnqueueOnUpdateAfterSemanticCompare

func (r *Reconciler) SkipEnqueueOnUpdateAfterSemanticCompare(resourceType, nameFilter string) func(event.UpdateEvent) bool

func (*Reconciler) SyncPublisherProxySecret

func (r *Reconciler) SyncPublisherProxySecret(ctx context.Context, eventingNS string, secret *kcorev1.Secret) (*kcorev1.Secret, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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