Closed rvignesh89 closed 2 years ago
@rvignesh89 thanks for creating this issue! Could you provide a short example devspace.yaml
so that we can reproduce this issue?
Updated the issue description.
@rvignesh89 thanks for the update! This works as intended as devspace always prefers the self-built tags configured in images.*.tags
. You can use the following configuration which should work:
version: v1beta10
images:
test-project:
image: test-project-image-name
build:
custom:
command: ./docker-build.sh
dev:
sync:
- containerName: main
labelSelector:
role: app-server
localSubPath: ./src
containerPath: /app/src
replacePods:
- containerName: main
labelSelector:
role: app-server
replaceImage: image(test-project-image-name):latest
patches:
- op: remove
path: spec.containers[0].securityContext
- op: replace
path: spec.containers[0].args
value:
- "sbt"
- "set reStart / mainClass := Some(\"io.rvignesh.test-project\");~reStart"
What happened? In a project devspace configuration which has an image build section and also a
replaceImage
config, if we usedevspace dev
a docker build is performed and the image is tagged with a random value. This value then seems to be stored in.devspace/generated.yaml
like below.The next time if I run
devspace dev --skip-build
the replaced pod uses the image tagYZdjOtm
that was generated from the previous dev run, instead of using thereplaceImage
configuration in the dev section.What did you expect to happen instead? If I use
devspace dev --skip-build
I expect devspace to honor thereplaceImage
in dev.replacePods section.How can we reproduce the bug? (as minimally and precisely as possible)
devspace dev
which should build a new image and use it in the replaced poddevspace reset pods
devspace dev --skip-build
which should use the configuration in thereplaceImage
but instead it's using the tag from the previous build.Local Environment:
Kubernetes Cluster:
Anything else we need to know?
/kind bug