-
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
Add support for Hub XMLRPC API container #302
Conversation
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.
We would also need to handle the Hub XML-RPC API container for the kubernetes case. This would surely require changes in the server helm chart.
@@ -97,6 +97,11 @@ var ServerVolumes = append([]types.Volume{ | |||
{Name: "ca-cert", PersistentVolumeClaim: &types.PersistentVolumeClaim{ClaimName: "ca-cert"}}, | |||
}, etcAndPgsqlVolumes[:]...) | |||
|
|||
// HubXmlrpcVolumeMounts represents volumes used by Hub Xmlrpc container. | |||
var HubXmlrpcVolumeMounts = []types.VolumeMount{ | |||
{MountPath: "/etc/pki/trust/anchors", Name: "ca-cert"}, |
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.
How is the SSL key of the Hub XML-RPC API container generated? Does it also need the server key? Just adding this mount looks fishy.
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 together with uyuni-project/uyuni#8710 is for connection from the Hub XML-RPC API container to Peripheral servers.
I am not sure about the SSL key of the Hub XML-RPC API container.
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.
Apparently we never had SSL support for Hub API. Even 4.3 documentation mentions only http to port 2830.
I have rebased it and added a fix for utils.Errorf. Now the PR should be complete, except for kubernetes support. |
mgradm/cmd/install/podman/utils.go
Outdated
@@ -47,6 +47,29 @@ func setupCocoContainer(flags *podmanInstallFlags) error { | |||
return nil | |||
} | |||
|
|||
func setupHubXmlrpcContainer(flags *podmanInstallFlags) error { | |||
if flags.HubXmlrpc.Enable { | |||
log.Info().Msg(L("Enabling Hub XMLRPC API container.")) |
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.
log.Info().Msg(L("Enabling Hub XMLRPC API container.")) | |
log.Info().Msg(L("Enabling Hub XML-RPC API container.")) |
mgradm/shared/podman/podman.go
Outdated
Image: image, | ||
} | ||
if err := utils.WriteTemplateToFile(hubXmlrpcData, podman.GetServicePath(podman.HubXmlrpcService), 0555, false); err != nil { | ||
return fmt.Errorf(L("failed to generate systemd service unit file: %s"), err) |
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.
return fmt.Errorf(L("failed to generate systemd service unit file: %s"), err) | |
return utils.Errorf(err, L("failed to generate systemd service unit file")) |
mgradm/shared/podman/podman.go
Outdated
environment := fmt.Sprintf(`Environment=UYUNI_IMAGE=%s | ||
`, image) | ||
if err := podman.GenerateSystemdConfFile(podman.HubXmlrpcService, "Service", environment); err != nil { | ||
return fmt.Errorf(L("cannot generate systemd conf file: %s"), err) |
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.
return fmt.Errorf(L("cannot generate systemd conf file: %s"), err) | |
return utils.Errorf(err, L("cannot generate systemd configuration file")) |
Co-authored-by: Cedric Bosdonnat <[email protected]>
What does this PR change?
This PR add support for Hub XMLRPC API container.
It creates the systemd service on install and handles it on start, stop, restart,status and uninstall commands.
It includes also a bugfix - restart of postgres after installing new certificate - this is needed for reportdb access from hub.
The service depends on uyuni-project/uyuni#8710
Test coverage
No tests: add explanation
DONE
Links
#292
uyuni-project/uyuni#8710
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!