Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FISH-6773 Delete Application Reference on a Deployment Group #6356

Merged

Conversation

aubi
Copy link
Contributor

@aubi aubi commented Aug 4, 2023

Description

So far, deleting application reference was reliably working on instances, but not on a deployment group. When delete-application-ref was used with a deployment group as a target, it removed the reference from DAS, but it didn't undeploy the application from the instance. Consequent create-application-ref failed (because the app was installed, but DAS wasn't aware of it).

This PR fixes behavior of delete-application-ref with target to deployment group, which undeploys the application also from all instances in the deployment group

Testing

Testing Performed

Basically, the idea is to deploy an application, leave it deployed on DAS and make it available/removed from a deployment group. It is possible to call create-application-ref and delete-application-ref repeatedly. Customer wanted to make accessible a new version, therefor the test uses two versions of the same application:

./asadmin create-instance --node=localhost-domain1 i1
./asadmin create-instance --node=localhost-domain1 --config=i1-config i2
./asadmin create-deployment-group dg1
./asadmin add-instance-to-deployment-group --instance=i1 --deploymentGroup=dg1
./asadmin add-instance-to-deployment-group --instance=i2 --deploymentGroup=dg1
#./asadmin start-deployment-group dg1
echo "Starting instances, i1 in debug"
./asadmin start-local-instance --debug i1
./asadmin start-local-instance i2

./asadmin deploy --target dg1 --contextroot clusterjsp clusterjsp.war

./asadmin delete-application-ref --target dg1 clusterjsp
./asadmin deploy --target dg1 --contextroot clusterjsp clusterjsp-1.0.1.war

./asadmin undeploy --target dg1 clusterjsp-1.0.1
echo "-----------------------8<-----Cut here------>8-----------------------"
read -p "Connect DEBUGGER and press Enter to continue..."

echo "These two commands leave something behind, everything works without them:"
echo "going to create-application-ref"
#read -p "press Enter to continue..."
./asadmin create-application-ref --target dg1 clusterjsp
# create-application-ref calls InstanceDeployCommand with command = Command.create_application_ref
echo "going to delete-application-ref"
#read -p "press Enter to continue..."
./asadmin delete-application-ref --target dg1 clusterjsp

echo "./asadmin deploy --target dg1 --contextroot clusterjsp clusterjsp-1.0.1.war"
./asadmin deploy --target dg1 --contextroot clusterjsp clusterjsp-1.0.1.war

Also, the original report mentioned, that instances are marked as "Need to restart" -- this doesn't happen anymore.

Testing Environment

OpenJDK 11, Linux

So far, the application was undeployed only when target was instance.
Newly, it is also undeployed on deployment group.
@aubi
Copy link
Contributor Author

aubi commented Aug 4, 2023

Jenkins test please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants