Skip to content

Commit

Permalink
CR-24989 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 643186c commit a07212a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pkg/version_config_manager/version_config_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type VersionConfig struct {
}

var DefaultVersionSource = "Chart.yaml"
var DefaultVersionPath = "$.appVersion"

func (v *VersionConfigManager) GetVersionConfig(app *metav1.ObjectMeta) (*VersionConfig, error) {
var appConfig *codefresh.PromotionTemplate
Expand Down Expand Up @@ -59,7 +60,7 @@ func (v *VersionConfigManager) GetVersionConfig(app *metav1.ObjectMeta) (*Versio
// Default value
log.Infof("Used default CfAppConfig for: '%s'", cache.CfAppConfigCacheKey(app.Namespace, app.Name))
return &VersionConfig{
JsonPath: "$.appVersion",
JsonPath: DefaultVersionPath,
ResourceName: DefaultVersionSource,
}, nil
}
Expand Down
4 changes: 2 additions & 2 deletions reposerver/repository/app_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ func readFileContent(result *Result, appPath, fileName, fieldName string) {

func getAppVersions(appPath string, versionConfig *version_config_manager.VersionConfig) (*Result, error) {
// Defaults
resourceName := "Chart.yaml"
jsonPathExpression := "$.appVersion"
resourceName := version_config_manager.DefaultVersionSource
jsonPathExpression := version_config_manager.DefaultVersionPath

if versionConfig != nil {
if versionConfig.ResourceName != "" {
Expand Down

0 comments on commit a07212a

Please sign in to comment.