Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change snapshot version to the git tag as compiled Version #405

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RafalKorepta
Copy link
Contributor

Previously the operator had compiled Version generated from goreleaser using snapshoot option. Now version of the operator will be set to the latest/newest git tag.

Previously:

$ redpanda-operator-darwin-arm64 version
Version: 2.3.6-24.3.3-SNAPSHOT-b6403b75
Commit: b6403b75ce256794ac89fe077d0b8c8d121357af
Go Version: go1.23.2
Build Date: 2025-01-22T14:07:24Z

Now:

$ redpanda-operator-darwin-arm64 version
Version: v2.3.6-24.3.3
Commit: b6403b75ce256794ac89fe077d0b8c8d121357af
Go Version: go1.23.2
Build Date: 2025-01-22T14:10:08Z

Reference

Generate an unversioned snapshot build, skipping all validations

https://github.com/goreleaser/goreleaser/blob/e3b0e8fd9bb6145b3a50ddab4359e96d7ce7d89d/internal/pipe/snapshot/snapshot.go#L22-L24

Previously the operator had compiled Version generated from goreleaser using
snapshoot option. Now version of the operator will be set to the latest/newest
git tag.

Previously:
```
$ redpanda-operator-darwin-arm64 version
Version: 2.3.6-24.3.3-SNAPSHOT-b6403b75
Commit: b6403b7
Go Version: go1.23.2
Build Date: 2025-01-22T14:07:24Z
```

Now:
```
$ redpanda-operator-darwin-arm64 version
Version: v2.3.6-24.3.3
Commit: b6403b7
Go Version: go1.23.2
Build Date: 2025-01-22T14:10:08Z
```

Reference

```
Generate an unversioned snapshot build, skipping all validations
```

https://github.com/goreleaser/goreleaser/blob/e3b0e8fd9bb6145b3a50ddab4359e96d7ce7d89d/internal/pipe/snapshot/snapshot.go#L22-L24
@chrisseto
Copy link
Contributor

Now version of the operator will be set to the latest/newest git tag

I'm not 100% certain this is the behavior that we want. As is, nightly builds of the operator will run the most recent release rather than the image itself. I suspect this will get worse once we start tagging the chart versions in this repository.

Instead, I think it would be best to build the tag/version/short version the same way we do when pushing the operator container image so we know that it will always match instead of relying on the internals of goreleaser.

@RafalKorepta
Copy link
Contributor Author

@chrisseto

I'm not 100% certain this is the behavior that we want. As is, nightly builds of the operator will run the most recent release rather than the image itself.

Nightly release always is building operator binary from the source with clean "workspace" (file system). That's why I'm not understanding your point of run the most recent release.

With your question I found that version in nightly build is wrong as it picks the latest release with SNAPSHOT placeholder. If cloud would try to use this nightly tag for configurator image it will fail to deploy.

$ docker run --entrypoint /redpanda-operator redpandadata/redpanda-operator-nightly:v0.0.0-20250123git86ba034 version
Version: 2.3.6-24.3.3-SNAPSHOT-86ba0341
Commit: 86ba034147e9fa32bd1362ad7ebdff373e97be09
Go Version: go1.23.2
Build Date: 2025-01-23T04:34:26Z

https://buildkite.com/organizations/redpanda/pipelines/redpanda-operator/builds/4142/jobs/0194916d-c195-4fc9-9700-2da6d712e158/log#339

I suspect this will get worse once we start tagging the chart versions in this repository.

We have 2 guards against this problem. The buildkite will not run from tags that not starts with v*. Other stopper is included in tag-check.sh script.

Instead, I think it would be best to build the tag/version/short version the same way we do when pushing the operator container image so we know that it will always match instead of relying on the internals of goreleaser.

Ok, I will try to open new PR that removes goreleaser from this repo. Instead I will use go build.

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

Successfully merging this pull request may close these issues.

2 participants