cloudapi: change Organization customization to a string
Internally change Organization in the SubscriptionImageOptions to a string instead of an int.
This commit is contained in:
parent
b8ad702ee7
commit
11023cb8a8
6 changed files with 10 additions and 10 deletions
|
|
@ -178,7 +178,7 @@ func (h *apiHandlers) Compose(ctx echo.Context) error {
|
||||||
imageOptions := distro.ImageOptions{Size: imageType.Size(0)}
|
imageOptions := distro.ImageOptions{Size: imageType.Size(0)}
|
||||||
if request.Customizations != nil && request.Customizations.Subscription != nil {
|
if request.Customizations != nil && request.Customizations.Subscription != nil {
|
||||||
imageOptions.Subscription = &distro.SubscriptionImageOptions{
|
imageOptions.Subscription = &distro.SubscriptionImageOptions{
|
||||||
Organization: request.Customizations.Subscription.Organization,
|
Organization: fmt.Sprintf("%d", request.Customizations.Subscription.Organization),
|
||||||
ActivationKey: request.Customizations.Subscription.ActivationKey,
|
ActivationKey: request.Customizations.Subscription.ActivationKey,
|
||||||
ServerUrl: request.Customizations.Subscription.ServerUrl,
|
ServerUrl: request.Customizations.Subscription.ServerUrl,
|
||||||
BaseUrl: request.Customizations.Subscription.BaseUrl,
|
BaseUrl: request.Customizations.Subscription.BaseUrl,
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@ type OSTreeImageOptions struct {
|
||||||
// ServerUrl denotes the host to register the system with
|
// ServerUrl denotes the host to register the system with
|
||||||
// BaseUrl specifies the repository URL for DNF
|
// BaseUrl specifies the repository URL for DNF
|
||||||
type SubscriptionImageOptions struct {
|
type SubscriptionImageOptions struct {
|
||||||
Organization int
|
Organization string
|
||||||
ActivationKey string
|
ActivationKey string
|
||||||
ServerUrl string
|
ServerUrl string
|
||||||
BaseUrl string
|
BaseUrl string
|
||||||
|
|
|
||||||
|
|
@ -397,7 +397,7 @@ func (t *imageType) pipeline(c *blueprint.Customizations, options distro.ImageOp
|
||||||
|
|
||||||
if options.Subscription != nil {
|
if options.Subscription != nil {
|
||||||
commands := []string{
|
commands := []string{
|
||||||
fmt.Sprintf("/usr/sbin/subscription-manager register --org=%d --activationkey=%s --serverurl %s --baseurl %s", options.Subscription.Organization, options.Subscription.ActivationKey, options.Subscription.ServerUrl, options.Subscription.BaseUrl),
|
fmt.Sprintf("/usr/sbin/subscription-manager register --org=%s --activationkey=%s --serverurl %s --baseurl %s", options.Subscription.Organization, options.Subscription.ActivationKey, options.Subscription.ServerUrl, options.Subscription.BaseUrl),
|
||||||
}
|
}
|
||||||
if options.Subscription.Insights {
|
if options.Subscription.Insights {
|
||||||
commands = append(commands, "/usr/bin/insights-client --register")
|
commands = append(commands, "/usr/bin/insights-client --register")
|
||||||
|
|
|
||||||
|
|
@ -459,7 +459,7 @@ func (t *imageType) pipeline(c *blueprint.Customizations, options distro.ImageOp
|
||||||
|
|
||||||
if options.Subscription != nil {
|
if options.Subscription != nil {
|
||||||
commands := []string{
|
commands := []string{
|
||||||
fmt.Sprintf("/usr/sbin/subscription-manager register --org=%d --activationkey=%s --serverurl %s --baseurl %s", options.Subscription.Organization, options.Subscription.ActivationKey, options.Subscription.ServerUrl, options.Subscription.BaseUrl),
|
fmt.Sprintf("/usr/sbin/subscription-manager register --org=%s --activationkey=%s --serverurl %s --baseurl %s", options.Subscription.Organization, options.Subscription.ActivationKey, options.Subscription.ServerUrl, options.Subscription.BaseUrl),
|
||||||
}
|
}
|
||||||
if options.Subscription.Insights {
|
if options.Subscription.Insights {
|
||||||
commands = append(commands, "/usr/bin/insights-client --register")
|
commands = append(commands, "/usr/bin/insights-client --register")
|
||||||
|
|
|
||||||
|
|
@ -335,7 +335,7 @@ func ec2BaseTreePipeline(repos []rpmmd.RepoConfig, packages []rpmmd.PackageSpec,
|
||||||
|
|
||||||
if options.Subscription != nil {
|
if options.Subscription != nil {
|
||||||
commands := []string{
|
commands := []string{
|
||||||
fmt.Sprintf("/usr/sbin/subscription-manager register --org=%d --activationkey=%s --serverurl %s --baseurl %s", options.Subscription.Organization, options.Subscription.ActivationKey, options.Subscription.ServerUrl, options.Subscription.BaseUrl),
|
fmt.Sprintf("/usr/sbin/subscription-manager register --org=%s --activationkey=%s --serverurl %s --baseurl %s", options.Subscription.Organization, options.Subscription.ActivationKey, options.Subscription.ServerUrl, options.Subscription.BaseUrl),
|
||||||
}
|
}
|
||||||
if options.Subscription.Insights {
|
if options.Subscription.Insights {
|
||||||
commands = append(commands, "/usr/bin/insights-client --register")
|
commands = append(commands, "/usr/bin/insights-client --register")
|
||||||
|
|
@ -695,7 +695,7 @@ func osPipeline(repos []rpmmd.RepoConfig, packages []rpmmd.PackageSpec, bpPackag
|
||||||
|
|
||||||
if options.Subscription != nil {
|
if options.Subscription != nil {
|
||||||
commands := []string{
|
commands := []string{
|
||||||
fmt.Sprintf("/usr/sbin/subscription-manager register --org=%d --activationkey=%s --serverurl %s --baseurl %s", options.Subscription.Organization, options.Subscription.ActivationKey, options.Subscription.ServerUrl, options.Subscription.BaseUrl),
|
fmt.Sprintf("/usr/sbin/subscription-manager register --org=%s --activationkey=%s --serverurl %s --baseurl %s", options.Subscription.Organization, options.Subscription.ActivationKey, options.Subscription.ServerUrl, options.Subscription.BaseUrl),
|
||||||
}
|
}
|
||||||
if options.Subscription.Insights {
|
if options.Subscription.Insights {
|
||||||
commands = append(commands, "/usr/bin/insights-client --register")
|
commands = append(commands, "/usr/bin/insights-client --register")
|
||||||
|
|
@ -782,7 +782,7 @@ func ostreeTreePipeline(repos []rpmmd.RepoConfig, packages []rpmmd.PackageSpec,
|
||||||
|
|
||||||
if options.Subscription != nil {
|
if options.Subscription != nil {
|
||||||
commands := []string{
|
commands := []string{
|
||||||
fmt.Sprintf("/usr/sbin/subscription-manager register --org=%d --activationkey=%s --serverurl %s --baseurl %s", options.Subscription.Organization, options.Subscription.ActivationKey, options.Subscription.ServerUrl, options.Subscription.BaseUrl),
|
fmt.Sprintf("/usr/sbin/subscription-manager register --org=%s --activationkey=%s --serverurl %s --baseurl %s", options.Subscription.Organization, options.Subscription.ActivationKey, options.Subscription.ServerUrl, options.Subscription.BaseUrl),
|
||||||
}
|
}
|
||||||
if options.Subscription.Insights {
|
if options.Subscription.Insights {
|
||||||
commands = append(commands, "/usr/bin/insights-client --register")
|
commands = append(commands, "/usr/bin/insights-client --register")
|
||||||
|
|
|
||||||
|
|
@ -329,7 +329,7 @@ func ec2BaseTreePipeline(repos []rpmmd.RepoConfig, packages []rpmmd.PackageSpec,
|
||||||
|
|
||||||
if options.Subscription != nil {
|
if options.Subscription != nil {
|
||||||
commands := []string{
|
commands := []string{
|
||||||
fmt.Sprintf("/usr/sbin/subscription-manager register --org=%d --activationkey=%s --serverurl %s --baseurl %s", options.Subscription.Organization, options.Subscription.ActivationKey, options.Subscription.ServerUrl, options.Subscription.BaseUrl),
|
fmt.Sprintf("/usr/sbin/subscription-manager register --org=%s --activationkey=%s --serverurl %s --baseurl %s", options.Subscription.Organization, options.Subscription.ActivationKey, options.Subscription.ServerUrl, options.Subscription.BaseUrl),
|
||||||
}
|
}
|
||||||
if options.Subscription.Insights {
|
if options.Subscription.Insights {
|
||||||
commands = append(commands, "/usr/bin/insights-client --register")
|
commands = append(commands, "/usr/bin/insights-client --register")
|
||||||
|
|
@ -635,7 +635,7 @@ func osPipeline(repos []rpmmd.RepoConfig, packages []rpmmd.PackageSpec, bpPackag
|
||||||
|
|
||||||
if options.Subscription != nil {
|
if options.Subscription != nil {
|
||||||
commands := []string{
|
commands := []string{
|
||||||
fmt.Sprintf("/usr/sbin/subscription-manager register --org=%d --activationkey=%s --serverurl %s --baseurl %s", options.Subscription.Organization, options.Subscription.ActivationKey, options.Subscription.ServerUrl, options.Subscription.BaseUrl),
|
fmt.Sprintf("/usr/sbin/subscription-manager register --org=%s --activationkey=%s --serverurl %s --baseurl %s", options.Subscription.Organization, options.Subscription.ActivationKey, options.Subscription.ServerUrl, options.Subscription.BaseUrl),
|
||||||
}
|
}
|
||||||
if options.Subscription.Insights {
|
if options.Subscription.Insights {
|
||||||
commands = append(commands, "/usr/bin/insights-client --register")
|
commands = append(commands, "/usr/bin/insights-client --register")
|
||||||
|
|
@ -717,7 +717,7 @@ func ostreeTreePipeline(repos []rpmmd.RepoConfig, packages []rpmmd.PackageSpec,
|
||||||
|
|
||||||
if options.Subscription != nil {
|
if options.Subscription != nil {
|
||||||
commands := []string{
|
commands := []string{
|
||||||
fmt.Sprintf("/usr/sbin/subscription-manager register --org=%d --activationkey=%s --serverurl %s --baseurl %s", options.Subscription.Organization, options.Subscription.ActivationKey, options.Subscription.ServerUrl, options.Subscription.BaseUrl),
|
fmt.Sprintf("/usr/sbin/subscription-manager register --org=%s --activationkey=%s --serverurl %s --baseurl %s", options.Subscription.Organization, options.Subscription.ActivationKey, options.Subscription.ServerUrl, options.Subscription.BaseUrl),
|
||||||
}
|
}
|
||||||
if options.Subscription.Insights {
|
if options.Subscription.Insights {
|
||||||
commands = append(commands, "/usr/bin/insights-client --register")
|
commands = append(commands, "/usr/bin/insights-client --register")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue