cloudposse / cloudposse/github-action-docker-build-push

org.opencontainers.image.source label is incorrect

Aperta
#78 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Dockerfile
Stelle
14
Fork
15
Merge medio
12m
PR unite (30g)
2

Descrizione

Found a bug? Maybe our [Slack Community](https://cloudposse.com/slack) can help.

[![Slack Community](https://slack.cloudposse.com/for-the-badge.svg)](https://cloudposse.com/slack)

## Describe the Bug

`org.opencontainers.image.source=https://github.com/${{ inputs.organization }}/${{ inputs.repository }}` is an invalid label when the org/repo approach are not used so you have to put `improper` values to fix this label.

The `image.url` label would be accurate to the actual GH repo, if the values are the same.

## Expected Behavior

Create a proper label for the `image.source` like it does for `image.url`.

## Steps to Reproduce

Steps to reproduce the behavior:
1. Run the GHA with input values unrelated to the current repo
2. Observe the label is incorrect.

Example:

Inputs:
```
organization: client
registry: client.jfrog.io
image_name: example-image
repository: jfrog-non-prod
```

Creates a label like this:
```
--label org.opencontainers.image.source=https://github.com/client/jfrog-non-prod
```

If you don't provide a repository since it is included in the image name or if the GH repo is different from the docker image repo, the label will perpetually be wrong unless you set the repo input to a value solely for satisfying this label.

```
organization: client
registry: client.jfrog.io
image_name: jfrog-non-prod/example-image
repository: example-image
```

What if the GH repo is under a completely different name than the docker image name? Something where there is a `client-sandbox` GH org that is pushing to the `client` org so the label would also be wrong there as well.

Suggestion: update the logic for that label to match that of `image.url` and allow an override based on a new input.

## Screenshots

This is internal client work so I cannot provide the screenshot and blurring private info would remove the usefulness.

## Environment (please complete the following information):

Anything that will help us triage the bug will help. Here are some ideas:
- OS: N/A
- Version [e.g. 10.15]: N/A

## Additional Context

This is active in the `1.17.2` version.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Esamina la logica di GitHub Action che genera l'etichetta org.opencontainers.image.source e confrontala con la gestione esistente di image.url. Riproduci il problema usando i valori forniti per organization, registry, image_name e repository; l'attività è completata quando l'etichetta source identifica il repository GitHub effettivo o supporta l'override esplicito proposto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
docker, dockerfile, github-actions
Ambito
ci-cd, devops
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.