Skip to content

[CLOUDP-332196] Remove dir public/tools after moving kubectl plugin to cmd/kubectl-mongodb #281

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

Merged
merged 12 commits into from
Jul 22, 2025

Conversation

viveksinghggits
Copy link
Contributor

@viveksinghggits viveksinghggits commented Jul 21, 2025

Summary

Since we moved everything related to the kubectl plugin to the dir cmd/kubectl-mongodb, this commit deletes the dir public/tools because it doesn't really have any valuable files now.

Proof of Work

Run the test using the same command (make golang-tests-race) that is used to run the unit tests on CI and make sure that the tests for kubectl-plugin packages, that are in pkg/kubectl-mongodb, are run.

ok  	github.com/mongodb/mongodb-kubernetes/pkg/kubectl-mongodb/common	9.709s	coverage: 54.1% of statements
=== RUN   TestNoOpAnonymizer_AnonymizeSecret
--- PASS: TestNoOpAnonymizer_AnonymizeSecret (0.00s)
=== RUN   TestSensitiveDataAnonymizer_AnonymizeSecret
--- PASS: TestSensitiveDataAnonymizer_AnonymizeSecret (0.00s)
=== RUN   TestCollectors
--- PASS: TestCollectors (0.00s)
=== RUN   TestWriteToFile
--- PASS: TestWriteToFile (0.00s)
=== RUN   TestCleanContext
--- PASS: TestCleanContext (0.00s)
PASS
coverage: 45.8% of statements
ok  	github.com/mongodb/mongodb-kubernetes/pkg/kubectl-mongodb/debug	2.144s	coverage: 45.8% of statements
=== RUN   TestGetRsNamefromMultiStsName
--- PASS: TestGetRsNamefromMultiStsName (0.00s)
=== RUN   TestGetRsNamefromMultiStsNamePanic
--- PASS: TestGetRsNamefromMultiStsNamePanic (0.00s)
=== RUN   TestLoadKubeConfigFile
--- PASS: TestLoadKubeConfigFile (0.00s)
PASS

Another trivial change that this PR introduces is, now that the unit tests related to the kubectl-mongodb plugin are moved to pkg/kubectl-mongodb and we run them from the root of the repo. The result.suite file will not be generated in the pkg/kubectl-mongodb, instead it will be part of the result.suite file that gets generated at the root of the repo. Which should be ok because we upload that tot he evergreen using the evergreen function.

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 checked for release_note changes?

…ster

This commit moves the source code of mongodb kubectl plugin from `public/tools/multicluster`
to `cmd` directory. This is to align with how go code that ships a CLI is structured.

The command/subcommand building logic is moved to the `cmd` directory and and rest of the logic

The command/subcommand building logic is moved to the `cmd` directory and and rest of the logic
is moved to the new package `pkg/kubectl-mongodb`.

This commit also moves the `.goreleaser.yaml` to the root of the project because kubectl plugin
is now at the root of the project.
1. Since most of our evergreen config files are in root of the repo and now that kubectl plugin
is also moved to `cmd/` it makes sense to move the evergreen config file to the root of repo
with correct name.
2. Change the goreleaser config file to version 1. We upgraded it temporarily to  version 2
but CI complains that only version 1 is supported.
Since we moved the code of `kubectl-mongodb` plugin to `cmd/` we needed
to move the licenses files to the new location.
This commit does that.
Since we moved the code for kubectl plugin to the dir `cmd/`, we also
need to move the Dockerfile there. This commit does the same and moves
the Dockerfile to the `cmd/kubectl-mongodb` dir.
…-mongodb`

Since we moved everything related to the kubectl plugin to the dir
`cmd/kubectl-mongodb`, this commit deletes the dir `public/tools` because
it doesn't really have any valuable files now.
@viveksinghggits viveksinghggits requested a review from a team as a code owner July 21, 2025 14:20
@viveksinghggits viveksinghggits requested review from fealebenpae, m1kola, MaciejKaras and Julien-Ben and removed request for a team July 21, 2025 14:20
@viveksinghggits viveksinghggits added the skip-changelog Use this label in Pull Request to not require new changelog entry file label Jul 21, 2025
@viveksinghggits viveksinghggits changed the title [CLOUDP-332196] Remove dir public/tools after moving kubectl plugin to `cmd/kubectl… [CLOUDP-332196] Remove dir public/tools after moving kubectl plugin to cmd/kubectl-mongodb Jul 21, 2025
Since we run the unit tests that are `pkg/kubectl-mongodb` from root
of the repo. The result.suite file will not be generated in the `pkg/kuebctl-mongodb`,
instead it will be there in the result.suite file that gets generated at the root of
the repo.
That's why we don't have to upload the file `result.suite` file from `pkg/kuebctl-mongodb`.
Base automatically changed from move-kplugin-dockerfile to master July 21, 2025 19:48
viveksinghggits added a commit that referenced this pull request Jul 22, 2025
# Summary

As part of [the
PR](#271) we moved the
kubectl-mongodb code from `public/tools/multicluster` to
`cmd/kubectl-mongodb`.
This PR, tries to move the license file from `public/tools/multicluster`
to `cmd/kubectl-mongodb`.
The next [PR](#281) in
this chain are going to actually remove the `public/tools` directory
entirely.

## Proof of Work

NA

## Checklist
- [x] Have you linked a jira ticket and/or is the ticket in the title?
- [x] Have you checked whether your jira ticket required DOCSP changes?
- [x] Have you checked for release_note changes?
@viveksinghggits viveksinghggits merged commit d841a8e into master Jul 22, 2025
35 checks passed
@viveksinghggits viveksinghggits deleted the remove-public-tools-dir branch July 22, 2025 11:24
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