This is an automated email from the ASF dual-hosted git repository.
ricardozanini pushed a commit to branch main
in repository
https://gitbox.apache.org/repos/asf/incubator-kie-kogito-serverless-operator.git
The following commit(s) were added to refs/heads/main by this push:
new 2a237b1a Fix Issue #319 - Rename prod profile to preview (#414)
2a237b1a is described below
commit 2a237b1a3e8dbf2c650200170f05da35923272e6
Author: Ricardo Zanini <[email protected]>
AuthorDate: Fri Mar 22 15:23:59 2024 -0300
Fix Issue #319 - Rename prod profile to preview (#414)
* Fix Issue #319 - Rename prod profile to preview
Signed-off-by: Ricardo Zanini <[email protected]>
* Renaming profile after rebase
Signed-off-by: Ricardo Zanini <[email protected]>
---------
Signed-off-by: Ricardo Zanini <[email protected]>
---
.gitignore | 2 +
api/metadata/annotations.go | 24 ++++++-
.../profiles/common/properties/application_test.go | 22 +++---
controllers/profiles/factory/factory.go | 27 +++++---
controllers/profiles/gitops/alias.go | 25 +++++++
controllers/profiles/gitops/profile_gitops.go | 56 +++++++++++++++
controllers/profiles/gitops/profile_gitops_test.go | 68 ++++++++++++++++++
.../states_gitops.go} | 4 +-
.../{prod => preview}/deployment_handler.go | 16 ++---
.../{prod => preview}/deployment_handler_test.go | 20 +++---
.../object_creators_preview.go} | 5 +-
.../profile_prod.go => preview/profile_preview.go} | 46 ++++--------
.../profile_preview_test.go} | 50 ++-----------
.../states_prod.go => preview/states_preview.go} | 6 +-
hack/local/run-e2e.sh | 3 +-
test/e2e/clusterplatform_test.go | 9 +--
test/e2e/helpers.go | 24 -------
test/e2e/platform_test.go | 13 ++--
test/e2e/workflow_test.go | 6 +-
.../ephemeral/02-sonataflow_platform.yaml | 0
.../{prod => preview}/ephemeral/kustomization.yaml | 0
.../03-sonataflow_callbackstatetimeouts.sw.yaml | 0
.../01-sonataflow_clusterplatform.yaml | 0
.../02-sonataflow_platform.yaml | 0
.../cluster-wide-ephemeral/kustomization.yaml | 0
.../02-sonataflow_platform.yaml | 0
.../ephemeral-data-index/kustomization.yaml | 0
.../03-sonataflow_callbackstatetimeouts.sw.yaml | 0
.../02-sonataflow_platform.yaml | 0
.../ephemeral-job-service/kustomization.yaml | 0
.../03-sonataflow_callbackstatetimeouts.sw.yaml | 0
.../02-sonataflow_platform.yaml | 0
.../ephemeral-with-workflow/kustomization.yaml | 0
.../03-sonataflow_callbackstatetimeouts.sw.yaml | 0
.../ephemeral/02-sonataflow_platform.yaml | 0
.../{prod => preview}/ephemeral/kustomization.yaml | 0
.../03-sonataflow_callbackstatetimeouts.sw.yaml | 2 +-
.../{prod => preview}/postgreSQL/01-postgres.yaml | 0
.../postgreSQL/02-sonataflow_platform.yaml | 0
.../postgreSQL/kustomization.yaml | 0
.../04-sonataflow_callbackstatetimeouts.sw.yaml | 2 +-
.../03-sonataflow_callbackstatetimeouts.sw.yaml | 81 ----------------------
test/yaml.go | 16 ++---
workflowproj/operator.go | 4 +-
workflowproj/workflowproj_test.go | 4 +-
45 files changed, 275 insertions(+), 260 deletions(-)
diff --git a/.gitignore b/.gitignore
index c7948bf5..414655ca 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,3 +23,5 @@
/.idea/
/.vscode/
/target/
+
+e2e-test-report.xml
diff --git a/api/metadata/annotations.go b/api/metadata/annotations.go
index 55f60ea5..a0980ab9 100644
--- a/api/metadata/annotations.go
+++ b/api/metadata/annotations.go
@@ -41,6 +41,19 @@ const (
SpecVersion = "0.8"
)
+type QuarkusProfileType string
+
+func (p QuarkusProfileType) String() string {
+ return string(p)
+}
+
+const (
+ // QuarkusDevProfile the profile used by quarkus in devmode
+ QuarkusDevProfile QuarkusProfileType = "dev"
+ // QuarkusProdProfile the profile used by quarkus in an immutable image
+ QuarkusProdProfile QuarkusProfileType = "prod"
+)
+
type ProfileType string
func (p ProfileType) String() string {
@@ -48,6 +61,15 @@ func (p ProfileType) String() string {
}
const (
- DevProfile ProfileType = "dev"
+ // DevProfile deploys a mutable workflow that can be changed based on
.spec.flow definitions CR change.
+ DevProfile ProfileType = "dev"
+ // Deprecated: use PreviewProfile.
ProdProfile ProfileType = "prod"
+ // PreviewProfile is the default profile if none is set.
+ // The operator will use the platform to do a minimal image build for
users to preview an immutable app deployed in the cluster.
+ // Not suitable for production use cases since the managed build has
configuration and resources limitations.
+ PreviewProfile ProfileType = "preview"
+ // GitOpsProfile signs the operator that the application image is built
externally, skipping any internal managed build.
+ // Ideally used in production use cases
+ GitOpsProfile ProfileType = "gitops"
)
diff --git a/controllers/profiles/common/properties/application_test.go
b/controllers/profiles/common/properties/application_test.go
index 686d6f9a..93700baf 100644
--- a/controllers/profiles/common/properties/application_test.go
+++ b/controllers/profiles/common/properties/application_test.go
@@ -238,7 +238,7 @@ func
Test_appPropertyHandler_WithServicesWithUserOverrides(t *testing.T) {
assert.Equal(t, "false",
generatedProps.GetString(constants.KogitoUserTasksEventsEnabled, ""))
// prod profile enables config of outgoing events url
- workflow.SetAnnotations(map[string]string{metadata.Profile:
string(metadata.ProdProfile)})
+ workflow.SetAnnotations(map[string]string{metadata.Profile:
string(metadata.PreviewProfile)})
services.SetServiceUrlsInWorkflowStatus(platform, workflow)
assert.NotNil(t, workflow.Status.Services)
assert.NotNil(t, workflow.Status.Services.JobServiceRef)
@@ -329,7 +329,7 @@ var _ = Describe("Platform properties", func() {
generatePlatform(setJobServiceEnabledValue(&disabled),
setPlatformNamespace("default"), setPlatformName("foo")),
generateJobServiceWorkflowDevProperties()),
Entry("has enabled field set to false and
workflow with production profile",
-
generateFlow(setProfileInFlow(metadata.ProdProfile), setWorkflowName("foo"),
setWorkflowNamespace("default")),
+
generateFlow(setProfileInFlow(metadata.PreviewProfile), setWorkflowName("foo"),
setWorkflowNamespace("default")),
generatePlatform(setJobServiceEnabledValue(&disabled),
setPlatformNamespace("default"), setPlatformName("foo")),
generateJobServiceWorkflowDevProperties()),
Entry("has enabled field undefined and workflow
with dev profile",
@@ -337,7 +337,7 @@ var _ = Describe("Platform properties", func() {
generatePlatform(setJobServiceEnabledValue(nil),
setPlatformNamespace("default"), setPlatformName("foo")),
generateJobServiceWorkflowDevProperties()),
Entry("has enabled field undefined and workflow
with production profile",
-
generateFlow(setProfileInFlow(metadata.ProdProfile), setWorkflowName("foo"),
setWorkflowNamespace("default")),
+
generateFlow(setProfileInFlow(metadata.PreviewProfile), setWorkflowName("foo"),
setWorkflowNamespace("default")),
generatePlatform(setJobServiceEnabledValue(nil),
setPlatformNamespace("default"), setPlatformName("foo")),
generateJobServiceWorkflowDevProperties()),
Entry("has enabled field set to true and
workflow with dev profile",
@@ -345,7 +345,7 @@ var _ = Describe("Platform properties", func() {
generatePlatform(setJobServiceEnabledValue(&enabled), setPlatformName("foo"),
setPlatformNamespace("default")),
generateJobServiceWorkflowDevProperties()),
Entry("has enabled field set to true and
workflow with production profile",
-
generateFlow(setProfileInFlow(metadata.ProdProfile), setWorkflowName("foo"),
setWorkflowNamespace("default")),
+
generateFlow(setProfileInFlow(metadata.PreviewProfile), setWorkflowName("foo"),
setWorkflowNamespace("default")),
generatePlatform(setJobServiceEnabledValue(&enabled), setPlatformName("foo"),
setPlatformNamespace("default")),
generateJobServiceWorkflowProductionProperties()),
Entry("has enabled field set to true and
workflow with no profile",
@@ -377,7 +377,7 @@ var _ = Describe("Platform properties", func() {
generatePlatform(setDataIndexEnabledValue(&disabled),
setPlatformNamespace("default"), setPlatformName("foo")),
generateDataIndexWorkflowDevProperties()),
Entry("has enabled field set to false and
workflow with production profile",
-
generateFlow(setProfileInFlow(metadata.ProdProfile), setWorkflowName("foo"),
setWorkflowNamespace("default")),
+
generateFlow(setProfileInFlow(metadata.PreviewProfile), setWorkflowName("foo"),
setWorkflowNamespace("default")),
generatePlatform(setDataIndexEnabledValue(&disabled),
setPlatformNamespace("default"), setPlatformName("foo")),
generateDataIndexWorkflowDevProperties()),
Entry("has enabled field undefined and workflow
with dev profile",
@@ -385,7 +385,7 @@ var _ = Describe("Platform properties", func() {
generatePlatform(setDataIndexEnabledValue(nil),
setPlatformNamespace("default"), setPlatformName("foo")),
generateDataIndexWorkflowDevProperties()),
Entry("has enabled field undefined and workflow
with production profile",
-
generateFlow(setProfileInFlow(metadata.ProdProfile), setWorkflowName("foo"),
setWorkflowNamespace("default")),
+
generateFlow(setProfileInFlow(metadata.PreviewProfile), setWorkflowName("foo"),
setWorkflowNamespace("default")),
generatePlatform(setDataIndexEnabledValue(nil),
setPlatformNamespace("default"), setPlatformName("foo")),
generateDataIndexWorkflowDevProperties()),
Entry("has enabled field set to true and
workflow with dev profile",
@@ -393,7 +393,7 @@ var _ = Describe("Platform properties", func() {
generatePlatform(setDataIndexEnabledValue(&enabled),
setPlatformNamespace("default"), setPlatformName("foo")),
generateDataIndexWorkflowDevProperties()),
Entry("has enabled field set to true and
workflow with production profile",
-
generateFlow(setProfileInFlow(metadata.ProdProfile), setWorkflowName("foo"),
setWorkflowNamespace("default")),
+
generateFlow(setProfileInFlow(metadata.PreviewProfile), setWorkflowName("foo"),
setWorkflowNamespace("default")),
generatePlatform(setDataIndexEnabledValue(&enabled),
setPlatformNamespace("default"), setPlatformName("foo")),
generateDataIndexWorkflowProductionProperties()),
Entry("has enabled field set to false and
workflow with no profile",
@@ -424,7 +424,7 @@ var _ = Describe("Platform properties", func() {
generatePlatform(setPlatformNamespace("default"), setPlatformName("foo")),
generateDataIndexAndJobServiceWorkflowDevProperties()),
Entry("both are undefined and workflow in prod
profile",
-
generateFlow(setProfileInFlow(metadata.ProdProfile), setWorkflowName("foo"),
setWorkflowNamespace("default")),
+
generateFlow(setProfileInFlow(metadata.PreviewProfile), setWorkflowName("foo"),
setWorkflowNamespace("default")),
generatePlatform(setPlatformNamespace("default"), setPlatformName("foo")),
generateDataIndexAndJobServiceWorkflowDevProperties()),
Entry("both have enabled field set to true and
workflow with dev profile",
@@ -432,7 +432,7 @@ var _ = Describe("Platform properties", func() {
generatePlatform(setJobServiceEnabledValue(&enabled),
setDataIndexEnabledValue(&enabled), setPlatformName("foo"),
setPlatformNamespace("default")),
generateDataIndexAndJobServiceWorkflowDevProperties()),
Entry("both have enabled field set to true and
workflow with production profile",
-
generateFlow(setProfileInFlow(metadata.ProdProfile), setWorkflowName("foo"),
setWorkflowNamespace("default")),
+
generateFlow(setProfileInFlow(metadata.PreviewProfile), setWorkflowName("foo"),
setWorkflowNamespace("default")),
generatePlatform(setJobServiceEnabledValue(&enabled),
setDataIndexEnabledValue(&enabled), setPlatformName("foo"),
setPlatformNamespace("default")),
generateDataIndexAndJobServiceWorkflowProductionProperties()),
Entry("both have enabled field undefined and
workflow with dev profile",
@@ -440,7 +440,7 @@ var _ = Describe("Platform properties", func() {
generatePlatform(setJobServiceEnabledValue(nil), setDataIndexEnabledValue(nil),
setPlatformName("foo"), setPlatformNamespace("default")),
generateDataIndexAndJobServiceWorkflowDevProperties()),
Entry("both have enabled field undefined and
workflow with production profile",
-
generateFlow(setProfileInFlow(metadata.ProdProfile), setWorkflowName("foo"),
setWorkflowNamespace("default")),
+
generateFlow(setProfileInFlow(metadata.PreviewProfile), setWorkflowName("foo"),
setWorkflowNamespace("default")),
generatePlatform(setJobServiceEnabledValue(nil), setDataIndexEnabledValue(nil),
setPlatformName("foo"), setPlatformNamespace("default"),
setJobServiceJDBC("jdbc:postgresql://postgres:5432/sonataflow?currentSchema=myschema")),
generateDataIndexAndJobServiceWorkflowDevProperties()),
Entry("both have enabled field set to false and
workflow with dev profile",
@@ -448,7 +448,7 @@ var _ = Describe("Platform properties", func() {
generatePlatform(setJobServiceEnabledValue(&disabled),
setDataIndexEnabledValue(&disabled), setPlatformName("foo"),
setPlatformNamespace("default"),
setJobServiceJDBC("jdbc:postgresql://postgres:5432/sonataflow?currentSchema=myschema")),
generateDataIndexAndJobServiceWorkflowDevProperties()),
Entry("both have enabled field set to false and
workflow with production profile",
-
generateFlow(setProfileInFlow(metadata.ProdProfile), setWorkflowName("foo"),
setWorkflowNamespace("default")),
+
generateFlow(setProfileInFlow(metadata.PreviewProfile), setWorkflowName("foo"),
setWorkflowNamespace("default")),
generatePlatform(setJobServiceEnabledValue(&disabled),
setDataIndexEnabledValue(&disabled), setPlatformName("foo"),
setPlatformNamespace("default"),
setJobServiceJDBC("jdbc:postgresql://postgres:5432/sonataflow?currentSchema=myschema")),
generateDataIndexAndJobServiceWorkflowDevProperties()),
Entry("both have enabled field set to false and
workflow with no profile",
diff --git a/controllers/profiles/factory/factory.go
b/controllers/profiles/factory/factory.go
index b459c4fe..d54b0df3 100644
--- a/controllers/profiles/factory/factory.go
+++ b/controllers/profiles/factory/factory.go
@@ -20,29 +20,30 @@
package factory
import (
+
"github.com/apache/incubator-kie-kogito-serverless-operator/controllers/profiles/gitops"
+
"github.com/apache/incubator-kie-kogito-serverless-operator/controllers/profiles/preview"
+ "github.com/apache/incubator-kie-kogito-serverless-operator/log"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/record"
+ "k8s.io/klog/v2"
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/apache/incubator-kie-kogito-serverless-operator/api/metadata"
operatorapi
"github.com/apache/incubator-kie-kogito-serverless-operator/api/v1alpha08"
"github.com/apache/incubator-kie-kogito-serverless-operator/controllers/profiles"
"github.com/apache/incubator-kie-kogito-serverless-operator/controllers/profiles/dev"
-
"github.com/apache/incubator-kie-kogito-serverless-operator/controllers/profiles/prod"
)
const (
- defaultProfile = metadata.ProdProfile
- // internal profile
- opsProfile metadata.ProfileType = "prod_for_ops"
+ defaultProfile = metadata.PreviewProfile
)
type reconcilerBuilder func(client client.Client, cfg *rest.Config, recorder
record.EventRecorder) profiles.ProfileReconciler
var profileBuilders = map[metadata.ProfileType]reconcilerBuilder{
- metadata.ProdProfile: prod.NewProfileReconciler,
- metadata.DevProfile: dev.NewProfileReconciler,
- opsProfile: prod.NewProfileForOpsReconciler,
+ metadata.PreviewProfile: preview.NewProfileReconciler,
+ metadata.DevProfile: dev.NewProfileReconciler,
+ metadata.GitOpsProfile: gitops.NewProfileForOpsReconciler,
}
func profileBuilder(workflow *operatorapi.SonataFlow) reconcilerBuilder {
@@ -50,10 +51,18 @@ func profileBuilder(workflow *operatorapi.SonataFlow)
reconcilerBuilder {
if len(profile) == 0 {
profile = defaultProfile.String()
}
- if profile == metadata.ProdProfile.String() &&
workflow.HasContainerSpecImage() {
- return profileBuilders[opsProfile]
+ // keep backward compatibility
+ if profile == metadata.ProdProfile.String() {
+ klog.V(log.W).Infof("Profile %s is deprecated, please use '%s'
instead.", metadata.ProdProfile, metadata.PreviewProfile)
+ profile = metadata.PreviewProfile.String()
+ }
+ // Enforce GitOps profile if the .spec.podTemplate.container.image is
set in the Preview profile.
+ if (profile == metadata.PreviewProfile.String() || profile ==
metadata.ProdProfile.String()) && workflow.HasContainerSpecImage() {
+ workflow.Annotations[metadata.Profile] =
metadata.GitOpsProfile.String()
+ return profileBuilders[metadata.GitOpsProfile]
}
if _, ok := profileBuilders[metadata.ProfileType(profile)]; !ok {
+ klog.V(log.W).Infof("Profile %s not supported, please use '%s'
or '%s'. Falling back to %s", profile, metadata.PreviewProfile,
metadata.DevProfile, defaultProfile)
return profileBuilders[defaultProfile]
}
return profileBuilders[metadata.ProfileType(profile)]
diff --git a/controllers/profiles/gitops/alias.go
b/controllers/profiles/gitops/alias.go
new file mode 100644
index 00000000..97b18347
--- /dev/null
+++ b/controllers/profiles/gitops/alias.go
@@ -0,0 +1,25 @@
+// Copyright 2024 Apache Software Foundation (ASF)
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package gitops
+
+import
"github.com/apache/incubator-kie-kogito-serverless-operator/controllers/profiles/preview"
+
+// Aliases to preview profile package to avoid cluttering this package with
references to preview profile.
+// It makes easier to maintain and understand where it comes the references.
+
+var newDeploymentReconciler = preview.NewDeploymentReconciler
+var newObjectEnsurers = preview.NewObjectEnsurers
+
+type objectEnsurers = preview.ObjectEnsurers
diff --git a/controllers/profiles/gitops/profile_gitops.go
b/controllers/profiles/gitops/profile_gitops.go
new file mode 100644
index 00000000..41c0e8a1
--- /dev/null
+++ b/controllers/profiles/gitops/profile_gitops.go
@@ -0,0 +1,56 @@
+// Copyright 2024 Apache Software Foundation (ASF)
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package gitops
+
+import (
+
"github.com/apache/incubator-kie-kogito-serverless-operator/api/metadata"
+
"github.com/apache/incubator-kie-kogito-serverless-operator/controllers/discovery"
+
"github.com/apache/incubator-kie-kogito-serverless-operator/controllers/profiles"
+
"github.com/apache/incubator-kie-kogito-serverless-operator/controllers/profiles/common"
+ "k8s.io/client-go/rest"
+ "k8s.io/client-go/tools/record"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+)
+
+var _ profiles.ProfileReconciler = &gitOpsProfile{}
+
+type gitOpsProfile struct {
+ common.Reconciler
+}
+
+// NewProfileForOpsReconciler creates an alternative prod profile that won't
require to build the workflow image in order to deploy
+// the workflow application. It assumes that the image has been built
somewhere else.
+func NewProfileForOpsReconciler(client client.Client, cfg *rest.Config,
recorder record.EventRecorder) profiles.ProfileReconciler {
+ support := &common.StateSupport{
+ C: client,
+ Cfg: cfg,
+ Catalog: discovery.NewServiceCatalogForConfig(client, cfg),
+ Recorder: recorder,
+ }
+ // the reconciliation state machine
+ stateMachine := common.NewReconciliationStateMachine(
+ &ensureBuildSkipped{StateSupport: support},
+ &followDeployWorkflowState{StateSupport: support, ensurers:
newObjectEnsurers(support)},
+ )
+ reconciler := &gitOpsProfile{
+ Reconciler: common.NewReconciler(support, stateMachine),
+ }
+
+ return reconciler
+}
+
+func (p gitOpsProfile) GetProfile() metadata.ProfileType {
+ return metadata.GitOpsProfile
+}
diff --git a/controllers/profiles/gitops/profile_gitops_test.go
b/controllers/profiles/gitops/profile_gitops_test.go
new file mode 100644
index 00000000..9287cbc2
--- /dev/null
+++ b/controllers/profiles/gitops/profile_gitops_test.go
@@ -0,0 +1,68 @@
+// Copyright 2024 Apache Software Foundation (ASF)
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package gitops
+
+import (
+ "context"
+ "testing"
+
+ "github.com/apache/incubator-kie-kogito-serverless-operator/api"
+ operatorapi
"github.com/apache/incubator-kie-kogito-serverless-operator/api/v1alpha08"
+ "github.com/apache/incubator-kie-kogito-serverless-operator/test"
+ "github.com/stretchr/testify/assert"
+ appsv1 "k8s.io/api/apps/v1"
+ corev1 "k8s.io/api/core/v1"
+ "k8s.io/client-go/rest"
+ clientruntime "sigs.k8s.io/controller-runtime/pkg/client"
+)
+
+func Test_Reconciler_ProdOps(t *testing.T) {
+ workflow := test.GetBaseSonataFlowWithProdOpsProfile(t.Name())
+ workflow.Spec.PodTemplate.PodSpec.InitContainers =
append(workflow.Spec.PodTemplate.PodSpec.InitContainers, corev1.Container{
+ Name: "check-postgres",
+ Image: "registry.access.redhat.com/ubi9/ubi-micro:latest",
+ Command: []string{"sh", "-c", "until (echo 1 >
/dev/tcp/postgres.$(cat
/var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local/5432)
>/dev/null 2>&1; do echo \"Waiting for postgres server\"; sleep 3; done;"},
+ })
+ client := test.NewSonataFlowClientBuilder().
+ WithRuntimeObjects(workflow).
+ WithStatusSubresource(workflow,
&operatorapi.SonataFlowBuild{}).Build()
+ result, err := NewProfileForOpsReconciler(client, &rest.Config{},
test.NewFakeRecorder()).Reconcile(context.TODO(), workflow)
+ assert.NoError(t, err)
+
+ assert.NotNil(t, result.RequeueAfter)
+ assert.True(t,
workflow.Status.GetCondition(api.BuiltConditionType).IsFalse())
+ assert.Equal(t, api.BuildSkippedReason,
workflow.Status.GetCondition(api.BuiltConditionType).Reason)
+ // We need the deployment controller to tell us that the workflow is
ready
+ // Since we don't have it in a mocked env, the result must be ready ==
false
+ assert.False(t, workflow.Status.IsReady())
+
+ // Reconcile again to run the deployment handler
+ result, err = NewProfileForOpsReconciler(client, &rest.Config{},
test.NewFakeRecorder()).Reconcile(context.TODO(), workflow)
+ assert.NoError(t, err)
+
+ // Let's check for the right creation of the workflow (one CM volume,
one container with a custom image)
+ deployment := &appsv1.Deployment{}
+ err = client.Get(context.TODO(),
clientruntime.ObjectKeyFromObject(workflow), deployment)
+ assert.NoError(t, err)
+
+ assert.Len(t, deployment.Spec.Template.Spec.Volumes, 1)
+ assert.Len(t, deployment.Spec.Template.Spec.Containers, 1)
+ assert.Len(t, deployment.Spec.Template.Spec.InitContainers, 1)
+ assert.Len(t, deployment.Spec.Template.Spec.Containers[0].VolumeMounts,
1)
+
+ assert.NotNil(t, deployment.ObjectMeta)
+ assert.NotNil(t, deployment.ObjectMeta.Labels)
+ assert.Equal(t, deployment.ObjectMeta.Labels, map[string]string{"test":
"test", "app": "simple", "sonataflow.org/workflow-app": "simple"})
+}
diff --git a/controllers/profiles/prod/states_prod_nobuild.go
b/controllers/profiles/gitops/states_gitops.go
similarity index 97%
rename from controllers/profiles/prod/states_prod_nobuild.go
rename to controllers/profiles/gitops/states_gitops.go
index 46449ce1..b355be4d 100644
--- a/controllers/profiles/prod/states_prod_nobuild.go
+++ b/controllers/profiles/gitops/states_gitops.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package prod
+package gitops
import (
"context"
@@ -62,7 +62,7 @@ func (f *followDeployWorkflowState) CanReconcile(workflow
*operatorapi.SonataFlo
}
func (f *followDeployWorkflowState) Do(ctx context.Context, workflow
*operatorapi.SonataFlow) (ctrl.Result, []client.Object, error) {
- return newDeploymentReconciler(f.StateSupport,
f.ensurers).reconcile(ctx, workflow)
+ return newDeploymentReconciler(f.StateSupport,
f.ensurers).Reconcile(ctx, workflow)
}
func (f *followDeployWorkflowState) PostReconcile(ctx context.Context,
workflow *operatorapi.SonataFlow) error {
diff --git a/controllers/profiles/prod/deployment_handler.go
b/controllers/profiles/preview/deployment_handler.go
similarity index 92%
rename from controllers/profiles/prod/deployment_handler.go
rename to controllers/profiles/preview/deployment_handler.go
index af999e5a..5fce2688 100644
--- a/controllers/profiles/prod/deployment_handler.go
+++ b/controllers/profiles/preview/deployment_handler.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package prod
+package preview
import (
"context"
@@ -31,23 +31,23 @@ import (
"github.com/apache/incubator-kie-kogito-serverless-operator/utils"
)
-type deploymentReconciler struct {
+type DeploymentReconciler struct {
*common.StateSupport
- ensurers *objectEnsurers
+ ensurers *ObjectEnsurers
}
-func newDeploymentReconciler(stateSupport *common.StateSupport, ensurer
*objectEnsurers) *deploymentReconciler {
- return &deploymentReconciler{
+func NewDeploymentReconciler(stateSupport *common.StateSupport, ensurer
*ObjectEnsurers) *DeploymentReconciler {
+ return &DeploymentReconciler{
StateSupport: stateSupport,
ensurers: ensurer,
}
}
-func (d *deploymentReconciler) reconcile(ctx context.Context, workflow
*operatorapi.SonataFlow) (reconcile.Result, []client.Object, error) {
+func (d *DeploymentReconciler) Reconcile(ctx context.Context, workflow
*operatorapi.SonataFlow) (reconcile.Result, []client.Object, error) {
return d.reconcileWithBuiltImage(ctx, workflow, "")
}
-func (d *deploymentReconciler) reconcileWithBuiltImage(ctx context.Context,
workflow *operatorapi.SonataFlow, image string) (reconcile.Result,
[]client.Object, error) {
+func (d *DeploymentReconciler) reconcileWithBuiltImage(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)
if err != nil {
@@ -110,7 +110,7 @@ func (d *deploymentReconciler) reconcileWithBuiltImage(ctx
context.Context, work
return result, objs, nil
}
-func (d *deploymentReconciler) getDeploymentMutateVisitors(
+func (d *DeploymentReconciler) getDeploymentMutateVisitors(
workflow *operatorapi.SonataFlow,
plf *operatorapi.SonataFlowPlatform,
image string,
diff --git a/controllers/profiles/prod/deployment_handler_test.go
b/controllers/profiles/preview/deployment_handler_test.go
similarity index 91%
rename from controllers/profiles/prod/deployment_handler_test.go
rename to controllers/profiles/preview/deployment_handler_test.go
index a133b963..d70436d7 100644
--- a/controllers/profiles/prod/deployment_handler_test.go
+++ b/controllers/profiles/preview/deployment_handler_test.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package prod
+package preview
import (
"context"
@@ -38,9 +38,9 @@ func Test_CheckPodTemplateChangesReflectDeployment(t
*testing.T) {
WithStatusSubresource(workflow).
Build()
stateSupport := fakeReconcilerSupport(client)
- handler := newDeploymentReconciler(stateSupport,
newObjectEnsurers(stateSupport))
+ handler := NewDeploymentReconciler(stateSupport,
NewObjectEnsurers(stateSupport))
- result, objects, err := handler.reconcile(context.TODO(), workflow)
+ result, objects, err := handler.Reconcile(context.TODO(), workflow)
assert.NoError(t, err)
assert.NotEmpty(t, objects)
assert.True(t, result.Requeue)
@@ -49,7 +49,7 @@ func Test_CheckPodTemplateChangesReflectDeployment(t
*testing.T) {
expectedImg := "quay.io/apache/my-new-workflow:1.0.0"
workflow.Spec.PodTemplate.Container.Image = expectedImg
utilruntime.Must(client.Update(context.TODO(), workflow))
- result, objects, err = handler.reconcile(context.TODO(), workflow)
+ result, objects, err = handler.Reconcile(context.TODO(), workflow)
assert.NoError(t, err)
assert.NotEmpty(t, objects)
assert.True(t, result.Requeue)
@@ -71,9 +71,9 @@ func Test_CheckDeploymentRolloutAfterCMChange(t *testing.T) {
WithStatusSubresource(workflow).
Build()
stateSupport := fakeReconcilerSupport(client)
- handler := newDeploymentReconciler(stateSupport,
newObjectEnsurers(stateSupport))
+ handler := NewDeploymentReconciler(stateSupport,
NewObjectEnsurers(stateSupport))
- result, objects, err := handler.reconcile(context.TODO(), workflow)
+ result, objects, err := handler.Reconcile(context.TODO(), workflow)
assert.NoError(t, err)
assert.NotEmpty(t, objects)
assert.True(t, result.Requeue)
@@ -108,7 +108,7 @@ func Test_CheckDeploymentRolloutAfterCMChange(t *testing.T)
{
props.MustSet("test.property", "test.value")
userPropsCM.Data[workflowproj.ApplicationPropertiesFileName] =
props.String()
utilruntime.Must(client.Update(context.TODO(), userPropsCM))
- result, objects, err = handler.reconcile(context.TODO(), workflow)
+ result, objects, err = handler.Reconcile(context.TODO(), workflow)
assert.NoError(t, err)
assert.NotEmpty(t, objects)
assert.True(t, result.Requeue)
@@ -133,9 +133,9 @@ func Test_CheckDeploymentUnchangedAfterCMChangeOtherKeys(t
*testing.T) {
WithStatusSubresource(workflow).
Build()
stateSupport := fakeReconcilerSupport(client)
- handler := newDeploymentReconciler(stateSupport,
newObjectEnsurers(stateSupport))
+ handler := NewDeploymentReconciler(stateSupport,
NewObjectEnsurers(stateSupport))
- result, objects, err := handler.reconcile(context.TODO(), workflow)
+ result, objects, err := handler.Reconcile(context.TODO(), workflow)
assert.NoError(t, err)
assert.NotEmpty(t, objects)
assert.True(t, result.Requeue)
@@ -167,7 +167,7 @@ func Test_CheckDeploymentUnchangedAfterCMChangeOtherKeys(t
*testing.T) {
userPropsCM.Data["other.key"] = "useless.key = value"
utilruntime.Must(client.Update(context.TODO(), userPropsCM))
- result, objects, err = handler.reconcile(context.TODO(), workflow)
+ result, objects, err = handler.Reconcile(context.TODO(), workflow)
assert.NoError(t, err)
assert.NotEmpty(t, objects)
assert.True(t, result.Requeue)
diff --git a/controllers/profiles/prod/object_creators_prod.go
b/controllers/profiles/preview/object_creators_preview.go
similarity index 97%
rename from controllers/profiles/prod/object_creators_prod.go
rename to controllers/profiles/preview/object_creators_preview.go
index 02328e9b..903cd741 100644
--- a/controllers/profiles/prod/object_creators_prod.go
+++ b/controllers/profiles/preview/object_creators_preview.go
@@ -17,7 +17,7 @@
* under the License.
*/
-package prod
+package preview
import (
"fmt"
@@ -85,8 +85,7 @@ func mountProdConfigMapsMutateVisitor(workflow
*operatorapi.SonataFlow, userProp
kubeutil.AddOrReplaceVolumeMount(idx,
&deployment.Spec.Template.Spec,
kubeutil.VolumeMount(constants.ConfigMapWorkflowPropsVolumeName, true,
quarkusProdConfigMountPath))
- kubeutil.AnnotateDeploymentConfigChecksum(workflow,
deployment, userPropsCM, managedPropsCM)
- return nil
+ return
kubeutil.AnnotateDeploymentConfigChecksum(workflow, deployment, userPropsCM,
managedPropsCM)
}
}
}
diff --git a/controllers/profiles/prod/profile_prod.go
b/controllers/profiles/preview/profile_preview.go
similarity index 69%
rename from controllers/profiles/prod/profile_prod.go
rename to controllers/profiles/preview/profile_preview.go
index b3353268..a4afea9b 100644
--- a/controllers/profiles/prod/profile_prod.go
+++ b/controllers/profiles/preview/profile_preview.go
@@ -17,7 +17,7 @@
* under the License.
*/
-package prod
+package preview
import (
"time"
@@ -34,9 +34,9 @@ import (
"github.com/apache/incubator-kie-kogito-serverless-operator/controllers/profiles/common"
)
-var _ profiles.ProfileReconciler = &prodProfile{}
+var _ profiles.ProfileReconciler = &previewProfile{}
-type prodProfile struct {
+type previewProfile struct {
common.Reconciler
}
@@ -48,18 +48,19 @@ const (
quarkusProdConfigMountPath = "/deployments/config"
)
-// objectEnsurers is a struct for the objects that ReconciliationState needs
to create in the platform for the Production profile.
+// ObjectEnsurers is a struct for the objects that ReconciliationState needs
to create in the platform for the Production profile.
// ReconciliationState that needs access to it must include this struct as an
attribute and initialize it in the profile builder.
-// Use newObjectEnsurers to facilitate building this struct
-type objectEnsurers struct {
+// Use NewObjectEnsurers to facilitate building this struct
+type ObjectEnsurers struct {
deployment common.ObjectEnsurerWithPlatform
service common.ObjectEnsurer
userPropsConfigMap common.ObjectEnsurer
managedPropsConfigMap common.ObjectEnsurerWithPlatform
}
-func newObjectEnsurers(support *common.StateSupport) *objectEnsurers {
- return &objectEnsurers{
+// NewObjectEnsurers common.ObjectEnsurer(s) for the preview profile.
+func NewObjectEnsurers(support *common.StateSupport) *ObjectEnsurers {
+ return &ObjectEnsurers{
deployment:
common.NewObjectEnsurerWithPlatform(support.C, common.DeploymentCreator),
service: common.NewObjectEnsurer(support.C,
common.ServiceCreator),
userPropsConfigMap: common.NewObjectEnsurer(support.C,
common.UserPropsConfigMapCreator),
@@ -80,36 +81,15 @@ func NewProfileReconciler(client client.Client, cfg
*rest.Config, recorder recor
stateMachine := common.NewReconciliationStateMachine(
&newBuilderState{StateSupport: support},
&followBuildStatusState{StateSupport: support},
- &deployWithBuildWorkflowState{StateSupport: support, ensurers:
newObjectEnsurers(support)},
+ &deployWithBuildWorkflowState{StateSupport: support, ensurers:
NewObjectEnsurers(support)},
)
- reconciler := &prodProfile{
+ reconciler := &previewProfile{
Reconciler: common.NewReconciler(support, stateMachine),
}
return reconciler
}
-// NewProfileForOpsReconciler creates an alternative prod profile that won't
require to build the workflow image in order to deploy
-// the workflow application. It assumes that the image has been built
somewhere else.
-func NewProfileForOpsReconciler(client client.Client, cfg *rest.Config,
recorder record.EventRecorder) profiles.ProfileReconciler {
- support := &common.StateSupport{
- C: client,
- Cfg: cfg,
- Catalog: discovery.NewServiceCatalogForConfig(client, cfg),
- Recorder: recorder,
- }
- // the reconciliation state machine
- stateMachine := common.NewReconciliationStateMachine(
- &ensureBuildSkipped{StateSupport: support},
- &followDeployWorkflowState{StateSupport: support, ensurers:
newObjectEnsurers(support)},
- )
- reconciler := &prodProfile{
- Reconciler: common.NewReconciler(support, stateMachine),
- }
-
- return reconciler
-}
-
-func (p prodProfile) GetProfile() metadata.ProfileType {
- return metadata.ProdProfile
+func (p previewProfile) GetProfile() metadata.ProfileType {
+ return metadata.PreviewProfile
}
diff --git a/controllers/profiles/prod/profile_prod_test.go
b/controllers/profiles/preview/profile_preview_test.go
similarity index 77%
rename from controllers/profiles/prod/profile_prod_test.go
rename to controllers/profiles/preview/profile_preview_test.go
index 89a2adba..cc518db0 100644
--- a/controllers/profiles/prod/profile_prod_test.go
+++ b/controllers/profiles/preview/profile_preview_test.go
@@ -17,7 +17,7 @@
* under the License.
*/
-package prod
+package preview
import (
"context"
@@ -35,48 +35,6 @@ import (
clientruntime "sigs.k8s.io/controller-runtime/pkg/client"
)
-var (
- emptyPlatform = &operatorapi.SonataFlowPlatform{}
-)
-
-func Test_Reconciler_ProdOps(t *testing.T) {
- workflow := test.GetBaseSonataFlowWithProdOpsProfile(t.Name())
- workflow.Spec.PodTemplate.PodSpec.InitContainers =
append(workflow.Spec.PodTemplate.PodSpec.InitContainers, corev1.Container{
- Name: "check-postgres",
- Image: "registry.access.redhat.com/ubi9/ubi-micro:latest",
- Command: []string{"sh", "-c", "until (echo 1 >
/dev/tcp/postgres.$(cat
/var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local/5432)
>/dev/null 2>&1; do echo \"Waiting for postgres server\"; sleep 3; done;"},
- })
- client := test.NewSonataFlowClientBuilder().
- WithRuntimeObjects(workflow).
- WithStatusSubresource(workflow,
&operatorapi.SonataFlowBuild{}).Build()
- result, err := NewProfileForOpsReconciler(client, &rest.Config{},
test.NewFakeRecorder()).Reconcile(context.TODO(), workflow)
- assert.NoError(t, err)
-
- assert.NotNil(t, result.RequeueAfter)
- assert.True(t,
workflow.Status.GetCondition(api.BuiltConditionType).IsFalse())
- assert.Equal(t, api.BuildSkippedReason,
workflow.Status.GetCondition(api.BuiltConditionType).Reason)
- // We need the deployment controller to tell us that the workflow is
ready
- // Since we don't have it in a mocked env, the result must be ready ==
false
- assert.False(t, workflow.Status.IsReady())
-
- // Reconcile again to run the deployment handler
- result, err = NewProfileForOpsReconciler(client, &rest.Config{},
test.NewFakeRecorder()).Reconcile(context.TODO(), workflow)
- assert.NoError(t, err)
-
- // Let's check for the right creation of the workflow (one CM volume,
one container with a custom image)
- deployment := &appsv1.Deployment{}
- err = client.Get(context.TODO(),
clientruntime.ObjectKeyFromObject(workflow), deployment)
- assert.NoError(t, err)
-
- assert.Len(t, deployment.Spec.Template.Spec.Volumes, 1)
- assert.Len(t, deployment.Spec.Template.Spec.Containers, 1)
- assert.Len(t, deployment.Spec.Template.Spec.InitContainers, 1)
- assert.Len(t, deployment.Spec.Template.Spec.Containers[0].VolumeMounts,
1)
- assert.NotNil(t, deployment.ObjectMeta)
- assert.NotNil(t, deployment.ObjectMeta.Labels)
- assert.Equal(t, deployment.ObjectMeta.Labels, map[string]string{"test":
"test", "app": "simple", "sonataflow.org/workflow-app": "simple"})
-}
-
func Test_Reconciler_ProdCustomPod(t *testing.T) {
workflow := test.GetBaseSonataFlowWithProdProfile(t.Name())
workflow.Spec.PodTemplate.PodSpec.InitContainers =
append(workflow.Spec.PodTemplate.PodSpec.InitContainers, corev1.Container{
@@ -178,7 +136,7 @@ func
Test_deployWorkflowReconciliationHandler_handleObjects(t *testing.T) {
Build()
handler := &deployWithBuildWorkflowState{
StateSupport: fakeReconcilerSupport(client),
- ensurers: newObjectEnsurers(&common.StateSupport{C:
client}),
+ ensurers: NewObjectEnsurers(&common.StateSupport{C:
client}),
}
result, objects, err := handler.Do(context.TODO(), workflow)
assert.Greater(t, result.RequeueAfter, int64(0))
@@ -207,7 +165,7 @@ func Test_GenerationAnnotationCheck(t *testing.T) {
handler := &deployWithBuildWorkflowState{
StateSupport: fakeReconcilerSupport(client),
- ensurers: newObjectEnsurers(&common.StateSupport{C:
client}),
+ ensurers: NewObjectEnsurers(&common.StateSupport{C:
client}),
}
result, objects, err := handler.Do(context.TODO(), workflow)
assert.Greater(t, result.RequeueAfter, int64(time.Second))
@@ -226,7 +184,7 @@ func Test_GenerationAnnotationCheck(t *testing.T) {
// reconcile
handler = &deployWithBuildWorkflowState{
StateSupport: fakeReconcilerSupport(client),
- ensurers: newObjectEnsurers(&common.StateSupport{C:
client}),
+ ensurers: NewObjectEnsurers(&common.StateSupport{C:
client}),
}
result, objects, err = handler.Do(context.TODO(), workflowChanged)
assert.NoError(t, err)
diff --git a/controllers/profiles/prod/states_prod.go
b/controllers/profiles/preview/states_preview.go
similarity index 98%
rename from controllers/profiles/prod/states_prod.go
rename to controllers/profiles/preview/states_preview.go
index feb30dca..933820e8 100644
--- a/controllers/profiles/prod/states_prod.go
+++ b/controllers/profiles/preview/states_preview.go
@@ -17,7 +17,7 @@
* under the License.
*/
-package prod
+package preview
import (
"context"
@@ -151,7 +151,7 @@ func (h *followBuildStatusState) PostReconcile(ctx
context.Context, workflow *op
type deployWithBuildWorkflowState struct {
*common.StateSupport
- ensurers *objectEnsurers
+ ensurers *ObjectEnsurers
deploymentVisitors []common.MutateVisitor
}
@@ -189,7 +189,7 @@ func (h *deployWithBuildWorkflowState) Do(ctx
context.Context, workflow *operato
}
// didn't change, business as usual
- return newDeploymentReconciler(h.StateSupport,
h.ensurers).reconcileWithBuiltImage(ctx, workflow, build.Status.ImageTag)
+ return NewDeploymentReconciler(h.StateSupport,
h.ensurers).reconcileWithBuiltImage(ctx, workflow, build.Status.ImageTag)
}
func (h *deployWithBuildWorkflowState) PostReconcile(ctx context.Context,
workflow *operatorapi.SonataFlow) error {
diff --git a/hack/local/run-e2e.sh b/hack/local/run-e2e.sh
index 0e5261b6..a048fad7 100755
--- a/hack/local/run-e2e.sh
+++ b/hack/local/run-e2e.sh
@@ -20,11 +20,12 @@
# You must have minikube installed
MINIKUBE_PROFILE=${1:-minikube}
echo "Using minikube profile ${MINIKUBE_PROFILE}"
+export OPERATOR_IMAGE_NAME=localhost/kogito-serverless-operator:0.0.1
# clean up previous runs
make undeploy ignore-not-found=true
+make deploy IMG="${OPERATOR_IMAGE_NAME}"
-export OPERATOR_IMAGE_NAME=localhost/kogito-serverless-operator:0.0.1
eval "$(minikube -p "${MINIKUBE_PROFILE}" docker-env)"
if ! make docker-build IMG="${OPERATOR_IMAGE_NAME}"; then
echo "Failure: Failed to build image, exiting " >&2
diff --git a/test/e2e/clusterplatform_test.go b/test/e2e/clusterplatform_test.go
index e96699a3..a2e316eb 100644
--- a/test/e2e/clusterplatform_test.go
+++ b/test/e2e/clusterplatform_test.go
@@ -25,6 +25,7 @@ import (
"path/filepath"
"time"
+
"github.com/apache/incubator-kie-kogito-serverless-operator/api/metadata"
"github.com/apache/incubator-kie-kogito-serverless-operator/controllers/platform/services"
"github.com/apache/incubator-kie-kogito-serverless-operator/controllers/profiles/common/constants"
"github.com/apache/incubator-kie-kogito-serverless-operator/test"
@@ -207,8 +208,8 @@ var _ = Describe("Validate a clusterplatform", Ordered,
func() {
_, err = utils.Run(cmd)
Expect(err).NotTo(HaveOccurred())
},
- Entry("without services configured",
test.GetSonataFlowE2EPlatformNoServicesDirectory(), production, ephemeral,
false),
- Entry("with services configured",
test.GetSonataFlowE2EPlatformServicesDirectory(), production,
"ephemeral-with-workflow", true),
+ Entry("without services configured",
test.GetSonataFlowE2EPlatformNoServicesDirectory(),
metadata.PreviewProfile.String(), ephemeral, false),
+ Entry("with services configured",
test.GetSonataFlowE2EPlatformServicesDirectory(),
metadata.PreviewProfile.String(), "ephemeral-with-workflow", true),
)
DescribeTable("against a platform in a separate namespace",
func(testcaseDir string, profile string, persistenceType string) {
@@ -286,8 +287,8 @@ var _ = Describe("Validate a clusterplatform", Ordered,
func() {
_, err = utils.Run(cmd)
Expect(err).NotTo(HaveOccurred())
},
- Entry("with only Data Index configured",
test.GetSonataFlowE2EPlatformServicesDirectory(), production,
ephemeralDataIndex),
- Entry("with only Job Service configured",
test.GetSonataFlowE2EPlatformServicesDirectory(), production,
ephemeralJobService),
+ Entry("with only Data Index configured",
test.GetSonataFlowE2EPlatformServicesDirectory(),
metadata.PreviewProfile.String(), ephemeralDataIndex),
+ Entry("with only Job Service configured",
test.GetSonataFlowE2EPlatformServicesDirectory(),
metadata.PreviewProfile.String(), ephemeralJobService),
)
})
})
diff --git a/test/e2e/helpers.go b/test/e2e/helpers.go
index d2dd8e83..104afa31 100644
--- a/test/e2e/helpers.go
+++ b/test/e2e/helpers.go
@@ -18,12 +18,10 @@ import (
"encoding/json"
"fmt"
"net/url"
- "os"
"os/exec"
"strconv"
"strings"
- "github.com/apache/incubator-kie-kogito-serverless-operator/test"
"github.com/apache/incubator-kie-kogito-serverless-operator/test/utils"
//nolint:golint
@@ -35,9 +33,6 @@ import (
. "github.com/onsi/gomega"
)
-// sonataflow_operator_namespace store the ns where the Operator and Operand
will be executed
-const sonataflow_operator_namespace = "sonataflow-operator-system"
-
type health struct {
Status string `json:"status"`
Checks []check `json:"checks"`
@@ -162,22 +157,3 @@ func verifyWorkflowIsAddressable(workflowName string,
targetNamespace string) bo
return false
}
}
-
-const (
- minikubePlatform = "minikube"
- openshiftPlatform = "openshift"
-)
-
-func getSonataFlowPlatformFilename() string {
- if getClusterPlatform() == openshiftPlatform {
- return test.GetPlatformOpenshiftE2eTest()
- }
- return test.GetPlatformMinikubeE2eTest()
-}
-
-func getClusterPlatform() string {
- if v, ok := os.LookupEnv("CLUSTER_PLATFORM"); ok {
- return v
- }
- return minikubePlatform
-}
diff --git a/test/e2e/platform_test.go b/test/e2e/platform_test.go
index 00f51039..c2c86d08 100644
--- a/test/e2e/platform_test.go
+++ b/test/e2e/platform_test.go
@@ -23,6 +23,7 @@ import (
"strings"
"time"
+
"github.com/apache/incubator-kie-kogito-serverless-operator/api/metadata"
"github.com/apache/incubator-kie-kogito-serverless-operator/test"
"github.com/apache/incubator-kie-kogito-serverless-operator/test/utils"
@@ -38,8 +39,6 @@ import (
const (
ephemeral = "ephemeral"
postgreSQL = "postgreSQL"
- dev = "dev"
- production = "prod"
clusterWideEphemeral = "cluster-wide-ephemeral"
ephemeralDataIndex = "ephemeral-data-index"
ephemeralJobService = "ephemeral-job-service"
@@ -82,7 +81,7 @@ var _ = Describe("Validate the persistence", Ordered, func() {
cmd.Stdin = bytes.NewBuffer(manifests)
_, err := utils.Run(cmd)
Expect(err).NotTo(HaveOccurred())
- By("Wait for SonatatFlowPlatform CR to complete
deployment")
+ By("Wait for SonataFlowPlatform CR to complete
deployment")
// wait for service deployments to be ready
EventuallyWithOffset(1, func() error {
cmd = exec.Command("kubectl", "wait", "pod",
"-n", targetNamespace, "-l", "app=sonataflow-platform", "--for",
"condition=Ready", "--timeout=5s")
@@ -117,10 +116,10 @@ var _ = Describe("Validate the persistence", Ordered,
func() {
}, 10*time.Minute, 5).Should(BeTrue())
}
},
- Entry("with both Job Service and Data Index and
ephemeral persistence and the workflow in a dev profile",
test.GetSonataFlowE2EPlatformServicesDirectory(), dev, ephemeral),
- Entry("with both Job Service and Data Index and
ephemeral persistence and the workflow in a production profile",
test.GetSonataFlowE2EPlatformServicesDirectory(), production, ephemeral),
- Entry("with both Job Service and Data Index and
postgreSQL persistence and the workflow in a dev profile",
test.GetSonataFlowE2EPlatformServicesDirectory(), dev, postgreSQL),
- Entry("with both Job Service and Data Index and
postgreSQL persistence and the workflow in a production profile",
test.GetSonataFlowE2EPlatformServicesDirectory(), production, postgreSQL),
+ Entry("with both Job Service and Data Index and
ephemeral persistence and the workflow in a dev profile",
test.GetSonataFlowE2EPlatformServicesDirectory(), metadata.DevProfile.String(),
ephemeral),
+ Entry("with both Job Service and Data Index and
ephemeral persistence and the workflow in a preview profile",
test.GetSonataFlowE2EPlatformServicesDirectory(),
metadata.PreviewProfile.String(), ephemeral),
+ Entry("with both Job Service and Data Index and
postgreSQL persistence and the workflow in a dev profile",
test.GetSonataFlowE2EPlatformServicesDirectory(), metadata.DevProfile.String(),
postgreSQL),
+ Entry("with both Job Service and Data Index and
postgreSQL persistence and the workflow in a preview profile",
test.GetSonataFlowE2EPlatformServicesDirectory(),
metadata.PreviewProfile.String(), postgreSQL),
)
})
diff --git a/test/e2e/workflow_test.go b/test/e2e/workflow_test.go
index 30a0ae2f..0750cd99 100644
--- a/test/e2e/workflow_test.go
+++ b/test/e2e/workflow_test.go
@@ -51,7 +51,7 @@ var _ = Describe("SonataFlow Operator", Ordered, func() {
})
AfterEach(func() {
// Remove resources in test namespace
- if !CurrentGinkgoTestDescription().Failed &&
len(targetNamespace) > 0 {
+ if !CurrentSpecReport().Failed() && len(targetNamespace) > 0 {
cmd := exec.Command("kubectl", "delete", "namespace",
targetNamespace, "--wait")
_, err := utils.Run(cmd)
Expect(err).NotTo(HaveOccurred())
@@ -61,7 +61,7 @@ var _ = Describe("SonataFlow Operator", Ordered, func() {
Describe("ensure that Operator and Operand(s) can run in restricted
namespaces", func() {
projectDir, _ := utils.GetProjectDir()
- It("should successfully deploy the Simple Workflow in prod ops
mode and verify if it's running", func() {
+ It("should successfully deploy the Simple Workflow in GitOps
mode and verify if it's running", func() {
By("creating an instance of the SonataFlow Operand(CR)")
EventuallyWithOffset(1, func() error {
cmd := exec.Command("kubectl", "apply", "-f",
filepath.Join(projectDir,
@@ -81,7 +81,7 @@ var _ = Describe("SonataFlow Operator", Ordered, func() {
}, 3*time.Minute, time.Second).Should(Succeed())
})
- It("should successfully deploy the Greeting Workflow in prod
mode and verify if it's running", func() {
+ It("should successfully deploy the Greeting Workflow in preview
mode and verify if it's running", func() {
By("creating external resources DataInputSchema
configMap")
EventuallyWithOffset(1, func() error {
cmd := exec.Command("kubectl", "apply", "-f",
filepath.Join(projectDir,
diff --git
a/test/testdata/platform/noservices/prod/ephemeral/02-sonataflow_platform.yaml
b/test/testdata/platform/noservices/preview/ephemeral/02-sonataflow_platform.yaml
similarity index 100%
rename from
test/testdata/platform/noservices/prod/ephemeral/02-sonataflow_platform.yaml
rename to
test/testdata/platform/noservices/preview/ephemeral/02-sonataflow_platform.yaml
diff --git
a/test/testdata/platform/noservices/prod/ephemeral/kustomization.yaml
b/test/testdata/platform/noservices/preview/ephemeral/kustomization.yaml
similarity index 100%
rename from test/testdata/platform/noservices/prod/ephemeral/kustomization.yaml
rename to test/testdata/platform/noservices/preview/ephemeral/kustomization.yaml
diff --git
a/test/testdata/platform/noservices/prod/ephemeral/sonataflow/03-sonataflow_callbackstatetimeouts.sw.yaml
b/test/testdata/platform/noservices/preview/ephemeral/sonataflow/03-sonataflow_callbackstatetimeouts.sw.yaml
similarity index 100%
copy from
test/testdata/platform/noservices/prod/ephemeral/sonataflow/03-sonataflow_callbackstatetimeouts.sw.yaml
copy to
test/testdata/platform/noservices/preview/ephemeral/sonataflow/03-sonataflow_callbackstatetimeouts.sw.yaml
diff --git
a/test/testdata/platform/services/prod/cluster-wide-ephemeral/01-sonataflow_clusterplatform.yaml
b/test/testdata/platform/services/preview/cluster-wide-ephemeral/01-sonataflow_clusterplatform.yaml
similarity index 100%
rename from
test/testdata/platform/services/prod/cluster-wide-ephemeral/01-sonataflow_clusterplatform.yaml
rename to
test/testdata/platform/services/preview/cluster-wide-ephemeral/01-sonataflow_clusterplatform.yaml
diff --git
a/test/testdata/platform/services/prod/cluster-wide-ephemeral/02-sonataflow_platform.yaml
b/test/testdata/platform/services/preview/cluster-wide-ephemeral/02-sonataflow_platform.yaml
similarity index 100%
rename from
test/testdata/platform/services/prod/cluster-wide-ephemeral/02-sonataflow_platform.yaml
rename to
test/testdata/platform/services/preview/cluster-wide-ephemeral/02-sonataflow_platform.yaml
diff --git
a/test/testdata/platform/services/prod/cluster-wide-ephemeral/kustomization.yaml
b/test/testdata/platform/services/preview/cluster-wide-ephemeral/kustomization.yaml
similarity index 100%
rename from
test/testdata/platform/services/prod/cluster-wide-ephemeral/kustomization.yaml
rename to
test/testdata/platform/services/preview/cluster-wide-ephemeral/kustomization.yaml
diff --git
a/test/testdata/platform/services/prod/ephemeral-data-index/02-sonataflow_platform.yaml
b/test/testdata/platform/services/preview/ephemeral-data-index/02-sonataflow_platform.yaml
similarity index 100%
rename from
test/testdata/platform/services/prod/ephemeral-data-index/02-sonataflow_platform.yaml
rename to
test/testdata/platform/services/preview/ephemeral-data-index/02-sonataflow_platform.yaml
diff --git
a/test/testdata/platform/services/prod/ephemeral-data-index/kustomization.yaml
b/test/testdata/platform/services/preview/ephemeral-data-index/kustomization.yaml
similarity index 100%
rename from
test/testdata/platform/services/prod/ephemeral-data-index/kustomization.yaml
rename to
test/testdata/platform/services/preview/ephemeral-data-index/kustomization.yaml
diff --git
a/test/testdata/platform/services/prod/ephemeral-data-index/sonataflow/03-sonataflow_callbackstatetimeouts.sw.yaml
b/test/testdata/platform/services/preview/ephemeral-data-index/sonataflow/03-sonataflow_callbackstatetimeouts.sw.yaml
similarity index 100%
rename from
test/testdata/platform/services/prod/ephemeral-data-index/sonataflow/03-sonataflow_callbackstatetimeouts.sw.yaml
rename to
test/testdata/platform/services/preview/ephemeral-data-index/sonataflow/03-sonataflow_callbackstatetimeouts.sw.yaml
diff --git
a/test/testdata/platform/services/prod/ephemeral-job-service/02-sonataflow_platform.yaml
b/test/testdata/platform/services/preview/ephemeral-job-service/02-sonataflow_platform.yaml
similarity index 100%
rename from
test/testdata/platform/services/prod/ephemeral-job-service/02-sonataflow_platform.yaml
rename to
test/testdata/platform/services/preview/ephemeral-job-service/02-sonataflow_platform.yaml
diff --git
a/test/testdata/platform/services/prod/ephemeral-job-service/kustomization.yaml
b/test/testdata/platform/services/preview/ephemeral-job-service/kustomization.yaml
similarity index 100%
rename from
test/testdata/platform/services/prod/ephemeral-job-service/kustomization.yaml
rename to
test/testdata/platform/services/preview/ephemeral-job-service/kustomization.yaml
diff --git
a/test/testdata/platform/services/prod/ephemeral-job-service/sonataflow/03-sonataflow_callbackstatetimeouts.sw.yaml
b/test/testdata/platform/services/preview/ephemeral-job-service/sonataflow/03-sonataflow_callbackstatetimeouts.sw.yaml
similarity index 100%
rename from
test/testdata/platform/services/prod/ephemeral-job-service/sonataflow/03-sonataflow_callbackstatetimeouts.sw.yaml
rename to
test/testdata/platform/services/preview/ephemeral-job-service/sonataflow/03-sonataflow_callbackstatetimeouts.sw.yaml
diff --git
a/test/testdata/platform/services/prod/ephemeral-with-workflow/02-sonataflow_platform.yaml
b/test/testdata/platform/services/preview/ephemeral-with-workflow/02-sonataflow_platform.yaml
similarity index 100%
rename from
test/testdata/platform/services/prod/ephemeral-with-workflow/02-sonataflow_platform.yaml
rename to
test/testdata/platform/services/preview/ephemeral-with-workflow/02-sonataflow_platform.yaml
diff --git
a/test/testdata/platform/services/prod/ephemeral-with-workflow/kustomization.yaml
b/test/testdata/platform/services/preview/ephemeral-with-workflow/kustomization.yaml
similarity index 100%
rename from
test/testdata/platform/services/prod/ephemeral-with-workflow/kustomization.yaml
rename to
test/testdata/platform/services/preview/ephemeral-with-workflow/kustomization.yaml
diff --git
a/test/testdata/platform/services/prod/ephemeral-with-workflow/sonataflow/03-sonataflow_callbackstatetimeouts.sw.yaml
b/test/testdata/platform/services/preview/ephemeral-with-workflow/sonataflow/03-sonataflow_callbackstatetimeouts.sw.yaml
similarity index 100%
rename from
test/testdata/platform/services/prod/ephemeral-with-workflow/sonataflow/03-sonataflow_callbackstatetimeouts.sw.yaml
rename to
test/testdata/platform/services/preview/ephemeral-with-workflow/sonataflow/03-sonataflow_callbackstatetimeouts.sw.yaml
diff --git
a/test/testdata/platform/services/prod/ephemeral/02-sonataflow_platform.yaml
b/test/testdata/platform/services/preview/ephemeral/02-sonataflow_platform.yaml
similarity index 100%
rename from
test/testdata/platform/services/prod/ephemeral/02-sonataflow_platform.yaml
rename to
test/testdata/platform/services/preview/ephemeral/02-sonataflow_platform.yaml
diff --git a/test/testdata/platform/services/prod/ephemeral/kustomization.yaml
b/test/testdata/platform/services/preview/ephemeral/kustomization.yaml
similarity index 100%
rename from test/testdata/platform/services/prod/ephemeral/kustomization.yaml
rename to test/testdata/platform/services/preview/ephemeral/kustomization.yaml
diff --git
a/test/testdata/platform/noservices/prod/ephemeral/sonataflow/03-sonataflow_callbackstatetimeouts.sw.yaml
b/test/testdata/platform/services/preview/ephemeral/sonataflow/03-sonataflow_callbackstatetimeouts.sw.yaml
similarity index 98%
rename from
test/testdata/platform/noservices/prod/ephemeral/sonataflow/03-sonataflow_callbackstatetimeouts.sw.yaml
rename to
test/testdata/platform/services/preview/ephemeral/sonataflow/03-sonataflow_callbackstatetimeouts.sw.yaml
index 249ee2c1..a76ac23f 100644
---
a/test/testdata/platform/noservices/prod/ephemeral/sonataflow/03-sonataflow_callbackstatetimeouts.sw.yaml
+++
b/test/testdata/platform/services/preview/ephemeral/sonataflow/03-sonataflow_callbackstatetimeouts.sw.yaml
@@ -19,7 +19,7 @@ metadata:
annotations:
sonataflow.org/description: Callback State Timeouts Example k8s
sonataflow.org/version: 0.0.1
- sonataflow.org/profile: prod
+ sonataflow.org/profile: preview
spec:
flow:
start: PrintStartMessage
diff --git a/test/testdata/platform/services/prod/postgreSQL/01-postgres.yaml
b/test/testdata/platform/services/preview/postgreSQL/01-postgres.yaml
similarity index 100%
rename from test/testdata/platform/services/prod/postgreSQL/01-postgres.yaml
rename to test/testdata/platform/services/preview/postgreSQL/01-postgres.yaml
diff --git
a/test/testdata/platform/services/prod/postgreSQL/02-sonataflow_platform.yaml
b/test/testdata/platform/services/preview/postgreSQL/02-sonataflow_platform.yaml
similarity index 100%
rename from
test/testdata/platform/services/prod/postgreSQL/02-sonataflow_platform.yaml
rename to
test/testdata/platform/services/preview/postgreSQL/02-sonataflow_platform.yaml
diff --git a/test/testdata/platform/services/prod/postgreSQL/kustomization.yaml
b/test/testdata/platform/services/preview/postgreSQL/kustomization.yaml
similarity index 100%
rename from test/testdata/platform/services/prod/postgreSQL/kustomization.yaml
rename to test/testdata/platform/services/preview/postgreSQL/kustomization.yaml
diff --git
a/test/testdata/platform/services/prod/postgreSQL/sonataflow/04-sonataflow_callbackstatetimeouts.sw.yaml
b/test/testdata/platform/services/preview/postgreSQL/sonataflow/04-sonataflow_callbackstatetimeouts.sw.yaml
similarity index 98%
rename from
test/testdata/platform/services/prod/postgreSQL/sonataflow/04-sonataflow_callbackstatetimeouts.sw.yaml
rename to
test/testdata/platform/services/preview/postgreSQL/sonataflow/04-sonataflow_callbackstatetimeouts.sw.yaml
index 249ee2c1..a76ac23f 100644
---
a/test/testdata/platform/services/prod/postgreSQL/sonataflow/04-sonataflow_callbackstatetimeouts.sw.yaml
+++
b/test/testdata/platform/services/preview/postgreSQL/sonataflow/04-sonataflow_callbackstatetimeouts.sw.yaml
@@ -19,7 +19,7 @@ metadata:
annotations:
sonataflow.org/description: Callback State Timeouts Example k8s
sonataflow.org/version: 0.0.1
- sonataflow.org/profile: prod
+ sonataflow.org/profile: preview
spec:
flow:
start: PrintStartMessage
diff --git
a/test/testdata/platform/services/prod/ephemeral/sonataflow/03-sonataflow_callbackstatetimeouts.sw.yaml
b/test/testdata/platform/services/prod/ephemeral/sonataflow/03-sonataflow_callbackstatetimeouts.sw.yaml
deleted file mode 100644
index 249ee2c1..00000000
---
a/test/testdata/platform/services/prod/ephemeral/sonataflow/03-sonataflow_callbackstatetimeouts.sw.yaml
+++ /dev/null
@@ -1,81 +0,0 @@
-# Copyright 2024 Apache Software Foundation (ASF)
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-apiVersion: sonataflow.org/v1alpha08
-kind: SonataFlow
-metadata:
- name: callbackstatetimeouts
- annotations:
- sonataflow.org/description: Callback State Timeouts Example k8s
- sonataflow.org/version: 0.0.1
- sonataflow.org/profile: prod
-spec:
- flow:
- start: PrintStartMessage
- events:
- - name: callbackEvent
- source: ''
- type: callback_event_type
- functions:
- - name: systemOut
- type: custom
- operation: sysout
- states:
- - name: PrintStartMessage
- type: operation
- actions:
- - name: printSystemOut
- functionRef:
- refName: systemOut
- arguments:
- message: "${\"callback-state-timeouts: \" +
$WORKFLOW.instanceId + \" has started.\"}"
- transition: CallbackState
- - name: CallbackState
- type: callback
- action:
- name: callbackAction
- functionRef:
- refName: systemOut
- arguments:
- message: "${\"callback-state-timeouts: \" + $WORKFLOW.instanceId
+ \" has executed the callbackFunction.\"}"
- eventRef: callbackEvent
- transition: CheckEventArrival
- timeouts:
- eventTimeout: PT30S
- - name: CheckEventArrival
- type: switch
- dataConditions:
- - condition: "${ .eventData != null }"
- transition: EventArrived
- defaultCondition:
- transition: EventNotArrived
- - name: EventArrived
- type: inject
- data:
- exitMessage: "The callback event has arrived."
- transition: PrintExitMessage
- - name: EventNotArrived
- type: inject
- data:
- exitMessage: "The callback event has not arrived, and the timeout
has overdue."
- transition: PrintExitMessage
- - name: PrintExitMessage
- type: operation
- actions:
- - name: printSystemOut
- functionRef:
- refName: systemOut
- arguments:
- message: "${\"callback-state-timeouts: \" +
$WORKFLOW.instanceId + \" has finalized. \" + .exitMessage + \" eventData: \" +
.eventData}"
- end: true
diff --git a/test/yaml.go b/test/yaml.go
index 8c3692a6..84ac1b7d 100644
--- a/test/yaml.go
+++ b/test/yaml.go
@@ -195,11 +195,11 @@ func SetDevProfile(workflow *operatorapi.SonataFlow) {
workflow.Annotations["sonataflow.org/profile"] = "dev"
}
-func SetProdProfile(workflow *operatorapi.SonataFlow) {
- workflow.Annotations["sonataflow.org/profile"] = "prod"
+func SetPreviewProfile(workflow *operatorapi.SonataFlow) {
+ workflow.Annotations["sonataflow.org/profile"] = "preview"
}
-func GetBaseSonataFlow(namespace string, options
...*func(*operatorapi.SonataFlow)) *operatorapi.SonataFlow {
+func GetBaseSonataFlow(namespace string) *operatorapi.SonataFlow {
return NewSonataFlow(sonataFlowSampleYamlCR, namespace)
}
@@ -212,7 +212,7 @@ func GetBaseSonataFlowWithDevProfile(namespace string)
*operatorapi.SonataFlow {
}
func GetBaseSonataFlowWithProdProfile(namespace string)
*operatorapi.SonataFlow {
- return NewSonataFlow(sonataFlowSampleYamlCR, namespace, SetProdProfile)
+ return NewSonataFlow(sonataFlowSampleYamlCR, namespace,
SetPreviewProfile)
}
// GetBaseSonataFlowWithProdOpsProfile gets a base workflow that has a
pre-built image set in podTemplate.
@@ -244,10 +244,6 @@ func GetBasePlatformWithDevBaseImageInReadyPhase(namespace
string) *operatorapi.
return platform
}
-func GetBaseClusterPlatform() *operatorapi.SonataFlowClusterPlatform {
- return getSonataFlowClusterPlatform(sonataFlowClusterPlatformYamlCR)
-}
-
func GetBasePlatform() *operatorapi.SonataFlowPlatform {
return getSonataFlowPlatform(sonataFlowPlatformYamlCR)
}
@@ -307,5 +303,9 @@ func getProjectDir() string {
wd = filepath.Dir(wd)
}
projectDir = wd
+ if _, err := os.Lstat(projectDir); err != nil {
+ panic("Failed to read project directory to run tests: " +
err.Error())
+ }
+
return projectDir
}
diff --git a/workflowproj/operator.go b/workflowproj/operator.go
index 0ab6c302..2a5c3e3f 100644
--- a/workflowproj/operator.go
+++ b/workflowproj/operator.go
@@ -75,9 +75,9 @@ func GetWorkflowManagedPropertiesConfigMapName(workflow
*operatorapi.SonataFlow)
// GetManagedPropertiesFileName gets the default ConfigMap name that holds the
managed application property for the given workflow
func GetManagedPropertiesFileName(workflow *operatorapi.SonataFlow) string {
- profile := metadata.ProdProfile
+ profile := metadata.QuarkusProdProfile
if IsDevProfile(workflow) {
- profile = metadata.DevProfile
+ profile = metadata.QuarkusDevProfile
}
return fmt.Sprintf("application-%s.properties", profile)
}
diff --git a/workflowproj/workflowproj_test.go
b/workflowproj/workflowproj_test.go
index 647710e2..9d3cab67 100644
--- a/workflowproj/workflowproj_test.go
+++ b/workflowproj/workflowproj_test.go
@@ -55,7 +55,7 @@ func Test_Handler_WorkflowMinimalInvalid(t *testing.T) {
func Test_Handler_WorkflowMinimalAndProps(t *testing.T) {
proj, err := New("default").
Named("minimal").
- Profile(metadata.ProdProfile).
+ Profile(metadata.PreviewProfile).
WithWorkflow(getWorkflowMinimal()).
WithAppProperties(getWorkflowProperties()).
AsObjects()
@@ -65,7 +65,7 @@ func Test_Handler_WorkflowMinimalAndProps(t *testing.T) {
assert.Equal(t, "minimal", proj.Workflow.Name)
assert.Equal(t, "minimal-props", proj.Properties.Name)
assert.NotEmpty(t, proj.Properties.Data["application.properties"])
- assert.Equal(t, string(metadata.ProdProfile),
proj.Workflow.Annotations[metadata.Profile])
+ assert.Equal(t, string(metadata.PreviewProfile),
proj.Workflow.Annotations[metadata.Profile])
assert.NotEmpty(t, proj.Properties.Data)
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]