Skip to content

Commit

Permalink
Changed variable name for cfo operator image (opendatahub-io#794)
Browse files Browse the repository at this point in the history
* Changed variable name for cfo operator image

* Fixed golint

* Changed defaultKustomizePath to manager

* changed CodeFlarePath to point to manager

* Changed defaultKustomizePath to default, added Params path
  • Loading branch information
Bobbins228 authored Feb 2, 2024
1 parent 060d899 commit ab35049
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions components/codeflare/codeflare.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ import (

var (
ComponentName = "codeflare"
CodeflarePath = deploy.DefaultManifestPath + "/" + ComponentName + "/manifests"
CodeflarePath = deploy.DefaultManifestPath + "/" + ComponentName + "/default"
CodeflareOperator = "codeflare-operator"
RHCodeflareOperator = "rhods-codeflare-operator"
ParamsPath = deploy.DefaultManifestPath + "/" + ComponentName + "/manager"
)

// Verifies that CodeFlare implements ComponentInterface.
Expand All @@ -42,7 +43,7 @@ func (c *CodeFlare) OverrideManifests(_ string) error {
return err
}
// If overlay is defined, update paths
defaultKustomizePath := "manifests"
defaultKustomizePath := "default"
if manifestConfig.SourcePath != "" {
defaultKustomizePath = manifestConfig.SourcePath
}
Expand All @@ -58,8 +59,8 @@ func (c *CodeFlare) GetComponentName() string {

func (c *CodeFlare) ReconcileComponent(ctx context.Context, cli client.Client, resConf *rest.Config, owner metav1.Object, dscispec *dsciv1.DSCInitializationSpec, _ bool) error {
var imageParamMap = map[string]string{
"odh-codeflare-operator-controller-image": "RELATED_IMAGE_ODH_CODEFLARE_OPERATOR_IMAGE", // no need mcad, embedded in cfo
"namespace": dscispec.ApplicationsNamespace,
"codeflare-operator-controller-image": "RELATED_IMAGE_ODH_CODEFLARE_OPERATOR_IMAGE", // no need mcad, embedded in cfo
"namespace": dscispec.ApplicationsNamespace,
}
enabled := c.GetManagementState() == operatorv1.Managed
monitoringEnabled := dscispec.Monitoring.ManagementState == operatorv1.Managed
Expand Down Expand Up @@ -90,7 +91,7 @@ func (c *CodeFlare) ReconcileComponent(ctx context.Context, cli client.Client, r

// Update image parameters only when we do not have customized manifests set
if (dscispec.DevFlags == nil || dscispec.DevFlags.ManifestsUri == "") && (c.DevFlags == nil || len(c.DevFlags.Manifests) == 0) {
if err := deploy.ApplyParams(CodeflarePath+"/bases", c.SetImageParamsMap(imageParamMap), true); err != nil {
if err := deploy.ApplyParams(ParamsPath, c.SetImageParamsMap(imageParamMap), true); err != nil {
return err
}
}
Expand Down

0 comments on commit ab35049

Please sign in to comment.