diff --git a/controllers/profiles/common/mutate_visitors.go b/controllers/profiles/common/mutate_visitors.go index 28833227b..8ccbcab35 100644 --- a/controllers/profiles/common/mutate_visitors.go +++ b/controllers/profiles/common/mutate_visitors.go @@ -105,7 +105,7 @@ func ServiceMutateVisitor(workflow *operatorapi.SonataFlow) MutateVisitor { } } -func UserPropertiesMutateVisitor(ctx context.Context, catalog discovery.ServiceCatalog, +func ManagedPropertiesMutateVisitor(ctx context.Context, catalog discovery.ServiceCatalog, workflow *operatorapi.SonataFlow, platform *operatorapi.SonataFlowPlatform, userProps *corev1.ConfigMap) MutateVisitor { return func(object client.Object) controllerutil.MutateFn { return func() error { diff --git a/controllers/profiles/common/object_creators_test.go b/controllers/profiles/common/object_creators_test.go index 1d2b26c4e..ae252248e 100644 --- a/controllers/profiles/common/object_creators_test.go +++ b/controllers/profiles/common/object_creators_test.go @@ -47,7 +47,7 @@ func Test_ensureWorkflowPropertiesConfigMapMutator(t *testing.T) { userProps, _ := UserPropsConfigMapCreator(workflow) userPropsCM := userProps.(*corev1.ConfigMap) - visitor := UserPropertiesMutateVisitor(context.TODO(), nil, workflow, nil, userPropsCM) + visitor := ManagedPropertiesMutateVisitor(context.TODO(), nil, workflow, nil, userPropsCM) mutateFn := visitor(managedProps) assert.NoError(t, mutateFn()) @@ -82,7 +82,7 @@ func Test_ensureWorkflowPropertiesConfigMapMutator_DollarReplacement(t *testing. userPropsCM := userProps.(*corev1.ConfigMap) userPropsCM.Data[workflowproj.ApplicationPropertiesFileName] = "mp.messaging.outgoing.kogito_outgoing_stream.url=${kubernetes:services.v1/event-listener}" - mutateVisitorFn := UserPropertiesMutateVisitor(context.TODO(), nil, workflow, nil, userPropsCM) + mutateVisitorFn := ManagedPropertiesMutateVisitor(context.TODO(), nil, workflow, nil, userPropsCM) err := mutateVisitorFn(managedPropsCM)() assert.NoError(t, err) diff --git a/controllers/profiles/common/properties/application.go b/controllers/profiles/common/properties/application.go index ce6fb89a5..414891405 100644 --- a/controllers/profiles/common/properties/application.go +++ b/controllers/profiles/common/properties/application.go @@ -133,13 +133,14 @@ func (a *appPropertyHandler) addDefaultMutableProperty(name string, value string } // NewAppPropertyHandler creates a property handler for a given workflow to execute in the provided platform. -// This handler is intended to build the application properties required by the workflow to execute properly, note that -// the produced properties might vary depending on the platfom, for example, if the job service managed by the platform +// This handler is intended to build the managed application properties required by the workflow to execute properly together with +// the user properties defined in the user-managed ConfigMap. +// Note that the produced properties might vary depending on the platfom, for example, if the job service managed by the platform // a particular set of properties will be added, etc. // By default, the following properties are incorporated: // The set of immutable properties provided by the operator. (user can never change) -// The set of defaultMutableProperties that are provided by the operator, and that the user might overwrite if it changes -// the workflow ConfigMap. This set includes for example the required properties to connect with the data index and the +// The set of defaultMutableProperties that are provided by the operator, and that the user cannot overwrite even if it changes +// the user-managed ConfigMap. This set includes for example the required properties to connect with the data index and the // job service when any of these services are managed by the platform. func NewAppPropertyHandler(workflow *operatorapi.SonataFlow, platform *operatorapi.SonataFlowPlatform) (AppPropertyHandler, error) { handler := &appPropertyHandler{ diff --git a/controllers/profiles/dev/states_dev.go b/controllers/profiles/dev/states_dev.go index 9c568814f..f98e03eb2 100644 --- a/controllers/profiles/dev/states_dev.go +++ b/controllers/profiles/dev/states_dev.go @@ -78,7 +78,7 @@ func (e *ensureRunningWorkflowState) Do(ctx context.Context, workflow *operatora if err != nil { return ctrl.Result{Requeue: false}, objs, err } - managedPropsCM, _, err := e.ensurers.managedPropsConfigMap.Ensure(ctx, workflow, pl, common.UserPropertiesMutateVisitor(ctx, e.StateSupport.Catalog, workflow, pl, userPropsCM.(*corev1.ConfigMap))) + managedPropsCM, _, err := e.ensurers.managedPropsConfigMap.Ensure(ctx, workflow, pl, common.ManagedPropertiesMutateVisitor(ctx, e.StateSupport.Catalog, workflow, pl, userPropsCM.(*corev1.ConfigMap))) if err != nil { return ctrl.Result{Requeue: false}, objs, err } diff --git a/controllers/profiles/prod/deployment_handler.go b/controllers/profiles/prod/deployment_handler.go index e075543f0..3b693429d 100644 --- a/controllers/profiles/prod/deployment_handler.go +++ b/controllers/profiles/prod/deployment_handler.go @@ -56,7 +56,7 @@ func (d *deploymentReconciler) reconcileWithBuiltImage(ctx context.Context, work return ctrl.Result{}, nil, err } managedPropsCM, _, err := d.ensurers.managedPropsConfigMap.Ensure(ctx, workflow, pl, - common.UserPropertiesMutateVisitor(ctx, d.StateSupport.Catalog, workflow, pl, userPropsCM.(*v1.ConfigMap))) + common.ManagedPropertiesMutateVisitor(ctx, d.StateSupport.Catalog, workflow, pl, userPropsCM.(*v1.ConfigMap))) if err != nil { workflow.Status.Manager().MarkFalse(api.RunningConditionType, api.ExternalResourcesNotFoundReason, "Unable to retrieve the managed properties config map") _, err = d.PerformStatusUpdate(ctx, workflow)