mirror of
https://github.com/redhat-actions/push-to-registry.git
synced 2025-05-02 03:09:54 +02:00
Fix failure if image name has "/" in it's name and present in docker (#40)
Signed-off-by: divyansh42 <diagrawa@redhat.com>
This commit is contained in:
parent
c812c2069e
commit
5ec72be08b
4 changed files with 11 additions and 6 deletions
|
@ -23,6 +23,7 @@ let podmanPath: string | undefined;
|
|||
let isImageFromDocker = false;
|
||||
let imageToPush: string;
|
||||
let tagsList: string[];
|
||||
let dockerBaseUrl: string;
|
||||
|
||||
async function getPodmanPath(): Promise<string> {
|
||||
if (podmanPath == null) {
|
||||
|
@ -34,7 +35,8 @@ async function getPodmanPath(): Promise<string> {
|
|||
}
|
||||
|
||||
// base URL that gets appended if image is pulled from the Docker imaege storage
|
||||
const dockerBaseUrl = "docker.io/library";
|
||||
const DOCKER_IO = `docker.io`;
|
||||
const DOCKER_IO_NAMESPACED = DOCKER_IO + `/library`;
|
||||
|
||||
async function run(): Promise<void> {
|
||||
const DEFAULT_TAG = "latest";
|
||||
|
@ -43,6 +45,9 @@ async function run(): Promise<void> {
|
|||
// split tags
|
||||
tagsList = tags.split(" ");
|
||||
|
||||
// handle the case when image name is 'namespace/imagename' and image is present in docker storage
|
||||
dockerBaseUrl = imageInput.indexOf("/") > -1 ? DOCKER_IO : DOCKER_IO_NAMESPACED;
|
||||
|
||||
// info message if user doesn't provides any tag
|
||||
if (tagsList.length === 0) {
|
||||
core.info(`Input "${Inputs.TAGS}" is not provided, using default tag "${DEFAULT_TAG}"`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue