Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Commit 65b168f

Browse files
author
Corneil du Plessis
authored
Ensure that Carvel deployment uses default image tags from values file when provided. (#5699)
1 parent b9745d0 commit 65b168f

File tree

5 files changed

+69
-14
lines changed

5 files changed

+69
-14
lines changed

spring-cloud-dataflow-docs/src/main/asciidoc/configuration-carvel.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ Where:
116116
* `scdf-type` One of oss or pro. oss is the default.
117117
* `release|snapshot` and `scdf-type` will determine the value of `PACKAGE_VERSION`.
118118

119+
_*The best option to ensure using the type and version of package intended is to modify `deploy/versions.yaml`*_
119120

120121
The environmental variables can also be configured manually to override the values.
121122

@@ -131,6 +132,10 @@ The environmental variables can also be configured manually to override the valu
131132
|Version of Spring Cloud Data Flow
132133
|2.11.2
133134

135+
|DATAFLOW_PRO_VERSION
136+
|Version of Spring Cloud Data Flow Pro
137+
|1.6.1
138+
134139
|SKIPPER_VERSION
135140
|Version of Spring Cloud Skipper
136141
|2.11.2
@@ -157,6 +162,8 @@ The environmental variables can also be configured manually to override the valu
157162

158163
|===
159164

165+
NOTE: The above environmental variables should only be provided if different from the default in `deploy/versions.yaml`
166+
160167
==== Prepare Configuration file
161168

162169
Create a file name `scdf-values.yml` by executing:

src/deploy/carvel/deploy-scdf.sh

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,53 @@ if [ "$1" != "" ]; then
5252
APP_NAME="$1"
5353
fi
5454
echo "Deploying scdf-$SCDF_TYPE $PACKAGE_NAME:$PACKAGE_VERSION as $APP_NAME"
55+
SERVER_TAG=$(yq '.scdf.server.image.tag' ./scdf-values.yml)
5556
if [ "$DATAFLOW_VERSION" != "" ]; then
56-
yq ".scdf.server.image.tag=\"$DATAFLOW_VERSION\"" -i ./scdf-values.yml
57-
yq ".scdf.ctr.image.tag=\"$DATAFLOW_VERSION\"" -i ./scdf-values.yml
58-
echo "Overriding Data Flow version=$DATAFLOW_VERSION"
57+
if [ "$SCDF_TYPE" == "oss" ]; then
58+
if [ "$SERVER_TAG" == "null" ] || [ "$SERVER_TAG" == "" ]; then
59+
yq ".scdf.server.image.tag=\"$DATAFLOW_VERSION\"" -i ./scdf-values.yml
60+
echo "Overriding Data Flow version=$DATAFLOW_VERSION"
61+
else
62+
echo "Using Data Flow version=$SERVER_TAG"
63+
fi
64+
fi
65+
CTR_TAG=$(yq '.scdf.ctr.image.tag' ./scdf-values.yml)
66+
if [ "$CTR_TAG" == "null" ] || [ "$CTR_TAG" == "" ]; then
67+
yq ".scdf.ctr.image.tag=\"$DATAFLOW_VERSION\"" -i ./scdf-values.yml
68+
echo "Overriding Composed Task Runner version=$DATAFLOW_VERSION"
69+
else
70+
echo "Using Composed Task Runner version=$CTR_TAG"
71+
fi
72+
else
73+
if [ "$SCDF_TYPE" == "oss" ] && [ "$SERVER_TAG" != "null" ] && [ "$SERVER_TAG" != "" ]; then
74+
echo "Using Data Flow version=$SERVER_TAG"
75+
fi
76+
fi
77+
SERVER_TAG=$(yq '.scdf.server.image.tag' ./scdf-values.yml)
78+
if [ "$DATAFLOW_PRO_VERSION" != "" ] && [ "$SCDF_TYPE" == "pro" ]; then
79+
if [ "$SERVER_TAG" == "null" ] || [ "$SERVER_TAG" == "" ]; then
80+
yq ".scdf.server.image.tag=\"$DATAFLOW_PRO_VERSION\"" -i ./scdf-values.yml
81+
echo "Overriding Data Flow Pro version=$DATAFLOW_PRO_VERSION"
82+
else
83+
echo "Using Data Flow Pro version=$SERVER_TAG"
84+
fi
85+
else
86+
if [ "$SERVER_TAG" != "null" ] && [ "$SERVER_TAG" != "" ]; then
87+
echo "Using Data Flow Pro version=$SERVER_TAG"
88+
fi
5989
fi
90+
SKIPPER_TAG=$(yq '.scdf.skipper.image.tag' ./scdf-values.yml)
6091
if [ "$SKIPPER_VERSION" != "" ]; then
61-
yq ".scdf.skipper.image.tag=\"$SKIPPER_VERSION\"" -i ./scdf-values.yml
62-
echo "Overriding Skipper version=$SKIPPER_VERSION"
92+
if [ "$SKIPPER_TAG" == "null" ] || [ "$SKIPPER_TAG" == "" ]; then
93+
yq ".scdf.skipper.image.tag=\"$SKIPPER_VERSION\"" -i ./scdf-values.yml
94+
echo "Overriding Skipper version=$SKIPPER_VERSION"
95+
else
96+
echo "Using Skipper version=$SKIPPER_TAG"
97+
fi
98+
else
99+
if [ "$SKIPPER_TAG" != "null" ] && [ "$SKIPPER_TAG" != "" ]; then
100+
echo "Using Skipper version=$SKIPPER_TAG"
101+
fi
63102
fi
64103

65104
"$SCDIR/carvel-import-secret.sh" "scdfmetadata" "$NS"

src/deploy/carvel/scdf-oss-values.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ scdf:
22
binder:
33
type: rabbit
44
server:
5+
# image: # uncomment to use a different tag
6+
# tag: 2.11.2
57
service:
68
type: LoadBalancer
79
env:
@@ -11,6 +13,12 @@ scdf:
1113
value: "true"
1214
- name: SPRING_CLOUD_DATAFLOW_FEATURES_SCHEDULES_ENABLED
1315
value: "true"
16+
# skipper:
17+
# image: # uncomment to use a different tag
18+
# tag: 2.11.2
19+
# ctr:
20+
# image: # uncomment to use a different tag
21+
# tag: 2.11.2
1422
registry:
1523
secret:
1624
ref: "reg-creds-dockerhub"

src/deploy/carvel/scdf-pro-values.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ scdf:
22
binder:
33
type: rabbit
44
server:
5-
image:
6-
repository: dev.registry.tanzu.vmware.com/p-scdf-for-kubernetes/scdf-pro-server
7-
tag: 1.6.0
5+
# image: # uncomment to use a different tag
6+
# tag: 1.6.1
87
service:
98
type: LoadBalancer
109
env:
@@ -14,10 +13,12 @@ scdf:
1413
value: "true"
1514
- name: SPRING_CLOUD_DATAFLOW_FEATURES_SCHEDULES_ENABLED
1615
value: "true"
17-
skipper:
18-
image:
19-
repository: springcloud/spring-cloud-skipper-server
20-
tag: 2.11.2
16+
# skipper:
17+
# image: # pro uses a skipper image from registry.tanzu.vmware.com that is tagged with package version
18+
# tag: 1.6.1
19+
# ctr:
20+
# image: # uncomment to use a different tag
21+
# tag: 2.11.2
2122
registry:
2223
secret:
2324
ref: "reg-creds-dev-registry"

src/deploy/versions.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ scdf-type:
1010
maintenance-snapshot: '1.5.4-SNAPSHOT'
1111
default:
1212
scdf-type: 'oss'
13-
version: 'release'
14-
package-version: '2.11.2'
13+
version: 'snapshot'
14+
package-version: '2.11.3-SNAPSHOT'

0 commit comments

Comments
 (0)