Skip to content

Commit

Permalink
change error to info when using default version config
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-codefresh committed Oct 8, 2024
1 parent 4e9e300 commit 643186c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pkg/version_config_manager/version_config_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ type VersionConfig struct {
ResourceName string `json:"resourceName"`
}

var DefaultVersionSource = "Chart.yaml"

func (v *VersionConfigManager) GetVersionConfig(app *metav1.ObjectMeta) (*VersionConfig, error) {
var appConfig *codefresh.PromotionTemplate

Expand Down Expand Up @@ -58,7 +60,7 @@ func (v *VersionConfigManager) GetVersionConfig(app *metav1.ObjectMeta) (*Versio
log.Infof("Used default CfAppConfig for: '%s'", cache.CfAppConfigCacheKey(app.Namespace, app.Name))
return &VersionConfig{
JsonPath: "$.appVersion",
ResourceName: "Chart.yaml",
ResourceName: DefaultVersionSource,
}, nil
}

Expand Down
3 changes: 2 additions & 1 deletion reposerver/repository/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -1599,7 +1599,8 @@ func GenerateManifests(ctx context.Context, appPath, repoRoot, revision string,
appVersions, err := getAppVersions(appPath, versionConfig)
if err != nil {
errorMessage := fmt.Sprintf("failed to retrieve application version, app name: %q: %s", q.AppName, err.Error())
if versionConfig.ResourceName == "Chart.yaml" {
if (versionConfig.ResourceName == version_config_manager.DefaultVersionSource) &&
(err.Error() == "unknown key appVersion") {
log.Info(errorMessage)
} else {
log.Error(errorMessage)
Expand Down

0 comments on commit 643186c

Please sign in to comment.