Skip to content

Commit

Permalink
kogito-serverless-operator-356: Sonataflow platform managed services …
Browse files Browse the repository at this point in the history
…produce wrong selector

    - Adjust the services selector
    - Temporary use of the nightly images
  • Loading branch information
wmedvede committed Jan 11, 2024
1 parent ca5a493 commit c58dc12
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
6 changes: 3 additions & 3 deletions controllers/platform/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func createDeployment(ctx context.Context, client client.Client, platform *opera

replicas := ps.GetReplicaCount()
lbl := map[string]string{
workflowproj.LabelApp: platform.Name,
workflowproj.LabelApp: ps.GetServiceName(),
}
dataDeploySpec := appsv1.DeploymentSpec{
Selector: &metav1.LabelSelector{
Expand Down Expand Up @@ -196,7 +196,7 @@ func createDeployment(ctx context.Context, client client.Client, platform *opera

func createService(ctx context.Context, client client.Client, platform *operatorapi.SonataFlowPlatform, ps services.Platform) error {
lbl := map[string]string{
workflowproj.LabelApp: platform.Name,
workflowproj.LabelApp: ps.GetServiceName(),
}
dataSvcSpec := corev1.ServiceSpec{
Ports: []corev1.ServicePort{
Expand Down Expand Up @@ -243,7 +243,7 @@ func createConfigMap(ctx context.Context, client client.Client, platform *operat
Name: ps.GetServiceCmName(),
Namespace: platform.Namespace,
Labels: map[string]string{
workflowproj.LabelApp: platform.Name,
workflowproj.LabelApp: ps.GetServiceName(),
},
},
Data: map[string]string{
Expand Down
10 changes: 8 additions & 2 deletions controllers/platform/services/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,14 @@ func (d DataIndex) GetContainerName() string {

func (d DataIndex) GetServiceImageName(persistenceName string) string {
var tag = version.GetMajorMinor()
var suffix = ""
if version.IsSnapshot() {
tag = "latest"
//TODO, remove
suffix = constants.ImageNameNightlySuffix
}
// returns "quay.io/kiegroup/kogito-data-index-<persistence_layer>:<tag>"
return fmt.Sprintf("%s-%s-%s:%s", constants.ImageNamePrefix, constants.DataIndexName, persistenceName, tag)
return fmt.Sprintf("%s-%s-%s:%s", constants.ImageNamePrefix, constants.DataIndexName, persistenceName+suffix, tag)
}

func (d DataIndex) GetServiceName() string {
Expand Down Expand Up @@ -250,11 +253,14 @@ func (j JobService) GetContainerName() string {

func (j JobService) GetServiceImageName(persistenceName string) string {
var tag = version.GetMajorMinor()
var suffix = ""
if version.IsSnapshot() {
tag = "latest"
//TODO remove
suffix = constants.ImageNameNightlySuffix
}
// returns "quay.io/kiegroup/kogito-jobs-service-<persistece_layer>:<tag>"
return fmt.Sprintf("%s-%s-%s:%s", constants.ImageNamePrefix, constants.JobServiceName, persistenceName, tag)
return fmt.Sprintf("%s-%s-%s:%s", constants.ImageNamePrefix, constants.JobServiceName, persistenceName+suffix, tag)
}

func (j JobService) GetServiceName() string {
Expand Down
6 changes: 5 additions & 1 deletion controllers/profiles/common/constants/platform_services.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ const (
DataIndexServiceName = "data-index-service"
JobServiceName = "jobs-service"
ImageNamePrefix = "quay.io/kiegroup/kogito"
DataIndexName = "data-index"
//TODO, the usage of this constant was temporary introduced since only the nightly images are being updated for the
//data-index and jobs-service. And this is causing issues at the time of using the workflows integrated with these, etc.
//This will be removed when the CI is fixed.
ImageNameNightlySuffix = "-nightly"
DataIndexName = "data-index"

DefaultDatabaseName string = "sonataflow"
DefaultPostgreSQLPort int = 5432
Expand Down

0 comments on commit c58dc12

Please sign in to comment.