camel-k icon indicating copy to clipboard operation
camel-k copied to clipboard

Option ```--registry-insecure false``` takes no effect when using local dependencies ```-d file:///path/xxx.jar```

Open Hades-888 opened this issue 3 years ago • 8 comments
trafficstars

Hi Community,

We are running into an issue when using local dependencies option -d file:///path/xxx.jar in --registry-insecure false mode on k8s, but it still logs (insecure=true) during pushing image and throws an error of unexpected status code 503 Service Unavailable. The same task works fine without using local dependencies.

VERSION

Camel K Client 1.9.2

Command to produce the Issue

kamel install command

kamel install \
--registry-insecure false \
--registry xxx.com \
--registry-auth-username xxx \
--registry-auth-password xxx \
--organization xxx \
--maven-settings=configmap:maven-settings/settings.xml \
--build-timeout 1h \
--cluster-type kubernetes \
--build-publish-strategy Spectrum \
--force \
-n xxx

kamel run command

kamel run xxx.java \
-d file:///path/xxx.jar \
-n xxx \
--dev 

Error Log

with local dependencies option -d file:///path/xxx.jar ture

without local dependencies option -d file:///path/xxx.jar false

Expected Behavior

We want use local jar dependencies -d file:///path/xxx.jarand the HTTPS protocol in registry config --registry-insecure false

Thanks

Hades-888 avatar Jul 18 '22 06:07 Hades-888

FYI @johnpoth

squakez avatar Jul 18 '22 07:07 squakez

Hi @Hades-888, thanks for the feedback!

The insecure option should be taken from the platform CR (default name camel-k) Do you mind double checking the insecure option is correctly set by running something like:

kubectl get integrationplatform camel-k -o=jsonpath='{.spec.build.registry.insecure}' -n xxx

Thanks !

johnpoth avatar Jul 18 '22 08:07 johnpoth

Hi @Hades-888, thanks for the feedback!

The insecure option should be taken from the platform CR (default name camel-k) Do you mind double checking the insecure option is correctly set by running something like:

kubectl get integrationplatform camel-k -o=jsonpath='{.spec.build.registry.insecure}' -n xxx

Thanks !

@johnpoth ,thank you very much for your reply!

I had a query as you said,--registry-insecure false seems to have no effect

always-treu

Hades-888 avatar Jul 18 '22 09:07 Hades-888

Hi @Hades-888 ,

It seems the command line parsing library viper we use will set boolean flags to true if present regardless of the value passed... so --boolean-flag-name false will get set to true... may worth documenting if this works as intended.

In the meantime your can just omit --registry-insecure false when installing camel-k. It should be set to it's default value (false) and you should be all set!

We may want to mark this as a bug though and fix this ... i.e setting --registry-insecure false should set insecure to false -- WDY @squakez ?

Thanks !

johnpoth avatar Jul 18 '22 10:07 johnpoth

I think that's the way we parse the boolean flags. Could you try --registry-insecure=false?

squakez avatar Jul 18 '22 10:07 squakez

Ah yes it seems that way :+1:

johnpoth avatar Jul 18 '22 11:07 johnpoth

Ah yes it seems that way 👍

I think that's the way we parse the boolean flags. Could you try --registry-insecure=false?

@squakez tried, it seems return null after set --registry-insecure=false

null

Hades-888 avatar Jul 18 '22 11:07 Hades-888

@Hades-888 yes you should be fine because when undefined it gets treated as the default value which is false, thanks ! It's interesting to see boolean values getting special treatment though :)

johnpoth avatar Jul 18 '22 12:07 johnpoth

This issue has been automatically marked as stale due to 90 days of inactivity. It will be closed if no further activity occurs within 15 days. If you think that’s incorrect or the issue should never stale, please simply write any comment. Thanks for your contributions!

github-actions[bot] avatar Oct 17 '22 00:10 github-actions[bot]