I have a Spring project to which I have made two very basic changes:
logger.info("testing changes made");
return new ResponseEntity<>(HttpStatus.NO_CONTENT); //previously HttpStatus.OK
I then:
- git committed the changes (not really necessary)
mvn clean install -P docker-build-image
docker tag my-service:old-tag my-service:new-tag
I then used this image to install the service in a kubernetes pod as follows:
echo "🟢 deploying auth service"
helm uninstall auth
kubectl delete pod -l app.kubernetes.io/name=auth
kind load docker-image my-service:new-tag
helm install auth ./auth --wait
The trouble is: I am never getting any changes. I only see the output from the old version of the application.
What is going on here? This is very strange to me. This feels very much like a maven|docker plugin kind of problem. Or, is it a kubernetes|kind|helm problem?
2
Answers
The problem I was experiencing resulted from the docker-building module was using an old snapshot to build the docker image. The wrong dependency was being used in the POM file of that module. I changed the dependency and everything worked just fine.
mvn install will just install the package.
You should do mvn package before install to make new jar file.