triggermesh / tmctl

TriggerMesh Shaker CLI to create, manage and debug event-driven integration apps.
Apache License 2.0
16 stars 6 forks source link

use --version arg in start command to specify broker image version #345

Closed NikhilSharmaWe closed 1 year ago

NikhilSharmaWe commented 1 year ago

Description

This PR make changes in tmctl start to use --version arg, to specify the broker version.

Before

> tmctl start foo --version v1.2.0 --restart
2023/07/04 01:41:21 foo | Starting broker
> docker ps
CONTAINER ID   IMAGE                                                            COMMAND                  CREATED
 STATUS             PORTS                     NAMES
e50ca6b0625d   gcr.io/triggermesh/memory-broker:v1.3.0                          "/memory-broker star…"   8 seconds ago       Up 7 seconds       0.0.0.0:45093->8080/tcp   foo-broker

After

> tmctl start foo --version v1.2.0 --restart
2023/07/04 01:41:21 foo | Starting broker
> docker ps
CONTAINER ID   IMAGE                                                            COMMAND                  CREATED
 STATUS             PORTS                     NAMES
e50ca6b0625d   gcr.io/triggermesh/memory-broker:v1.2.0                          "/memory-broker star…"   8 seconds ago       Up 7 seconds       0.0.0.0:45093->8080/tcp   foo-broker
NikhilSharmaWe commented 1 year ago

when we use the start command the --version flag does not work as expected and sets the version to the default value each time, even though the version is different initially.

In the example in the PR description, the initial version set for the broker was v1.2.0 but on restart, the version is changed to the default (v1.3.0, when --version flag is not used), even in the case when I set the version through --version v1.2.0.

tzununbekov commented 1 year ago

when we use the start command the --version flag does not work as expected

Please elaborate on what you think the expected behavior would be. I tested these commands, and they function according to my understanding - --version sets the version for TriggerMesh components, broker's version is defined in the CLI configuration. If you need to change the broker's version, update the configuration - tmctl config set triggermesh.broker.version <version> and restart the broker. Broker's version is always equal to what CLI configuration has, there is no other option since persisted manifests do not store this information (issue). I'm not quite sure what this PR fixes so I don't understand why we should overwrite global flags on a per-command basis.

NikhilSharmaWe commented 1 year ago

Ok I was unaware of this behavior. So, there is no need for this change to overwrite the --version global flag.

Closing the PR.

tzununbekov commented 1 year ago

I believe you must have confused the broker version and TriggerMesh components versions - these are two different things. --version configures components versions (sources, targets, etc.). Broker's version is only adjustable through the CLI configuration.