diff --git a/pkg/version_config_manager/version_config_manager.go b/pkg/version_config_manager/version_config_manager.go index 16b8698d266d9..e162215cfa06c 100644 --- a/pkg/version_config_manager/version_config_manager.go +++ b/pkg/version_config_manager/version_config_manager.go @@ -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 @@ -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 } diff --git a/reposerver/repository/app_version.go b/reposerver/repository/app_version.go index eddbe509a3889..c1b70665d703c 100644 --- a/reposerver/repository/app_version.go +++ b/reposerver/repository/app_version.go @@ -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 != "" {