Skip to content

import command requires login even when --microcksURL is provided #511

Description

@Syedowais312

Describe the bug

microcks import does not seem to handle --microcksURL the same way as import-dir.

I started a local Microcks instance using microcks start, which runs the latest-native image without Keycloak enabled. In this setup, importing through --microcksURL http://localhost:8585 should work without a saved login/config.

import-dir works correctly with an empty config path and imports the artifact successfully. But import with the same server URL and same empty config path fails with:

please login to perform this operation

This is confusing because the command already has the target server from --microcksURL.

Expected behavior

microcks import --microcksURL... should try to use the provided server directly, like --import-dir does. If the server requires authentication, then it
should fail with an auth/API error from the server.

The issue seems to be that cmd/import.go has its own client setup logic, while import-dir uses the shared newCommandClient(globalClientOpts) helper.

Repro

Image

Microcks version or git rev

microcks-cli master branch

Install method (docker-compose, helm chart, operator, docker-desktop extension,...)

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions