Skip to content

build: Switch operator-bundle build from Go 1.21 to 1.22#12687

Merged
msugakov merged 3 commits intomasterfrom
misha/operator-bundle-konflux-go1.22
Sep 16, 2024
Merged

build: Switch operator-bundle build from Go 1.21 to 1.22#12687
msugakov merged 3 commits intomasterfrom
misha/operator-bundle-konflux-go1.22

Conversation

@msugakov
Copy link
Contributor

@msugakov msugakov commented Sep 12, 2024

Description

This should fix build failure seen in #12684 / https://console.redhat.com/application-pipeline/workspaces/rh-acs/applications/acs/pipelineruns/operator-bundle-build-d8jck

[build] ============================== 15 passed in 0.04s ==============================
[build] + operator-sdk
[build] go: go.mod requires go >= 1.22 (running go 1.21.11; GOTOOLCHAIN=local)
[build] make: *** [Makefile:178: /stackrox/operator/.gotools/bin/operator-sdk] Error 1
[build] subprocess exited with status 2
[build] subprocess exited with status 2
[build] Error: building at STEP "RUN make bundle-post-process": exit status 2

The reason is that ubi9 has only Go 1.21.11 and so we need to use openshift-golang-builder instead.

Once switched to openshift-golang-builder, there are new build failures with messages like (pipeline)

    Go compliance shim [1209] [rhel-9-golang-1.22][openshift-golang-builder]: invoking real go binary
    go: inconsistent vendoring in /stackrox/operator/tools/operator-sdk:
            github.com/operator-framework/operator-lifecycle-manager@v0.27.0: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
            github.com/operator-framework/operator-sdk@v1.36.1: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
            github.com/AdaLogics/go-fuzz-headers@v0.0.0-20230811130428-ced1acdcaa24: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
            github.com/Azure/go-ansiterm@v0.0.0-20230124172434-306776ec8161: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
            github.com/BurntSushi/toml@v1.3.2: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
            github.com/MakeNowJust/heredoc@v1.0.0: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt

I haven't found many external references but something hinted that we may have -mod=vendor set for Go. This proved to be the case for openshift-golang-builder:

$ go env | grep vendor
GOFLAGS='-mod=vendor'

Doc reference: https://go.dev/ref/mod#build-commands

Apparently, this isn't specific to rhel_9_1.22, it was also in rhel_8_1.21. Why it did not cause problems in other builds - I don't know. Supposedly, the way we install tools is a bit special.

This may or may not require adjustments to #12651, but I tried running my change with prefetch, and no go: downloading ... lines were printed which suggests it should be fine.

User-facing documentation

  • CHANGELOG is updated OR update is not needed
  • documentation PR is created and is linked above OR is not needed

Testing and quality

  • the change is production ready: the change is GA or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

No change to automated testing.

How I validated my change

Only CI.

@openshift-ci
Copy link

openshift-ci bot commented Sep 12, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@rhacs-bot
Copy link
Contributor

rhacs-bot commented Sep 12, 2024

Images are ready for the commit at 6a0b2a2.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.6.x-502-g6a0b2a208a.

@codecov
Copy link

codecov bot commented Sep 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 48.17%. Comparing base (529f395) to head (3353781).
Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12687      +/-   ##
==========================================
- Coverage   48.19%   48.17%   -0.02%     
==========================================
  Files        2434     2434              
  Lines      173898   174117     +219     
==========================================
+ Hits        83802    83879      +77     
- Misses      83340    83464     +124     
- Partials     6756     6774      +18     
Flag Coverage Δ
go-unit-tests 48.17% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@msugakov
Copy link
Contributor Author

/retest operator-bundle-build

@openshift-ci

This comment was marked as outdated.

@msugakov msugakov force-pushed the misha/operator-bundle-konflux-go1.22 branch from 3353781 to e0e006a Compare September 13, 2024 12:24
msugakov and others added 2 commits September 13, 2024 14:25
Signed-off-by: red-hat-konflux <126015336+red-hat-konflux[bot]@users.noreply.github.com>

To see if build completes successfully with new references.

Cherry-picked from #12684
@msugakov msugakov force-pushed the misha/operator-bundle-konflux-go1.22 branch from e0e006a to 6a0b2a2 Compare September 13, 2024 12:26
@msugakov msugakov marked this pull request as ready for review September 13, 2024 12:41
@msugakov msugakov requested a review from a team as a code owner September 13, 2024 12:41
@msugakov msugakov requested review from a team and GrimmiMeloni and removed request for a team September 13, 2024 12:42
@msugakov
Copy link
Contributor Author

/retest main-build

@openshift-ci

This comment was marked as outdated.

@msugakov
Copy link
Contributor Author

/test ocp-4-12-nongroovy-e2e-tests
/test ocp-4-12-operator-e2e-tests
/test ocp-4-12-qa-e2e-tests

@msugakov
Copy link
Contributor Author

/test main-build

@openshift-ci

This comment was marked as outdated.

@openshift-ci
Copy link

openshift-ci bot commented Sep 13, 2024

@msugakov: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/ocp-4-12-qa-e2e-tests 6a0b2a2 link false /test ocp-4-12-qa-e2e-tests

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@msugakov msugakov merged commit 85d362f into master Sep 16, 2024
@msugakov msugakov deleted the misha/operator-bundle-konflux-go1.22 branch September 16, 2024 08:32
acravn pushed a commit to acravn/stackrox that referenced this pull request Sep 20, 2024
)

Co-authored-by: red-hat-konflux[bot] <126015336+red-hat-konflux[bot]@users.noreply.github.com>
shireenf-ibm pushed a commit to shireenf-ibm/stackrox that referenced this pull request Sep 25, 2024
)

Co-authored-by: red-hat-konflux[bot] <126015336+red-hat-konflux[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants