Skip to content

Commit

Permalink
Set recommended kubernetes labels on services and workflows
Browse files Browse the repository at this point in the history
Motivation:
There's a need to select efficiently workflows and their respective
services. Having the common kubernetes labels allow a single selector:

   podSelector:
     matchExpressions:
       - { key: app.kubernetes.io/component, operator: In, values:
         ["data-index-service", "jobs-service", "serverless-workflow"] }

Modification:
Make the v1.Deployment for services and the deployment or knative
services to contain at common labels

Result:
A workflow deployment or knative serving labels:
    app.kubernetes.io/name: ${workflow name}
    app.kubernetes.io/component: serverless-workflow
    app.kubernetes.io/part-of: ${platform url set by status}
    app.kubernetes.io/managed-by: sonataflow-operator

Data index or Jobs services Deployment.v1 labels:

    app.kubernetes.io/name: ${service name}
    app.kubernetes.io/component: data-index-service|jobs-service
    app.kubernetes.io/part-of: ${platform name}
    app.kubernetes.io/managed-by: sonataflow-operator

Reference: https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/#labels

Signed-off-by: Roy Golan <[email protected]>
  • Loading branch information
rgolangh committed Jun 7, 2024
1 parent 706ecb7 commit 2f87409
Show file tree
Hide file tree
Showing 21 changed files with 95 additions and 76 deletions.
2 changes: 1 addition & 1 deletion api/v1alpha08/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions api/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion container-builder/api/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions controllers/builder/openshiftbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ func (o *openshiftBuilderManager) Schedule(build *operatorapi.SonataFlowBuild) e
if err = o.addExternalResources(bc, workflow); err != nil {
return err
}
workflowproj.SetMergedLabels(workflow, is)
workflowproj.SetMergedLabels(workflow, bc)
workflowproj.SetMergedLabels(workflow, is, o.platform.Name)
workflowproj.SetMergedLabels(workflow, bc, o.platform.Name)
if err = controllerutil.SetControllerReference(build, bc, o.buildManagerContext.client.Scheme()); err != nil {
return err
}
Expand Down
8 changes: 6 additions & 2 deletions controllers/platform/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,12 @@ func createOrUpdateService(ctx context.Context, client client.Client, platform *

func getLabels(platform *operatorapi.SonataFlowPlatform, psh services.PlatformServiceHandler) (map[string]string, map[string]string) {
lbl := map[string]string{
workflowproj.LabelApp: platform.Name,
workflowproj.LabelService: psh.GetServiceName(),
workflowproj.LabelApp: platform.Name,
workflowproj.LabelService: psh.GetServiceName(),
"app.kubernetes.io/name": psh.GetServiceName(),
"app.kubernetes.io/component": psh.GetContainerName(),
"app.kubernetes.io/part-of": platform.Name,
"app.kubernetes.io/managed-by": "sonataflow-operator",
}
selectorLbl := map[string]string{
workflowproj.LabelService: psh.GetServiceName(),
Expand Down
20 changes: 10 additions & 10 deletions controllers/profiles/common/ensurer.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var _ ObjectEnsurer = &noopObjectEnsurer{}
var _ ObjectsEnsurer = &defaultObjectsEnsurer{}

type ObjectEnsurer interface {
Ensure(ctx context.Context, workflow *operatorapi.SonataFlow, visitors ...MutateVisitor) (client.Object, controllerutil.OperationResult, error)
Ensure(ctx context.Context, workflow *operatorapi.SonataFlow, pl *operatorapi.SonataFlowPlatform, visitors ...MutateVisitor) (client.Object, controllerutil.OperationResult, error)
}
type ObjectEnsurerWithPlatform interface {
Ensure(ctx context.Context, workflow *operatorapi.SonataFlow, pl *operatorapi.SonataFlowPlatform, visitors ...MutateVisitor) (client.Object, controllerutil.OperationResult, error)
Expand All @@ -53,7 +53,7 @@ type ObjectEnsurerWithPlatform interface {
type MutateVisitor func(object client.Object) controllerutil.MutateFn

// NewObjectEnsurer see defaultObjectEnsurer
func NewObjectEnsurer(client client.Client, creator ObjectCreator) ObjectEnsurer {
func NewObjectEnsurer(client client.Client, creator ObjectCreatorWithPlatform) ObjectEnsurer {
return &defaultObjectEnsurer{
c: client,
creator: creator,
Expand All @@ -71,13 +71,13 @@ func NewObjectEnsurerWithPlatform(client client.Client, creator ObjectCreatorWit
// defaultObjectEnsurer provides the engine for a ReconciliationState that needs to create or update a given Kubernetes object during the reconciliation cycle.
type defaultObjectEnsurer struct {
c client.Client
creator ObjectCreator
creator ObjectCreatorWithPlatform
}

func (d *defaultObjectEnsurer) Ensure(ctx context.Context, workflow *operatorapi.SonataFlow, visitors ...MutateVisitor) (client.Object, controllerutil.OperationResult, error) {
func (d *defaultObjectEnsurer) Ensure(ctx context.Context, workflow *operatorapi.SonataFlow, pl *operatorapi.SonataFlowPlatform, visitors ...MutateVisitor) (client.Object, controllerutil.OperationResult, error) {
result := controllerutil.OperationResultNone

object, err := d.creator(workflow)
object, err := d.creator(workflow, pl)
if err != nil || object == nil {
return nil, result, err
}
Expand Down Expand Up @@ -113,22 +113,22 @@ func (d *defaultObjectEnsurerWithPlatform) Ensure(ctx context.Context, workflow
}

// NewNoopObjectEnsurer see noopObjectEnsurer
func NewNoopObjectEnsurer() ObjectEnsurer {
func NewNoopObjectEnsurer() ObjectEnsurerWithPlatform {
return &noopObjectEnsurer{}
}

// noopObjectEnsurer is a useful Object ensurer to apply the null pattern. Use it when you need a creator that does nothing
type noopObjectEnsurer struct {
}

func (d *noopObjectEnsurer) Ensure(ctx context.Context, workflow *operatorapi.SonataFlow, visitors ...MutateVisitor) (client.Object, controllerutil.OperationResult, error) {
func (d *noopObjectEnsurer) Ensure(ctx context.Context, workflow *operatorapi.SonataFlow, platform *operatorapi.SonataFlowPlatform, visitors ...MutateVisitor) (client.Object, controllerutil.OperationResult, error) {
result := controllerutil.OperationResultNone
return nil, result, nil
}

// ObjectsEnsurer is an ensurer to apply multiple objects
type ObjectsEnsurer interface {
Ensure(ctx context.Context, workflow *operatorapi.SonataFlow, visitors ...MutateVisitor) []ObjectEnsurerResult
Ensure(ctx context.Context, workflow *operatorapi.SonataFlow, platform *operatorapi.SonataFlowPlatform, visitors ...MutateVisitor) []ObjectEnsurerResult
}

type ObjectEnsurerResult struct {
Expand All @@ -150,10 +150,10 @@ type defaultObjectsEnsurer struct {
creator ObjectsCreator
}

func (d *defaultObjectsEnsurer) Ensure(ctx context.Context, workflow *operatorapi.SonataFlow, visitors ...MutateVisitor) []ObjectEnsurerResult {
func (d *defaultObjectsEnsurer) Ensure(ctx context.Context, workflow *operatorapi.SonataFlow, platform *operatorapi.SonataFlowPlatform, visitors ...MutateVisitor) []ObjectEnsurerResult {
result := controllerutil.OperationResultNone

objects, err := d.creator(workflow)
objects, err := d.creator(workflow, platform)
if err != nil {
return []ObjectEnsurerResult{{nil, result, err}}
}
Expand Down
8 changes: 4 additions & 4 deletions controllers/profiles/common/knative_eventing.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ func NewKnativeEventingHandler(support *StateSupport) KnativeEventingHandler {
}

type KnativeEventingHandler interface {
Ensure(ctx context.Context, workflow *operatorapi.SonataFlow) ([]client.Object, error)
Ensure(ctx context.Context, workflow *operatorapi.SonataFlow, platform *operatorapi.SonataFlowPlatform) ([]client.Object, error)
}

func (k knativeObjectManager) Ensure(ctx context.Context, workflow *operatorapi.SonataFlow) ([]client.Object, error) {
func (k knativeObjectManager) Ensure(ctx context.Context, workflow *operatorapi.SonataFlow, platform *operatorapi.SonataFlowPlatform) ([]client.Object, error) {
var objs []client.Object

if workflow.Spec.Flow.Events == nil {
Expand All @@ -57,14 +57,14 @@ func (k knativeObjectManager) Ensure(ctx context.Context, workflow *operatorapi.
klog.V(log.I).InfoS("Knative Eventing is not installed")
} else {
// create sinkBinding and trigger
sinkBinding, _, err := k.sinkBinding.Ensure(ctx, workflow)
sinkBinding, _, err := k.sinkBinding.Ensure(ctx, workflow, platform)
if err != nil {
return objs, err
} else if sinkBinding != nil {
objs = append(objs, sinkBinding)
}

triggers := k.trigger.Ensure(ctx, workflow)
triggers := k.trigger.Ensure(ctx, workflow, platform)
for _, trigger := range triggers {
if trigger.Error != nil {
return objs, trigger.Error
Expand Down
4 changes: 2 additions & 2 deletions controllers/profiles/common/mutate_visitors.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,13 @@ func EnsureKService(original *servingv1.Service, object *servingv1.Service) erro
return mergo.Merge(&object.Spec.Template.Spec.PodSpec, original.Spec.Template.Spec.PodSpec, mergo.WithOverride)
}

func ServiceMutateVisitor(workflow *operatorapi.SonataFlow) MutateVisitor {
func ServiceMutateVisitor(workflow *operatorapi.SonataFlow, platform *operatorapi.SonataFlowPlatform) MutateVisitor {
return func(object client.Object) controllerutil.MutateFn {
return func() error {
if kubeutil.IsObjectNew(object) {
return nil
}
original, err := ServiceCreator(workflow)
original, err := ServiceCreator(workflow, platform)
if err != nil {
return err
}
Expand Down
24 changes: 12 additions & 12 deletions controllers/profiles/common/object_creators.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ type ObjectCreator func(workflow *operatorapi.SonataFlow) (client.Object, error)
type ObjectCreatorWithPlatform func(workflow *operatorapi.SonataFlow, platform *operatorapi.SonataFlowPlatform) (client.Object, error)

// ObjectsCreator creates multiple resources
type ObjectsCreator func(workflow *operatorapi.SonataFlow) ([]client.Object, error)
type ObjectsCreator func(workflow *operatorapi.SonataFlow, platform *operatorapi.SonataFlowPlatform) ([]client.Object, error)

const (
defaultHTTPServicePort = 80
Expand All @@ -75,7 +75,7 @@ const (
// DeploymentCreator is an objectCreator for a base Kubernetes Deployments for profiles that need to deploy the workflow on a vanilla deployment.
// It serves as a basis for a basic Quarkus Java application, expected to listen on http 8080.
func DeploymentCreator(workflow *operatorapi.SonataFlow, plf *operatorapi.SonataFlowPlatform) (client.Object, error) {
lbl := workflowproj.GetMergedLabels(workflow)
lbl := workflowproj.GetMergedLabels(workflow, plf.Name)

deployment := &appsv1.Deployment{
ObjectMeta: metav1.ObjectMeta{
Expand Down Expand Up @@ -111,7 +111,7 @@ func DeploymentCreator(workflow *operatorapi.SonataFlow, plf *operatorapi.Sonata

// KServiceCreator creates the default Knative Service object for SonataFlow instances. It's based on the default DeploymentCreator.
func KServiceCreator(workflow *operatorapi.SonataFlow, plf *operatorapi.SonataFlowPlatform) (client.Object, error) {
lbl := workflowproj.GetMergedLabels(workflow)
lbl := workflowproj.GetMergedLabels(workflow, plf.Name)
ksvc := &servingv1.Service{
ObjectMeta: metav1.ObjectMeta{
Name: workflow.Name,
Expand Down Expand Up @@ -228,8 +228,8 @@ func defaultContainer(workflow *operatorapi.SonataFlow, plf *operatorapi.SonataF

// ServiceCreator is an objectCreator for a basic Service aiming a vanilla Kubernetes Deployment.
// It maps the default HTTP port (80) to the target Java application webserver on port 8080.
func ServiceCreator(workflow *operatorapi.SonataFlow) (client.Object, error) {
lbl := workflowproj.GetMergedLabels(workflow)
func ServiceCreator(workflow *operatorapi.SonataFlow, platform *operatorapi.SonataFlowPlatform) (client.Object, error) {
lbl := workflowproj.GetMergedLabels(workflow, platform.Name)

service := &corev1.Service{
ObjectMeta: metav1.ObjectMeta{
Expand All @@ -252,8 +252,8 @@ func ServiceCreator(workflow *operatorapi.SonataFlow) (client.Object, error) {

// SinkBindingCreator is an ObjectsCreator for SinkBinding.
// It will create v1.SinkBinding based on events defined in workflow.
func SinkBindingCreator(workflow *operatorapi.SonataFlow) (client.Object, error) {
lbl := workflowproj.GetMergedLabels(workflow)
func SinkBindingCreator(workflow *operatorapi.SonataFlow, platform *operatorapi.SonataFlowPlatform) (client.Object, error) {
lbl := workflowproj.GetMergedLabels(workflow, platform.Name)

// skip if no produced event is found
if workflow.Spec.Sink == nil || !workflowdef.ContainsEventKind(workflow, cncfmodel.EventKindProduced) {
Expand Down Expand Up @@ -288,9 +288,9 @@ func SinkBindingCreator(workflow *operatorapi.SonataFlow) (client.Object, error)

// TriggersCreator is an ObjectsCreator for Triggers.
// It will create a list of eventingv1.Trigger based on events defined in workflow.
func TriggersCreator(workflow *operatorapi.SonataFlow) ([]client.Object, error) {
func TriggersCreator(workflow *operatorapi.SonataFlow, platform *operatorapi.SonataFlowPlatform) ([]client.Object, error) {
var resultObjects []client.Object
lbl := workflowproj.GetMergedLabels(workflow)
lbl := workflowproj.GetMergedLabels(workflow, platform.Name)

//consumed
events := workflow.Spec.Flow.Events
Expand Down Expand Up @@ -332,14 +332,14 @@ func TriggersCreator(workflow *operatorapi.SonataFlow) ([]client.Object, error)
// OpenShiftRouteCreator is an ObjectCreator for a basic Route for a workflow running on OpenShift.
// It enables the exposition of the service using an OpenShift Route.
// See: https://github.com/openshift/api/blob/d170fcdc0fa638b664e4f35f2daf753cb4afe36b/route/v1/route.crd.yaml
func OpenShiftRouteCreator(workflow *operatorapi.SonataFlow) (client.Object, error) {
func OpenShiftRouteCreator(workflow *operatorapi.SonataFlow, _ *operatorapi.SonataFlowPlatform) (client.Object, error) {
route, err := openshift.RouteForWorkflow(workflow)
return route, err
}

// UserPropsConfigMapCreator creates an empty ConfigMap to hold the user application properties
func UserPropsConfigMapCreator(workflow *operatorapi.SonataFlow) (client.Object, error) {
return workflowproj.CreateNewUserPropsConfigMap(workflow), nil
func UserPropsConfigMapCreator(workflow *operatorapi.SonataFlow, platform *operatorapi.SonataFlowPlatform) (client.Object, error) {
return workflowproj.CreateNewUserPropsConfigMap(workflow, platform), nil
}

// ManagedPropsConfigMapCreator creates an empty ConfigMap to hold the external application properties
Expand Down
4 changes: 3 additions & 1 deletion controllers/profiles/common/object_creators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ import (
"github.com/apache/incubator-kie-kogito-serverless-operator/workflowproj"
)

const platformName = "test-platform"

func Test_ensureWorkflowPropertiesConfigMapMutator(t *testing.T) {
workflow := test.GetBaseSonataFlowWithDevProfile(t.Name())
platform := test.GetBasePlatform()
Expand Down Expand Up @@ -181,7 +183,7 @@ func Test_ensureWorkflowSinkBindingIsCreated(t *testing.T) {
workflow := test.GetVetEventSonataFlow(t.Name())

//On Kubernetes we want the service exposed in Dev with NodePort
sinkBinding, _ := SinkBindingCreator(workflow)
sinkBinding, _ := SinkBindingCreator(workflow, platformName)
sinkBinding.SetUID("1")
sinkBinding.SetResourceVersion("1")

Expand Down
10 changes: 5 additions & 5 deletions controllers/profiles/dev/object_creators_dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ import (
// aiming a vanilla Kubernetes Deployment.
// It maps the default HTTP port (80) to the target Java application webserver on port 8080.
// It configures the Service as a NodePort type service, in this way it will be easier for a developer access the service
func serviceCreator(workflow *operatorapi.SonataFlow) (client.Object, error) {
object, _ := common.ServiceCreator(workflow)
func serviceCreator(workflow *operatorapi.SonataFlow, platform *operatorapi.SonataFlowPlatform) (client.Object, error) {
object, _ := common.ServiceCreator(workflow, platform)
service := object.(*corev1.Service)
// Let's double-check that the workflow is using the Dev Profile we would like to expose it via NodePort
if profiles.IsDevProfile(workflow) {
Expand Down Expand Up @@ -71,7 +71,7 @@ func deploymentCreator(workflow *operatorapi.SonataFlow, plf *operatorapi.Sonata
}

// workflowDefConfigMapCreator creates a new ConfigMap that holds the definition of a workflow specification.
func workflowDefConfigMapCreator(workflow *operatorapi.SonataFlow) (client.Object, error) {
func workflowDefConfigMapCreator(workflow *operatorapi.SonataFlow, _ *operatorapi.SonataFlowPlatform) (client.Object, error) {
configMap, err := workflowdef.CreateNewConfigMap(workflow)
if err != nil {
return nil, err
Expand All @@ -95,13 +95,13 @@ func deploymentMutateVisitor(workflow *operatorapi.SonataFlow, plf *operatorapi.
}
}

func ensureWorkflowDefConfigMapMutator(workflow *operatorapi.SonataFlow) common.MutateVisitor {
func ensureWorkflowDefConfigMapMutator(workflow *operatorapi.SonataFlow, platform *operatorapi.SonataFlowPlatform) common.MutateVisitor {
return func(object client.Object) controllerutil.MutateFn {
return func() error {
if kubeutil.IsObjectNew(object) {
return nil
}
original, err := workflowDefConfigMapCreator(workflow)
original, err := workflowDefConfigMapCreator(workflow, platform)
if err != nil {
return err
}
Expand Down
21 changes: 11 additions & 10 deletions controllers/profiles/dev/states_dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,23 @@ func (e *ensureRunningWorkflowState) CanReconcile(workflow *operatorapi.SonataFl
func (e *ensureRunningWorkflowState) Do(ctx context.Context, workflow *operatorapi.SonataFlow) (ctrl.Result, []client.Object, error) {
var objs []client.Object

flowDefCM, _, err := e.ensurers.definitionConfigMap.Ensure(ctx, workflow, ensureWorkflowDefConfigMapMutator(workflow))
// check if the Platform available
pl, err := platform.GetActivePlatform(context.TODO(), e.C, workflow.Namespace)
if err != nil {
return ctrl.Result{Requeue: false}, objs, err
}
objs = append(objs, flowDefCM)

devBaseContainerImage := workflowdef.GetDefaultWorkflowDevModeImageTag()
// check if the Platform available
pl, err := platform.GetActivePlatform(context.TODO(), e.C, workflow.Namespace)
flowDefCM, _, err := e.ensurers.definitionConfigMap.Ensure(ctx, workflow, pl, ensureWorkflowDefConfigMapMutator(workflow, pl))
if err != nil {
return ctrl.Result{Requeue: false}, objs, err
}
objs = append(objs, flowDefCM)

devBaseContainerImage := workflowdef.GetDefaultWorkflowDevModeImageTag()

if pl != nil && len(pl.Spec.DevMode.BaseImage) > 0 {
devBaseContainerImage = pl.Spec.DevMode.BaseImage
}
userPropsCM, _, err := e.ensurers.userPropsConfigMap.Ensure(ctx, workflow)
userPropsCM, _, err := e.ensurers.userPropsConfigMap.Ensure(ctx, workflow, pl)
if err != nil {
return ctrl.Result{Requeue: false}, objs, err
}
Expand Down Expand Up @@ -105,19 +106,19 @@ func (e *ensureRunningWorkflowState) Do(ctx context.Context, workflow *operatora
}
objs = append(objs, deployment)

service, _, err := e.ensurers.service.Ensure(ctx, workflow, common.ServiceMutateVisitor(workflow))
service, _, err := e.ensurers.service.Ensure(ctx, workflow, pl, common.ServiceMutateVisitor(workflow, pl))
if err != nil {
return ctrl.Result{RequeueAfter: constants.RequeueAfterFailure}, objs, err
}
objs = append(objs, service)

route, _, err := e.ensurers.network.Ensure(ctx, workflow)
route, _, err := e.ensurers.network.Ensure(ctx, workflow, pl)
if err != nil {
return ctrl.Result{RequeueAfter: constants.RequeueAfterFailure}, objs, err
}
objs = append(objs, route)

if knativeObjs, err := common.NewKnativeEventingHandler(e.StateSupport).Ensure(ctx, workflow); err != nil {
if knativeObjs, err := common.NewKnativeEventingHandler(e.StateSupport).Ensure(ctx, workflow, pl); err != nil {
return ctrl.Result{RequeueAfter: constants.RequeueAfterFailure}, objs, err
} else {
objs = append(objs, knativeObjs...)
Expand Down
2 changes: 1 addition & 1 deletion controllers/profiles/dev/status_enricher_dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func statusEnricher(ctx context.Context, c client.Client, workflow *operatorapi.
//If the service has got a Port that is a nodePort we have to use it to create the workflow's NodePort Endpoint
if service.Spec.Ports != nil && len(service.Spec.Ports) > 0 {
if port := findNodePortFromPorts(service.Spec.Ports); port > 0 {
labels := workflowproj.GetDefaultLabels(workflow)
labels := workflowproj.GetDefaultLabels(workflow, "")

podList := &v1.PodList{}
opts := []client.ListOption{
Expand Down
6 changes: 3 additions & 3 deletions controllers/profiles/preview/deployment_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (d *DeploymentReconciler) ensureKnativeServingRequired(workflow *operatorap

func (d *DeploymentReconciler) ensureObjects(ctx context.Context, workflow *operatorapi.SonataFlow, image string) (reconcile.Result, []client.Object, error) {
pl, _ := platform.GetActivePlatform(ctx, d.C, workflow.Namespace)
userPropsCM, _, err := d.ensurers.userPropsConfigMap.Ensure(ctx, workflow)
userPropsCM, _, err := d.ensurers.userPropsConfigMap.Ensure(ctx, workflow, pl)
if err != nil {
workflow.Status.Manager().MarkFalse(api.RunningConditionType, api.ExternalResourcesNotFoundReason, "Unable to retrieve the user properties config map")
_, _ = d.PerformStatusUpdate(ctx, workflow)
Expand All @@ -114,14 +114,14 @@ func (d *DeploymentReconciler) ensureObjects(ctx context.Context, workflow *oper
return reconcile.Result{}, nil, err
}

service, _, err := d.ensurers.ServiceByDeploymentModel(workflow).Ensure(ctx, workflow, common.ServiceMutateVisitor(workflow))
service, _, err := d.ensurers.ServiceByDeploymentModel(workflow).Ensure(ctx, workflow, pl, common.ServiceMutateVisitor(workflow, pl))
if err != nil {
workflow.Status.Manager().MarkFalse(api.RunningConditionType, api.DeploymentUnavailableReason, "Unable to make the service available due to ", err)
_, _ = d.PerformStatusUpdate(ctx, workflow)
return reconcile.Result{}, nil, err
}

eventingObjs, err := common.NewKnativeEventingHandler(d.StateSupport).Ensure(ctx, workflow)
eventingObjs, err := common.NewKnativeEventingHandler(d.StateSupport).Ensure(ctx, workflow, pl)
if err != nil {
return reconcile.Result{}, nil, err
}
Expand Down
Loading

0 comments on commit 2f87409

Please sign in to comment.