Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions charts/cf-common-test/tests/deployment/container_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -247,3 +247,19 @@ tests:
- equal:
path: spec.template.spec.containers[0].image
value: gcr.io/codefresh-enterprise/codefresh/cf-api:latest

# For backward compatibility (onprem with private docker registry)
- it: Test main container with private docker registry prefix defined in global and local
values:
- values.yaml
set:
global:
privateRegistry: true
dockerRegistry: myregistry.io/
image: codefresh/cf-api
dockerRegistry: gcr.io/codefresh-enterprise/
imageTag: latest
asserts:
- equal:
path: spec.template.spec.containers[0].image
value: myregistry.io/codefresh/cf-api:latest
2 changes: 1 addition & 1 deletion charts/cf-common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
appVersion: v0.0.0
description: Codefresh library chart
name: cf-common
version: 0.0.6
version: 0.0.7
type: library
keywords:
- codefresh
Expand Down
4 changes: 2 additions & 2 deletions charts/cf-common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Codefresh library chart

![Version: 0.0.6](https://img.shields.io/badge/Version-0.0.6-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) ![AppVersion: v0.0.0](https://img.shields.io/badge/AppVersion-v0.0.0-informational?style=flat-square)
![Version: 0.0.7](https://img.shields.io/badge/Version-0.0.7-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) ![AppVersion: v0.0.0](https://img.shields.io/badge/AppVersion-v0.0.0-informational?style=flat-square)

## Installing the Chart

Expand All @@ -18,7 +18,7 @@ Include this chart as a dependency in your `Chart.yaml` e.g.
# Chart.yaml
dependencies:
- name: cf-common
version: 0.0.6
version: 0.0.7
repository: https://chartmuseum.codefresh.io/cf-common
```

Expand Down
18 changes: 9 additions & 9 deletions charts/cf-common/templates/container/_image.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@ Usage:
{{- end -}}
{{- end -}}

{{- /*
For backward compatibility (onprem with private docker registry)
*/}}
{{- if $.Values.global -}}
{{- if and $.Values.global.privateRegistry $.Values.global.dockerRegistry -}}
{{ $registryName = $.Values.global.dockerRegistry | trimSuffix "/" }}
{{- end -}}
{{- end -}}

{{- /*
For backward compatibility with legacy var struct
e.g.:
Expand All @@ -46,6 +37,15 @@ cf-api:
{{- $imageTag = $.Values.imageTag | toString -}}
{{- end -}}

{{- /*
For backward compatibility (onprem with private docker registry)
*/}}
{{- if $.Values.global -}}
{{- if and $.Values.global.privateRegistry $.Values.global.dockerRegistry -}}
{{ $registryName = $.Values.global.dockerRegistry | trimSuffix "/" }}
{{- end -}}
{{- end -}}

{{- printf "%s/%s:%s" $registryName $repositoryName $imageTag -}}

{{- end -}}
Expand Down