-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dynamically create an overlay for the image tag
Avoid editing config/manager/kustomization.yaml to set the image tag. This causes git to consider the workarea to be dirty, so two consecutive deploys from a workarea that has no other changes will result in the second deploy looking for an image with a "-dirty" tag. Instead, from the makefile we create a throw-away, and untracked, overlay that will be used to set the image tag. Signed-off-by: Dean Roehrich <[email protected]>
- Loading branch information
1 parent
1e1fa0c
commit caac2cb
Showing
4 changed files
with
56 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ bin | |
testbin/* | ||
nnf-dm | ||
.version | ||
config/begin/* | ||
|
||
# Test binary, build with `go test -c` | ||
*.test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2023 Hewlett Packard Enterprise Development LP | ||
# Other additional copyright holders may be indicated within. | ||
# | ||
# The entirety of this work is licensed under the Apache License, | ||
# Version 2.0 (the "License"); you may not use this file except | ||
# in compliance with the License. | ||
# | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set -e | ||
|
||
OVERLAY_DIR=$1 | ||
OVERLAY=$2 | ||
IMAGE_TAG_BASE_1=$3 | ||
TAG_1=$4 | ||
IMAGE_TAG_BASE_2=$5 | ||
TAG_2=$6 | ||
|
||
if [[ ! -d $OVERLAY_DIR ]] | ||
then | ||
mkdir "$OVERLAY_DIR" | ||
fi | ||
|
||
cat <<EOF > "$OVERLAY_DIR"/kustomization.yaml | ||
resources: | ||
- ../$OVERLAY | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
images: | ||
- name: $IMAGE_TAG_BASE_1 | ||
newTag: $TAG_1 | ||
- name: $IMAGE_TAG_BASE_2 | ||
newTag: $TAG_2 | ||
EOF | ||
|