Skip to content

Conversation

@viveksinghggits
Copy link
Contributor

@viveksinghggits viveksinghggits commented Aug 8, 2025

Summary

As part of the efforts of atomic releases we would like to build the binary in dev/staging workflows and then would like to promote those binaries while releasing the product.
The build/push of kubectl plugin binary to dev/staging workflow has been complete successfully as part of the PR, but the promotion was still pending. This PR makes sure that the plugin that is uploaded to the staging bucket, is promoted to the release at the time of MCK release.

Proof of Work

Build the binary in staging workflow so that we can test the promotion process. The provided operator version is respective commit for the MCK tag 1.4.0

evergreen patch --path .evergreen.yml -p mongodb-kubernetes -v init_test_run -t build_test_image -f -y -u --browse -d "Build tests image to test kubectl push, staging scenario" --param BUILD_SCENARIO=staging --param OPERATOR_VERSION=78538991c
Banner: The AWS outage is getting better and tasks and hosts are starting to come back up.
Patch successfully created.

         ID : 68f7a99022f3b600070510b5
    Project : mongodb-kubernetes
    Created : 2025-10-21 15:41:06.232 +0000 UTC
Description : Build tests image to test kubectl push, staging scenario
      Build : https://evergreen.mongodb.com/version/68f7a99022f3b600070510b5?redirect_spruce_users=true
     Status : created

Job was successful and the artifacts were uploaded to the staging bucket

aws s3 ls s3://mongodb-kubernetes-staging/kubectl-mongodb/78538991c/dist/
                           PRE kubectl-mongodb_darwin_amd64_v1/
                           PRE kubectl-mongodb_darwin_arm64/
                           PRE kubectl-mongodb_linux_amd64_v1/
                           PRE kubectl-mongodb_linux_arm64/
                           PRE kubectl-mongodb_linux_ppc64le/
                           PRE kubectl-mongodb_linux_s390x/

test release of kubectl plugin

Running this command is not required while release, it will automatically be run when we create and push tag in github. To test this we just updated the repo and the github token so that the assets can be uploaded to my personal repo.

evergreen patch --path .evergreen.yml -p mongodb-kubernetes -v release_kubectl_mongodb_plugin -t release_kubectl_mongodb_plugin -f -y -u --browse -d "Test promotion of kubectl plugin" --param OPERATOR_VERSION=1.4.0
Banner: The AWS outage is getting better and tasks and hosts are starting to come back up.
Patch successfully created.

         ID : 68f7ac0bb1224400073a3565
    Project : mongodb-kubernetes
    Created : 2025-10-21 15:51:40.875 +0000 UTC
Description : Test promotion of kubectl plugin
      Build : https://evergreen.mongodb.com/version/68f7ac0bb1224400073a3565?redirect_spruce_users=true
     Status : created

The job would figure out the commit for the version 1.4.0 and then would copy the artifacts from staging from that version.
Job was completed successfully and we can see the artifacts in the release bucket

aws s3 ls s3://mongodb-kubernetes-release/kubectl-mongodb/1.4.0/
2025-10-21 18:01:20        646 checksums.txt
2025-10-21 18:01:13   13205230 kubectl-mongodb_1.4.0_darwin_amd64.tar.gz
2025-10-21 18:01:15   11883679 kubectl-mongodb_1.4.0_darwin_arm64.tar.gz
2025-10-21 18:01:16   12579581 kubectl-mongodb_1.4.0_linux_amd64.tar.gz
2025-10-21 18:01:17   11271962 kubectl-mongodb_1.4.0_linux_arm64.tar.gz
2025-10-21 18:01:18   11018193 kubectl-mongodb_1.4.0_linux_ppc64le.tar.gz
2025-10-21 18:01:19   12284864 kubectl-mongodb_1.4.0_linux_s390x.tar.gz

and the assets were uploaded to github release

Screenshot 2025-10-21 at 18 25 05

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?

@viveksinghggits viveksinghggits added the skip-changelog Use this label in Pull Request to not require new changelog entry file label Aug 8, 2025
@viveksinghggits viveksinghggits force-pushed the kubectl-plugin-goreleaser branch 2 times, most recently from 8c147ec to 8404bc1 Compare August 19, 2025 12:17
@viveksinghggits viveksinghggits force-pushed the kubectl-plugin-goreleaser branch from 41ee982 to ea3504f Compare September 1, 2025 17:12
@viveksinghggits viveksinghggits force-pushed the kubectl-plugin-goreleaser branch from 489c3bd to 7ad3654 Compare October 17, 2025 14:23
Base automatically changed from kubectl-plugin-goreleaser to master October 20, 2025 19:18
@viveksinghggits viveksinghggits changed the title Add evergreen function to promote and release kubectl plugin [CLOUDP-352579] Add evergreen function to promote and release kubectl plugin Oct 20, 2025
@viveksinghggits viveksinghggits marked this pull request as ready for review October 20, 2025 19:52
@viveksinghggits viveksinghggits requested a review from a team as a code owner October 20, 2025 19:52
@viveksinghggits viveksinghggits marked this pull request as draft October 20, 2025 19:53
@github-actions
Copy link

⚠️ (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 marked this pull request as ready for review October 21, 2025 13:56
def s3_artifacts_path_to_local_path(release_version: str, commit_sha: str):
s3_common_path = f"{S3_BUCKET_KUBECTL_PLUGIN_SUBPATH}/{commit_sha}/dist"
return {
f"{s3_common_path}/kubectl-mongodb_darwin_amd64_v1/": f"kubectl-mongodb_{release_version}_darwin_amd64",
Copy link
Collaborator

Choose a reason for hiding this comment

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

instead of hardcoding the platforms to download from staging use platforms in build_info

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have decided that we are going to work on this, after we stop building plugin binary using goreleaser.

@viveksinghggits viveksinghggits merged commit f214fc8 into master Oct 22, 2025
34 of 37 checks passed
@viveksinghggits viveksinghggits deleted the promote-kubectl-plugin branch October 22, 2025 16:42
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.

3 participants