Skip to content

Commit

Permalink
Merge pull request #55 from onmete/add-ols-user-agent
Browse files Browse the repository at this point in the history
add openshift lightspeed operator prefix
  • Loading branch information
petracihalova committed Apr 15, 2024
2 parents 4c6d6c1 + 6a3d53b commit d599035
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,17 @@ var (
)

const (
insightsOperatorPrefix = `insights-operator/`
costMgmtOperatorPrefix = `cost-mgmt-operator/`
marketplaceOperatorPrefix = `marketplace-operator/`
acmOperator = `acm-operator/`
assistedInstallerOperatorPrefix = `assisted-installer-operator/`
cryostatOperatorPrefix = `cryostat-operator/`
insightsOperatorPrefix = `insights-operator/`
costMgmtOperatorPrefix = `cost-mgmt-operator/`
marketplaceOperatorPrefix = `marketplace-operator/`
acmOperator = `acm-operator/`
assistedInstallerOperatorPrefix = `assisted-installer-operator/`
cryostatOperatorPrefix = `cryostat-operator/`
openshiftLightspeedOperatorPrefix = `openshift-lightspeed-operator/`
)

var (
operatorPrefixes = [6]string{insightsOperatorPrefix, costMgmtOperatorPrefix, marketplaceOperatorPrefix, acmOperator, assistedInstallerOperatorPrefix, cryostatOperatorPrefix}
operatorPrefixes = [7]string{insightsOperatorPrefix, costMgmtOperatorPrefix, marketplaceOperatorPrefix, acmOperator, assistedInstallerOperatorPrefix, cryostatOperatorPrefix, openshiftLightspeedOperatorPrefix}
)

// returns the cluster id from the user agent string used by the support operator
Expand Down
2 changes: 1 addition & 1 deletion server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ var _ = Describe("Handler", func() {
})

Describe("When called with a valid request", func() {
validOperatorAgents := []string{"insights-operator", "cost-mgmt-operator", "marketplace-operator", "acm-operator", "assisted-installer-operator", "cryostat-operator"}
validOperatorAgents := []string{"insights-operator", "cost-mgmt-operator", "marketplace-operator", "acm-operator", "assisted-installer-operator", "cryostat-operator", "openshift-lightspeed-operator"}
for _, a := range validOperatorAgents {
It(fmt.Sprintf("should return a valid Identity json for %s", a), func() {
_, ident := call(wrapper, fmt.Sprintf("%s/abc cluster/123", a), "Bearer mytoken")
Expand Down

0 comments on commit d599035

Please sign in to comment.