Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(datasource/docker): allow null in schema values #24205

Merged
merged 1 commit into from Sep 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 10 additions & 10 deletions lib/modules/datasource/docker/schema.ts
Expand Up @@ -10,7 +10,7 @@ import type { Release } from '../types';
*/
export const ManifestObject = z.object({
schemaVersion: z.literal(2),
mediaType: z.string().optional(),
mediaType: z.string().nullish(),
});

/**
Expand All @@ -20,17 +20,17 @@ export const ManifestObject = z.object({
export const Descriptor = z.object({
mediaType: z.string(),
digest: z.string(),
size: z.number().int().gt(0).optional(),
size: z.number().int().gt(0).nullish(),
});
/**
* OCI platform properties
* https://github.com/opencontainers/image-spec/blob/main/image-index.md
*/
const OciPlatform = z
.object({
architecture: z.string().optional(),
architecture: z.string().nullish(),
})
.optional();
.nullish();

/**
* OCI Image Configuration.
Expand All @@ -40,8 +40,8 @@ const OciPlatform = z
*/
export const OciImageConfig = z.object({
// This is required by the spec, but probably not present in the wild.
architecture: z.string().optional(),
config: z.object({ Labels: z.record(z.string()).optional() }).optional(),
architecture: z.string().nullish(),
config: z.object({ Labels: z.record(z.string()).nullish() }).nullish(),
});
export type OciImageConfig = z.infer<typeof OciImageConfig>;

Expand All @@ -52,8 +52,8 @@ export type OciImageConfig = z.infer<typeof OciImageConfig>;
export const OciHelmConfig = z.object({
name: z.string(),
version: z.string(),
home: z.string().optional(),
sources: z.array(z.string()).optional(),
home: z.string().nullish(),
sources: z.array(z.string()).nullish(),
});
export type OciHelmConfig = z.infer<typeof OciHelmConfig>;

Expand All @@ -70,7 +70,7 @@ export const OciImageManifest = ManifestObject.extend({
'application/vnd.cncf.helm.config.v1+json',
]),
}),
annotations: z.record(z.string()).optional(),
annotations: z.record(z.string()).nullish(),
});
export type OciImageManifest = z.infer<typeof OciImageManifest>;

Expand All @@ -90,7 +90,7 @@ export const OciImageIndexManifest = ManifestObject.extend({
platform: OciPlatform,
})
),
annotations: z.record(z.string()).optional(),
annotations: z.record(z.string()).nullish(),
});

// Old Docker manifests
Expand Down