-
Notifications
You must be signed in to change notification settings - Fork 18
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
Improved Hub XML-RPC support #357
base: main
Are you sure you want to change the base?
Conversation
6aeba80
to
8dbb800
Compare
dummyMigration := types.ImageFlags{} | ||
dummyCoco := types.ImageFlags{} | ||
dummyHubXmlrpc := types.ImageFlags{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of having a variable for each flags, could we just have an emptyImageFlags
and use it for all parameters?
mgradm/shared/kubernetes/install.go
Outdated
tag := hubXmlrpcFlags.Tag | ||
if tag == "" { | ||
tag = imageFlags.Tag | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll need to make sure I have this logic wired in the new implementation of ComputeImage
I'm working on
shared/kubernetes/utils.go
Outdated
@@ -373,3 +373,15 @@ func GenerateOverrideDeployment(deployData types.Deployment) (string, error) { | |||
} | |||
return string(ret), nil | |||
} | |||
|
|||
// GetRunningImage returns the image running in the current system. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// GetRunningImage returns the image running in the current system. | |
// GetRunningImage returns the image of containerName for the server running in the current system. |
@@ -0,0 +1 @@ | |||
- Improved Hub XML-RPC support |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Improved Hub XML-RPC support | |
- Handle Hub XML-RPC in migration and kubernetes. |
@@ -40,10 +41,11 @@ func Deploy( | |||
isK3s := clusterInfos.IsK3s() | |||
IsRke2 := clusterInfos.IsRke2() | |||
if !prepare { | |||
tcpPorts, udpPorts := GetPortLists(hubXmlrpcFlags.Replicas > 0, debug) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we want to setup traefik / nginx with hub ports in all cases or not. The problem is that if the user decides to scale the number of replicas of the hub API, then traefik / nginx config is not ready.
cnx := shared.NewConnection("kubectl", "", kubernetes.ServerFilter) | ||
|
||
origHubXmlrpcImage, err := kubernetes.GetRunningImage("hub-xmlrpc-api") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would work for Hub XML-RPC API since we can have at most 1 replica, but I would see a Connection.GetReplicasCount("hub-xmlrpc-api")
. This could also be reused for CoCo containers in the future.
f482336
to
1cdbbad
Compare
35be5dc
to
e31c74a
Compare
stylecheck reports that modules should not have underscore in their names: rename test_utils to fix this. Rule ST1003. Note that mixed caps are not allowed in module names either.
stylecheck reports that modules should not have underscore in their names: rename flags_tests to fix this. Rule ST1003. Note that mixed caps are not allowed in module names either.
Since the testing module provides a TempDir function, use it in our tests. This also removes a number of errcheck errors about unchecked error in defer.
Returning the function cleaning the temporary folder from its creation function factorizes the removal and removes the missing checks for the os.RemoveAll() error.
During a migration to kubernetes the server is deployed after the rsync to prepare the SSL secrets and PVC. This has the nasty effect to corrupt the synchronized data with a too recent catalog version ID. This would let the DB migration to fail starting the old postgresql server. To workaround this, move the data to the the backup place after the rsync instead of the begining of the db upgrade.
After the k8s migration the pod has been started again since the initial connection creation. We need to reset the connection to not search for the old pod name.
Some pods require a long time to run. This is the case for the DB upgrade finalization that runs a potentially long reindex.
Migration deploys the helm chart multiple times. Identifying which revision corresponds to which step in helm history is hard without a description.
What does this PR change?
This PR adds Hub XML-RPC support to podman migrate and upgrade and to all kubernetes commands.
Also, it fixes some kubernetes problems:
This PR depends on uyuni-project/uyuni#8902
Test coverage
No tests: add explanation
No tests: already covered
Unit tests were added
DONE
Links
Issue(s): #292
Changelogs
Make sure the changelogs entries you are adding are compliant with https://github.com/uyuni-project/uyuni/wiki/Contributing#changelogs and https://github.com/uyuni-project/uyuni/wiki/Contributing#uyuni-projectuyuni-repository
If you don't need a changelog check, please mark this checkbox:
If you uncheck the checkbox after the PR is created, you will need to re-run
changelog_test
(see below)Before you merge
Check How to branch and merge properly!