badgen/badgen.net

Docker Metadata should support OCI Schema because Label Schema is superseded by it

viceice opened this issue · 3 comments

The Label Schema1 is deprecated and replaced by OCI Image Spec2. So badgen should support the org.opencontainers.image.* annotations.

Footnotes

  1. http://label-schema.org/rc1/

  2. https://github.com/opencontainers/image-spec/blob/main/annotations.md#back-compatibility-with-label-schema

Can probably easily done here:

badgen.net/api/docker.ts

Lines 172 to 179 in b8a85f1

const metadata = image_config.container_config.Labels[`org.label-schema.${type}`]
if (! metadata) {
return {
subject: 'docker metadata',
status: `error getting ${type}`,
color: 'grey'
}
}

const metadata = image_config.container_config.Labels[`org.label-schema.${type}`] || image_config.container_config.Labels[`org.opencontainers.image.${type}`] 
 if (! metadata) { 
   return { 
     subject: 'docker metadata', 
     status: `error getting ${type}`, 
     color: 'grey' 
   } 
 } 

Can i send a PR to add that ?