Skip to content

Commit

Permalink
🐛 dotnet provider should have cmd package var (#289)
Browse files Browse the repository at this point in the history
Signed-off-by: David Zager <[email protected]>
  • Loading branch information
djzager authored Jul 26, 2024
1 parent 64a56d2 commit c93c6cc
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
37 changes: 26 additions & 11 deletions cmd/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,33 @@ func (c *Config) loadCommandName() error {

func (c *Config) loadProviders() error {
// if version tag is given in image
javaImg := strings.TrimSuffix(JavaProviderImage, fmt.Sprintf(":%v", Version))
updatedJavaImg := fmt.Sprintf("%v:%v", javaImg, Version)
err := os.Setenv("JAVA_PROVIDER_IMG", updatedJavaImg)
if err != nil {
return err
if os.Getenv("JAVA_PROVIDER_IMG") == "" {
javaImg := strings.TrimSuffix(JavaProviderImage, fmt.Sprintf(":%v", Version))
updatedJavaImg := fmt.Sprintf("%v:%v", javaImg, Version)
err := os.Setenv("JAVA_PROVIDER_IMG", updatedJavaImg)
if err != nil {
return err
}
}
// if version tag is given in image
genericImg := strings.TrimSuffix(GenericProviderImage, fmt.Sprintf(":%v", Version))
updatedGenericImg := fmt.Sprintf("%v:%v", genericImg, Version)
err = os.Setenv("GENERIC_PROVIDER_IMG", updatedGenericImg)
if err != nil {
return err

if os.Getenv("GENERIC_PROVIDER_IMG") == "" {
// if version tag is given in image
genericImg := strings.TrimSuffix(GenericProviderImage, fmt.Sprintf(":%v", Version))
updatedGenericImg := fmt.Sprintf("%v:%v", genericImg, Version)
err := os.Setenv("GENERIC_PROVIDER_IMG", updatedGenericImg)
if err != nil {
return err
}
}

if os.Getenv("DOTNET_PROVIDER_IMG") == "" {
// if version tag is given in image
dotnetImg := strings.TrimSuffix(DotnetProviderImage, fmt.Sprintf(":%v", Version))
updatedDotnetImg := fmt.Sprintf("%v:%v", dotnetImg, Version)
err := os.Setenv("DOTNET_PROVIDER_IMG", updatedDotnetImg)
if err != nil {
return err
}
}

return nil
Expand Down
1 change: 1 addition & 0 deletions cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var (
JavaBundlesLocation = "/jdtls/java-analyzer-bundle/java-analyzer-bundle.core/target/java-analyzer-bundle.core-1.0.0-SNAPSHOT.jar"
JavaProviderImage = "quay.io/konveyor/java-external-provider"
GenericProviderImage = "quay.io/konveyor/generic-external-provider"
DotnetProviderImage = "quay.io/konveyor/dotnet-external-provider"
)

// Use build flags to set correct Version and BuildCommit
Expand Down

0 comments on commit c93c6cc

Please sign in to comment.