noobaa-operator icon indicating copy to clipboard operation
noobaa-operator copied to clipboard

CLI seems to ignore image arugment

Open ctron opened this issue 5 months ago • 7 comments

Downloading the CLI and then running the install command seems to ignore the provided image argument, defaulting to a quite old one instead:

$ noobaa install --noobaa-image=noobaa/noobaa-core:5.18.6
INFO[0000] CLI version: 5.18.6                          
INFO[0000] noobaa-image: noobaa/noobaa-core:master-20240520 
INFO[0000] operator-image: noobaa/noobaa-operator:5.18.6 
INFO[0000] noobaa-db-image: quay.io/sclorg/postgresql-15-c9s 
INFO[0000] Namespace: default    

My expectation would be that the image default is aligned with the most recent released one. And that providing that argument would actually override it.

ctron avatar Jul 09 '25 09:07 ctron

HI @ctron

Thanks for that. We are using the flag all the time, and it works.

After you have a working cluster, could you look at the logs of the core and see what version is actually there (it is written on the first line of the logs).

liranmauda avatar Jul 10 '25 09:07 liranmauda

The working cluster had noobaa/noobaa-core:master-20240520

ctron avatar Jul 10 '25 12:07 ctron

Could you share the operator logs?

liranmauda avatar Jul 10 '25 13:07 liranmauda

Ok, I think I figured out what's going on. Trying to reproduce with a fresh cluster (minikube).

When I use noobaa install (no args), I get:

➜  ~ noobaa install
INFO[0000] CLI version: 5.18.6                          
INFO[0000] noobaa-image: noobaa/noobaa-core:master-20240520 
INFO[0000] operator-image: noobaa/noobaa-operator:5.18.6 
INFO[0000] noobaa-db-image: quay.io/sclorg/postgresql-15-c9s 
…

When I add the arg, but don't uninstall first, it just keeps the version. And showing the old version.

Trying with upgrade I get:

➜  ~ noobaa upgrade --noobaa-image=noobaa/noobaa-core:5.18.6
INFO[0000] System versions prior to upgrade:            
INFO[0000] CLI version: 5.18.6                          
INFO[0000] noobaa-image: noobaa/noobaa-core:master-20240520 
INFO[0000] operator-image: noobaa/noobaa-operator:5.18.6 
[…]
WARN[0003] ⚠  The desired noobaa image and the running image are not the same 
INFO[0003] CLI version: 5.18.6                          
INFO[0003] noobaa-image: noobaa/noobaa-core:5.18.6      
INFO[0003] operator-image: noobaa/noobaa-operator:5.18.6 
INFO[0003] noobaa-db-image: quay.io/sclorg/postgresql-15-c9s 
INFO[0003] Namespace: default  

But I do get:

➜  ~ oc get pods noobaa-core-0 -o json | jq .spec.containers[].image
"noobaa/noobaa-core:5.18.6"
"noobaa/noobaa-core:5.18.6"

So it seems to change the version then.

  1. the log output shows the information from the args (not the installation)
  2. running install again, would apply the new setting

ctron avatar Jul 11 '25 10:07 ctron

@ctron

  1. CLI Install is only for installation, and will not change the versions.
  2. Cleaning the installation with uninstall does not clean the CRs and if there are bracing changes it will not work properly. to fully uninstall and remove the CRs you should use the --cleanup flag
  3. The upgrade should work, assuming the image you are using is in a higher version then the one installed.
  4. Running install again will not apply any changes.

Hope that answers, let me know if there is anything else here.

liranmauda avatar Jul 13 '25 06:07 liranmauda

I think the gist of this issue (for me) is that install didn't work as (I) expected. Running it again, it looked like it did ok, but actually didn't to anything.

Maybe re-running install should point that out? Or warn, like upgrade does, about a version mismatch. Maybe pointing out on top that it's not CLI arguments, but something stored in the cluster.

ctron avatar Jul 14 '25 06:07 ctron

@ctron I have moved the issue to the operator.

Make sense, we might consider issuing a warning, or failing the installation if the cluster is already installed.

One point that is worth mentioning, the install option is only valid for upstream use.

liranmauda avatar Jul 14 '25 13:07 liranmauda