Skip to content

Commit 1690699

Browse files
authored
k8s: update schema to 1.32.1 (#1011)
1 parent 9898506 commit 1690699

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

src/languageservice/utils/schemaUrls.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { isBoolean } from './objects';
66
import { isRelativePath, relativeToAbsolutePath } from './paths';
77

88
export const KUBERNETES_SCHEMA_URL =
9-
'https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.22.4-standalone-strict/all.json';
9+
'https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.32.1-standalone-strict/all.json';
1010
export const JSON_SCHEMASTORE_URL = 'https://www.schemastore.org/api/json/catalog.json';
1111

1212
export function checkSchemaURI(

test/autoCompletionFix.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('Auto Completion Fix Tests', () => {
2828
let schemaProvider: TestCustomSchemaProvider;
2929
before(() => {
3030
languageSettingsSetup = new ServiceSetup().withCompletion().withSchemaFileMatch({
31-
uri: 'https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.22.4-standalone-strict/all.json',
31+
uri: 'https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.32.1-standalone-strict/all.json',
3232
fileMatch: [SCHEMA_ID],
3333
});
3434
const {

test/integration.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('Kubernetes Integration Tests', () => {
1818
let yamlSettings: SettingsState;
1919

2020
before(() => {
21-
const uri = 'https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.22.4-standalone-strict/all.json';
21+
const uri = 'https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.32.1-standalone-strict/all.json';
2222
const fileMatch = ['*.yml', '*.yaml'];
2323
languageSettingsSetup = new ServiceSetup()
2424
.withHover()
@@ -123,7 +123,7 @@ describe('Kubernetes Integration Tests', () => {
123123
});
124124

125125
it('Type Object does not error on valid node', (done) => {
126-
const content = 'metadata:\n clusterName: tes';
126+
const content = 'metadata:\n name: tes';
127127
const validator = parseSetup(content);
128128
validator
129129
.then(function (result) {
@@ -265,8 +265,8 @@ describe('Kubernetes Integration Tests', () => {
265265
});
266266

267267
it('Autocomplete on boolean value (without value content)', (done) => {
268-
const content = 'spec:\n allowPrivilegeEscalation: ';
269-
const completion = parseSetup(content, 38);
268+
const content = 'apiVersion: apps/v1\nkind: Deployment\nspec:\n paused: ';
269+
const completion = parseSetup(content, content.length);
270270
completion
271271
.then(function (result) {
272272
assert.equal(result.items.length, 2);
@@ -275,8 +275,8 @@ describe('Kubernetes Integration Tests', () => {
275275
});
276276

277277
it('Autocomplete on boolean value (with value content)', (done) => {
278-
const content = 'spec:\n allowPrivilegeEscalation: fal';
279-
const completion = parseSetup(content, 43);
278+
const content = 'apiVersion: apps/v1\nkind: Deployment\nspec:\n paused: fal';
279+
const completion = parseSetup(content, content.length);
280280
completion
281281
.then(function (result) {
282282
assert.equal(result.items.length, 2);

test/schema.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -533,14 +533,14 @@ describe('JSON Schema', () => {
533533

534534
await service.addContent({
535535
action: MODIFICATION_ACTIONS.add,
536-
path: 'oneOf/1/properties/kind',
537-
key: 'enum',
538-
content: ['v2', 'v3'],
536+
path: '/oneOf/1/properties',
537+
key: 'foobar',
538+
content: ['hello', 'world'],
539539
schema: KUBERNETES_SCHEMA_URL,
540540
});
541541

542542
const fs = await service.getResolvedSchema(KUBERNETES_SCHEMA_URL);
543-
assert.deepEqual(fs.schema.oneOf[1].properties['kind']['enum'], ['v2', 'v3']);
543+
assert.deepEqual(fs.schema.oneOf[1].properties['foobar'], ['hello', 'world']);
544544
});
545545

546546
it('Deleting schema works with Kubernetes resolution', async () => {
@@ -549,13 +549,13 @@ describe('JSON Schema', () => {
549549

550550
await service.deleteContent({
551551
action: MODIFICATION_ACTIONS.delete,
552-
path: 'oneOf/1/properties/kind',
553-
key: 'enum',
552+
path: 'oneOf/1',
553+
key: 'properties',
554554
schema: KUBERNETES_SCHEMA_URL,
555555
});
556556

557557
const fs = await service.getResolvedSchema(KUBERNETES_SCHEMA_URL);
558-
assert.equal(fs.schema.oneOf[1].properties['kind']['enum'], undefined);
558+
assert.equal(fs.schema.oneOf[1].properties, undefined);
559559
});
560560

561561
it('Adding a brand new schema', async () => {

0 commit comments

Comments
 (0)