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 0250cde commit d500c6a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 68 deletions.
2 changes: 1 addition & 1 deletion bundle/manifests/oran-o2ims.clusterserviceversion.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

71 changes: 20 additions & 51 deletions internal/controllers/clusterrequest_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,29 @@ const (
}`
testPolicyTemplateInput = `{
"cpu-isolated": "1-2"
}`
testFullClusterSchemaTemplate = `{
"properties": {
"nodeClusterName": {"type": "string"},
"oCloudSiteId": {"type": "string"},
"%s": %s,
"%s": %s
},
"type": "object",
"required": [
"nodeClusterName",
"oCloudSiteId",
"policyTemplateParameters",
"clusterInstanceParameters"
]
}`
)

var (
testFullTemplateSchema = fmt.Sprintf(testFullClusterSchemaTemplate, clusterInstanceParametersString, testClusterTemplateSchema,
policyTemplateParametersString, testPolicyTemplateSchema)
)

func verifyStatusCondition(actualCond, expectedCon metav1.Condition) {
Expect(actualCond.Type).To(Equal(expectedCon.Type))
Expect(actualCond.Status).To(Equal(expectedCon.Status))
Expand Down Expand Up @@ -544,24 +564,6 @@ 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,
policyTemplateParametersString, testPolicyTemplateSchema)
)
// Define the cluster template.
ct = &provisioningv1alpha1.ClusterTemplate{
ObjectMeta: metav1.ObjectMeta{
Expand Down Expand Up @@ -1514,21 +1516,6 @@ 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)
)
// Define the cluster template.
ctName := getClusterTemplateRefName(tName, tVersion)
ct := &provisioningv1alpha1.ClusterTemplate{
Expand Down Expand Up @@ -2398,24 +2385,6 @@ 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,
policyTemplateParametersString, testPolicyTemplateSchema)
)
// Define the needed resources.
crs := []client.Object{
// Cluster Template Namespace.
Expand Down
16 changes: 0 additions & 16 deletions internal/controllers/clustertemplate_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,6 @@ 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)
)
ct := &provisioningv1alpha1.ClusterTemplate{
ObjectMeta: metav1.ObjectMeta{
Name: getClusterTemplateRefName(tName, tVersion),
Expand Down

0 comments on commit d500c6a

Please sign in to comment.