Skip to content

Commit

Permalink
Migrate existing configs to use new registry and drop keyval prefix (#…
Browse files Browse the repository at this point in the history
…2468)

If using the default (empty/docker.io) prefix from previous versions,
update it to `registry.odigos.io` and drop `keyval/` prefix from stored
image names
  • Loading branch information
damemi authored Feb 18, 2025
1 parent d927f68 commit f78ed58
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cli/cmd/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package cmd
import (
"fmt"
"os"
"strings"

"github.com/hashicorp/go-version"
"github.com/odigos-io/odigos/api/k8sconsts"
Expand Down Expand Up @@ -109,6 +110,14 @@ and apply any required migrations and adaptations.`,
config.UiMode = common.UiMode(uiMode)
}

// Migrate images from prior to registry.odigos.io
if config.ImagePrefix == "" {
config.ImagePrefix = "registry.odigos.io"
config.AutoscalerImage = strings.TrimPrefix(config.AutoscalerImage, "keyval/")
config.InstrumentorImage = strings.TrimPrefix(config.InstrumentorImage, "keyval/")
config.OdigletImage = strings.TrimPrefix(config.OdigletImage, "keyval/")
}

currentTier, err := odigospro.GetCurrentOdigosTier(ctx, client, ns)
if err != nil {
fmt.Println("Odigos cloud login failed - unable to read the current Odigos tier.")
Expand Down

0 comments on commit f78ed58

Please sign in to comment.