Commit Graph

9 Commits

Author SHA1 Message Date
Matthieu MOREL 808fb7c260
[chore]: enable gofumpt linter in client, cmd, component, config and confmap (#11587)
#### Description

[gofumpt](https://golangci-lint.run/usage/linters/#gofumpt) is a
stricter format than gofmt, while being backwards compatible.

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-12-11 08:50:57 +00:00
luccabb 0f81b781c1
fix version init (#11388)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

```
debug.ReadBuildInfo()
```

returns an error for some environments, which then panics on
`info.Main.Version`:

```
panic: runtime error: invalid memory address or nil pointer dereference
```

this fixes the issue by only updating the version if
`debug.ReadBuildInfo()` succeeds
2024-10-08 13:03:17 -07:00
John L. Peterson (Jack) 9811830023
Re-add version code to cmd/builder (#11208)
Revert "[chore] delete code to set a version and date, as it it not used
(#10715)"
Remove date string but re-add functions that check for version number
This (mostly) reverts commit b53f57d.

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
This re-enables the functionality to set a version number for ocb binary
(cmd/builder). It was erroneously removed. It also adds unit tests for
this functionality, as a warning is given on CI with no code coverage.

<!-- Issue number if applicable -->
#### Link to tracking issue
Relates to
https://github.com/open-telemetry/opentelemetry-collector-releases/issues/664.
Closes #11220 along with
https://github.com/open-telemetry/opentelemetry-collector-releases/pull/665

<!--Describe what testing was performed and which tests were added.-->
#### Testing
ran build and release cycles inside personal fork repositories
(jackgopack4/opentelemetry-collector and
jackgopack4/opentelemetry-collector-releases)
<!--Describe the documentation added.-->
#### Documentation
.chloggen file
<!--Please delete paragraphs that you did not use before submitting.-->
2024-09-24 12:23:07 -07:00
Antoine Toulme b53f57dc89
[chore] delete code to set a version and date, as it it not used (#10715) 2024-07-30 11:22:06 -07:00
Alex Boten 4688461318
[chore] fix unused params (#9578)
Related to #9577

Signed-off-by: Alex Boten <aboten@lightstep.com>
2024-02-13 11:04:48 -08:00
Takumi Katase b0f618e21d
refactor(builder): change output of `version` subcommand. (#8994)
With this change, running `builder version` on binaries installed with
`go install` will output the version specified at the suffix.

If it's under development, the following output will be obtained.
```
$ GO111MODULE=on CGO_ENABLED=0 go run . version
ocb version (devel)
```

**Link to tracking Issue:** #8770

---------

Co-authored-by: Bogdan Drutu <bogdandrutu@gmail.com>
2023-12-09 14:50:24 -08:00
Alex Boten 80d704deb4
[chore] use license shortform (#7694)
* [chore] use license shortform

To remain consistent w/ contrib repo, see https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/22052

Signed-off-by: Alex Boten <aboten@lightstep.com>

* make goporto

Signed-off-by: Alex Boten <aboten@lightstep.com>

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
2023-05-18 13:11:17 -07:00
James Peach 3e14ee97d8
Update the builder to use a consistent binary name. (#5651)
Update the builder to consistently use "ocb" in the name of the command,
version. Since the builder does not expand environment variables in the
config file pathname, the default value for `--config` does not work,
so we can make this flag required so that users don't silently build an
inoperative collector.

This fixes #5581.

Signed-off-by: James Peach <jpeach@cloudflare.com>
2022-07-22 07:30:52 -07:00
Bogdan Drutu 02187dfeb2
Nit: remove more global state from the Builder (#4448)
* Nit: remove more global state from the Builder

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Update version.go
2021-11-18 09:44:12 -08:00