Skip to content

Commit 21c4834

Browse files
committed
Fixes;
1 parent 48ea903 commit 21c4834

File tree

5 files changed

+14
-4
lines changed

5 files changed

+14
-4
lines changed

api/brokerserver/broker_handler_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,10 @@ var _ = Describe("BrokerHandler", func() {
11861186
It("fails with 400", func() {
11871187
Expect(resp.Code).To(Equal(http.StatusBadRequest))
11881188
Expect(resp.Body.String()).To(MatchJSON(
1189-
`{"error": "InvalidPolicy", "description": "invalid policy provided: [{\"context\":\"(root)\",\"description\":\"Must validate one and only one schema (oneOf)\"},{\"context\":\"(root).credential-type\",\"description\":\"credential-type must be one of the following: \\\"x509\\\", \\\"binding-secret\\\"\"}]"}`,
1189+
`{
1190+
"error": "InvalidPolicy",
1191+
"description": "invalid policy provided: [{\"context\":\"(root)\",\"description\":\"Must validate one and only one schema (oneOf)\"},{\"context\":\"(root)\",\"description\":\"Must validate one and only one schema (oneOf)\"},{\"context\":\"(root)\",\"description\":\"schema-version is required\"},{\"context\":\"(root).credential-type\",\"description\":\"credential-type must be one of the following: \\\"x509\\\", \\\"binding-secret\\\"\"}]"
1192+
}`,
11901193
))
11911194
})
11921195

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Read-me #
2+
3+
The currently used golang-library for json-schema, namely “[gojsonschema](<https://github.com/xeipuuv/gojsonschema>)” not seems to be capable to resolve references to other files correctly across different directories. Perhaps not limited to but especially when referencing up the file-system-hierarchy (parent-directories). In theory, symbolic links can be used to circumvent the issue … if there would not be another weakness in <https://github.com/cloudfoundry/bosh-compile-action> which we currently use in the workflow [bosh-release-checks.yaml](<../../../../.github/workflows/bosh-release-checks.yaml>) for making a compiled release: It can not handle symbolic links. Therefore it gets hard-linked here (which can not be tracked by git but it can somehow handle it!).
4+
5+
After phasing out the bosh-technology of “Application Autoscaler”, these hardlinks can be removed.
6+
7+
⚠️ This means the consinstence needs to be ensured manually. There is no CI/CD-check because Bosh is already in its phase-out for “Application Autoscaler”.

api/policyvalidator/json-schema/meta.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Unification of different schemas for scaling-policies for Autoscaler",
55

66
"oneOf": [
7-
{"$ref": "./v0_1/meta.schema.json"},
7+
{"$ref": "./v0.1/meta.schema.json"},
88
{"$ref": "./legacy.schema.json"}
99
]
1010
}

api/policyvalidator/policy_validator_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ var _ = Describe("PolicyValidator", func() {
4848
upperDiskThreshold = 2 * 1024
4949

5050
policyValidator = NewPolicyValidator(
51-
"./meta.schema.json",
51+
"./json-schema/meta.schema.json",
5252
lowerCPUThreshold,
5353
upperCPUThreshold,
5454
lowerCPUUtilThreshold,

integration/components_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ func DefaultGolangAPITestConfig() apiConfig.Config {
232232
},
233233
CatalogPath: "../servicebroker/config/catalog.json",
234234
CatalogSchemaPath: "../api/schemas/catalog.schema.json",
235-
PolicySchemaPath: "../api/policyvalidator/json-schema/meta.schema.json",
235+
PolicySchemaPath: "../api/policyvalidator/meta.schema.json",
236236
InfoFilePath: "../api/exampleconfig/catalog-example.json",
237237
DashboardRedirectURI: "",
238238
CF: cf.Config{

0 commit comments

Comments
 (0)