Skip to content

Commit 87cc1eb

Browse files
authored
Merge pull request #13 from MbolotSuse/winnowing-fix
Fixing supportconfig winnowing issues
2 parents 20adb1c + dc9b629 commit 87cc1eb

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

pkg/manager/aws.go

+3-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"fmt"
77
"math"
88
"strconv"
9-
"strings"
109
"time"
1110

1211
"github.com/rancher/csp-adapter/pkg/clients/aws"
@@ -43,7 +42,6 @@ const (
4342
tokenKey = "consumptionToken"
4443
nodeKey = "entitledNodes"
4544
expiryKey = "expiry"
46-
awsCSP = "aws"
4745
statusPrefix = "AWS Marketplace Adapter:"
4846
)
4947

@@ -148,8 +146,8 @@ func (m *AWS) runComplianceCheck(ctx context.Context) error {
148146
if currentCheckoutInfo.EntitledLicenses == requiredLicenses {
149147
statusMessage = fmt.Sprintf("%s Rancher server has the required amount of licenses", statusPrefix)
150148
} else {
151-
statusMessage = fmt.Sprintf("%s You have exceeded your licensed node count. At least %d more licens(es) are required in %s to become compliant.",
152-
statusPrefix, requiredLicenses-currentCheckoutInfo.EntitledLicenses, strings.ToUpper(awsCSP))
149+
statusMessage = fmt.Sprintf("%s You have exceeded your licensed node count. At least %d more licens(es) are required in AWS to become compliant.",
150+
statusPrefix, requiredLicenses-currentCheckoutInfo.EntitledLicenses)
153151
}
154152
configMessage := fmt.Sprintf("Rancher server required %d licens(es) and was able to check out %d licens(es)", requiredLicenses, currentCheckoutInfo.EntitledLicenses)
155153

@@ -217,7 +215,7 @@ func (m *AWS) saveCheckoutInfo(info *licenseCheckoutInfo) error {
217215
func (m *AWS) updateAdapterOutput(inCompliance bool, configMessage string, notificationMessage string) error {
218216
config := GetDefaultSupportConfig(m.k8s)
219217
config.CSP = CSPInfo{
220-
Name: awsCSP,
218+
Name: awsSupportConfigCSP,
221219
AcctNumber: m.aws.AccountNumber(),
222220
}
223221
rancherVersion, err := m.k8s.GetRancherVersion()

pkg/manager/types.go

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ const (
2323
StatusInCompliance = "Compliant"
2424
StatusNotInCompliance = "NonCompliant"
2525
defaultPlatform = "x86_64"
26+
// SUSE support config reads EC2 as being for AWS, we want to use the same syntax to be consistent
27+
awsSupportConfigCSP = "EC2"
2628
)
2729

2830
type ComplianceInfo struct {

0 commit comments

Comments
 (0)