Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

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

Closed
wants to merge 1 commit into from

Conversation

NikhilSharmaWe
Copy link
Contributor

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

Copy link
Member

@tzununbekov tzununbekov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--version is a global flag that defines triggermesh sources, targets, and transformation versions. If you override the version value in the "start" command, how does it affect the main components' versions?

@NikhilSharmaWe
Copy link
Contributor Author

NikhilSharmaWe commented Jul 4, 2023

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
Copy link
Member

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
Copy link
Contributor Author

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
Copy link
Member

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants