Skip to content

Better document implicit defaults of labels/annotations #592

@polarathene

Description

@polarathene

Description

The relevant source is reasonably straight-forward to interpret and unlikely to change:

metadata-action/src/meta.ts

Lines 540 to 550 in ed95091

private getOCIAnnotationsWithCustoms(extra: string[]): Array<string> {
const res: Array<string> = [
`org.opencontainers.image.title=${this.repo.name || ''}`,
`org.opencontainers.image.description=${this.repo.description || ''}`,
`org.opencontainers.image.url=${this.repo.html_url || ''}`,
`org.opencontainers.image.source=${this.repo.html_url || ''}`,
`org.opencontainers.image.version=${this.version.main || ''}`,
`org.opencontainers.image.created=${this.date.toISOString()}`,
`org.opencontainers.image.revision=${this.context.sha || ''}`,
`org.opencontainers.image.licenses=${this.repo.license?.spdx_id || ''}`
];

NOTE: Presently some of those defaults cannot be easily expressed explicitly (sometimes preferable as visibility for maintainers vs implicit knowledge), but this would be much simpler to document if the following was resolved:

org.opencontainers.image.version in particular has been a common caveat users have tripped up on. More relevant direct documentation on this default could link to the priority attributes section for improved visibility/discovery and thus awareness (instead of encountering it after tags are published). See the last section of my next comment for more info.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions