Skip to content

Conversation

@viveksinghggits
Copy link
Contributor

@viveksinghggits viveksinghggits commented Aug 7, 2025

Summary

Per current implementation when we release the binary we build it via goreleaser but in our dev and staging workflows we used scripts/evergreen/build_multi_cluster_kubeconfig_creator.sh (which eventually run go build) to build the binary. We needed to change this to make sure that we are using the same mechanism to build the binary in dev/staging workflows that we use while releasing. In order to achieve that, this PR adds functionality to build the kubectl-mongodb plugin using goreleaser in dev/staging workflows.

As part of the new workflow, build_multi_cluster_binary evergreen function has been changed to run goreleaser build and upload the artifacts to a S3 location. After that the linux/amd64 distribution of the binary is downloaded locally at the path where tests image expects it.

Having the binary in the S3 bucket would eventually help us to just promote the binaries while the release process but we are not able to achieve that for now, because for dev/staging workflows we are not able to notarize the generated binaries.

After this PR, potentially we can even consider just getting rid of the script scripts/evergreen/build_multi_cluster_kubeconfig_creator.sh.

Proof of Work

Run the local patch using

evergreen patch --path .evergreen.yml -p mongodb-kubernetes -v init_test_run -t build_test_image -f -y -u --browse -d "Testing build of kubectl plugin using build scenario"

and make sure that test image is built successfully and the goreleaser artifacts are uploaded to the S3 bucket (mongodb-kubernetes-dev) correctly.

CI passing on this PR also proves that the binary is successfully built and copied to the test image.

Checklist

  • Have you linked a jira ticket and/or is the ticket in the title?
  • Have you checked whether your jira ticket required DOCSP changes?
  • Have you added changelog file?

@github-actions
Copy link

github-actions bot commented Aug 7, 2025

⚠️ (this preview might not be accurate if the PR is not rebased on current master branch)

MCK 1.6.0 Release Notes

New Features

  • MongoDBCommunity: Added support to configure custom cluster domain via newly introduced spec.clusterDomain resource field. If spec.clusterDomain is not set, environment variable CLUSTER_DOMAIN is used as cluster domain. If the environment variable CLUSTER_DOMAIN is also not set, operator falls back to cluster.local as default cluster domain.
  • Helm Chart: Introduced two new helm fields operator.podSecurityContext and operator.securityContext that can be used to configure securityContext for Operator deployment through Helm Chart.

Bug Fixes

  • Fixed parsing of the customEnvVars Helm value when values contain = characters.

@viveksinghggits viveksinghggits added the skip-changelog Use this label in Pull Request to not require new changelog entry file label Aug 7, 2025
@viveksinghggits viveksinghggits force-pushed the kubectl-plugin-goreleaser branch from 8fa4b79 to 8c147ec Compare August 19, 2025 11:49
@viveksinghggits viveksinghggits changed the title Add an evergreen function to build kubectl plugin and push to S3 [CLOUDP-338093] Use goreleaser to build kubectl-mongodb plugin for dev/staging workflows Aug 19, 2025
@viveksinghggits viveksinghggits force-pushed the kubectl-plugin-goreleaser branch from 8c147ec to 8404bc1 Compare August 19, 2025 12:17
@viveksinghggits viveksinghggits marked this pull request as ready for review August 19, 2025 12:17
@viveksinghggits viveksinghggits requested a review from a team as a code owner August 19, 2025 12:17
@viveksinghggits viveksinghggits force-pushed the kubectl-plugin-goreleaser branch from 41ee982 to ea3504f Compare September 1, 2025 17:12
Copy link
Contributor

@lsierant lsierant left a comment

Choose a reason for hiding this comment

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

It's LGTM generally, but I've left one blocking comment.

Copy link
Contributor

@lsierant lsierant left a comment

Choose a reason for hiding this comment

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

LGTM!

@viveksinghggits viveksinghggits force-pushed the kubectl-plugin-goreleaser branch from 489c3bd to 7ad3654 Compare October 17, 2025 14:23
@viveksinghggits
Copy link
Contributor Author

Hi @MaciejKaras,
I have rebased this with master, can you please have a quick look again so that I can merge this now.

@viveksinghggits viveksinghggits merged commit fd4450b into master Oct 20, 2025
37 checks passed
@viveksinghggits viveksinghggits deleted the kubectl-plugin-goreleaser branch October 20, 2025 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Use this label in Pull Request to not require new changelog entry file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants