Skip to content

Commit

Permalink
addressing Angie's comment
Browse files Browse the repository at this point in the history
  • Loading branch information
edcdavid committed Oct 3, 2024
1 parent 2be5c0c commit e06e164
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 60 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ IMG ?= $(IMAGE_TAG_BASE):$(VERSION)
ENVTEST_K8S_VERSION = 1.28.0

# HWMGR_PLUGIN_NAMESPACE refers to the namespace of the hardware manager plugin.
HWMGR_PLUGIN_NAMESPACE ?= oran-hwmgr-plugin
HWMGR_PLUGIN_NAMESPACE ?= oran-hwmgr-plugin-test

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down
4 changes: 2 additions & 2 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ generatorOptions:

images:
- name: controller
newName: quay.io/openshift-kni/oran-o2ims-operator
newTag: 4.16.0
newName: quay.io/deliedit/test
newTag: ims38


# This replacement copies the controller image into the `IMAGE` environment variable of the pod,
Expand Down
63 changes: 20 additions & 43 deletions internal/controllers/clusterrequest_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,23 @@ const (
testPolicyTemplateInput = `{
"cpu-isolated": "1-2"
}`
testFullClusterSchemaTemplate = `{
"properties": {
"nodeClusterName": {"type": "string"},
"oCloudSiteId": {"type": "string"},
%s
},
"type": "object",
"required": [
"nodeClusterName",
"oCloudSiteId",
"policyTemplateParameters",
"clusterInstanceParameters"
]
}`
oneVar = `"%s": {}`
twoVars = `"%s": %s,
"%s": %s`
)

func verifyStatusCondition(actualCond, expectedCon metav1.Condition) {
Expand Down Expand Up @@ -545,21 +562,7 @@ var _ = Describe("ClusterRequestReconcile", func() {
},
}
var (
testFullTemplateSchema = fmt.Sprintf(`{
"properties": {
"nodeClusterName": {"type": "string"},
"oCloudSiteId": {"type": "string"},
"%s": %s,
"%s": %s
},
"type": "object",
"required": [
"nodeClusterName",
"oCloudSiteId",
"policyTemplateParameters",
"clusterInstanceParameters"
]
}`, clusterInstanceParametersString, testClusterTemplateSchema,
testFullTemplateSchema = fmt.Sprintf(fmt.Sprintf(testFullClusterSchemaTemplate, twoVars), clusterInstanceParametersString, testClusterTemplateSchema,
policyTemplateParametersString, testPolicyTemplateSchema)
)
// Define the cluster template.
Expand Down Expand Up @@ -1515,19 +1518,7 @@ var _ = Describe("getCrClusterTemplateRef", func() {

It("returns the referred ClusterTemplate if it exists", func() {
var (
testFullTemplateSchema = fmt.Sprintf(`{
"properties": {
"nodeClusterName": {"type": "string"},
"oCloudSiteId": {"type": "string"},
"%s": {}
},
"type": "object",
"required": [
"nodeClusterName",
"oCloudSiteId",
"policyTemplateParameters",
"clusterInstanceParameters"
]}`, clusterInstanceParametersString)
testFullTemplateSchema = fmt.Sprintf(fmt.Sprintf(testFullClusterSchemaTemplate, oneVar), clusterInstanceParametersString)
)
// Define the cluster template.
ctName := getClusterTemplateRefName(tName, tVersion)
Expand Down Expand Up @@ -2399,21 +2390,7 @@ var _ = Describe("policyManagement", func() {

BeforeEach(func() {
var (
testFullTemplateSchema = fmt.Sprintf(`{
"properties": {
"nodeClusterName": {"type": "string"},
"oCloudSiteId": {"type": "string"},
"%s": %s,
"%s": %s
},
"type": "object",
"required": [
"nodeClusterName",
"oCloudSiteId",
"policyTemplateParameters",
"clusterInstanceParameters"
]
}`, clusterInstanceParametersString, testClusterTemplateSchema,
testFullTemplateSchema = fmt.Sprintf(fmt.Sprintf(testFullClusterSchemaTemplate, twoVars), clusterInstanceParametersString, testClusterTemplateSchema,
policyTemplateParametersString, testPolicyTemplateSchema)
)
// Define the needed resources.
Expand Down
15 changes: 1 addition & 14 deletions internal/controllers/clustertemplate_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,7 @@ var _ = Describe("ClusterTemplateReconciler", func() {
BeforeEach(func() {
ctx = context.Background()
var (
testFullTemplateSchema = fmt.Sprintf(`{
"properties": {
"nodeClusterName": {"type": "string"},
"oCloudSiteId": {"type": "string"},
"%s": {}
},
"type": "object",
"required": [
"nodeClusterName",
"oCloudSiteId",
"policyTemplateParameters",
"clusterInstanceParameters"
]
}`, clusterInstanceParametersString)
testFullTemplateSchema = fmt.Sprintf(fmt.Sprintf(testFullClusterSchemaTemplate, oneVar), clusterInstanceParametersString)
)
ct := &provisioningv1alpha1.ClusterTemplate{
ObjectMeta: metav1.ObjectMeta{
Expand Down

0 comments on commit e06e164

Please sign in to comment.