Fix broken test, upgrade to golangci-lint@v2.1.1 and fix numerous lint errors, upgrade tool versions, remove hack/tools.go, etc.#64
Merged
Conversation
Signed-off-by: Saketh Kalaga <51327242+renormalize@users.noreply.github.com>
* Upgrade to `goimports-reviser@3.9.1` to support Go 1.24. * Upgrade `kind` to `v0.27.0`. * Upgrade `yq` to `v4.45.1`. Signed-off-by: Saketh Kalaga <51327242+renormalize@users.noreply.github.com>
Signed-off-by: Saketh Kalaga <51327242+renormalize@users.noreply.github.com>
Signed-off-by: Saketh Kalaga <51327242+renormalize@users.noreply.github.com>
Signed-off-by: Saketh Kalaga <51327242+renormalize@users.noreply.github.com>
Signed-off-by: Saketh Kalaga <51327242+renormalize@users.noreply.github.com>
…cheduler-api/`. * Introduce the `lint` make target, and resolve a lint error. * Introduce the `format` make target, with the corresponding `hack/format.sh`. * Introduce the `add-license-headers` make target, with the corresponding `hack/add-license-headers.sh`. Signed-off-by: Saketh Kalaga <51327242+renormalize@users.noreply.github.com>
Signed-off-by: Saketh Kalaga <51327242+renormalize@users.noreply.github.com>
…r-plugins/`. * Introduce the `format` make target along with the corresponding `hack/format.sh`. * Introduce the `add-license-headers` make target, with the corresponding `hack/add-license-headers.sh`. * Correct `boilderplate.go.txt` to be the same as the files in the other directories. Signed-off-by: Saketh Kalaga <51327242+renormalize@users.noreply.github.com>
Signed-off-by: Saketh Kalaga <51327242+renormalize@users.noreply.github.com>
Signed-off-by: Saketh Kalaga <51327242+renormalize@users.noreply.github.com>
Signed-off-by: Saketh Kalaga <51327242+renormalize@users.noreply.github.com>
…section in `go.mod`. Signed-off-by: Saketh Kalaga <51327242+renormalize@users.noreply.github.com>
Collaborator
|
I have raised kubernetes/kubernetes#131313 if there is no objection from k8s apimachinery sig then i will also raise a PR soon. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TestDefaultPodGangSetinoperator/internal/webhook/admission/pgs/defaulting/podgangset_test.go.scheduler-api/hack/tools.go, and use thetoolsection inscheduler-api/go.mod, following the Go 1.24 convention, making it uniform across all directories in the repository.golangci-lint@v2.1.1(major version upgrade).golangci-lint._. These unused variables can be renamed to appropriate names when necessary, as most are trivial. Added suggestions in places where deemed necessary.maketargets are made holistic by replicating wherever necessary.make generatewherever applicable.goimports-reviser@3.9.1since older versions are not supported by Go 1.24.kind@v0.27.0.NOTE:
make generateinscheduler-apifails, which has an easy enough fix, but affects the API so I refrained from making the change there. Input appreciated @unmarshall @sanjaychatterjee.The type
NamespacedNamedoes not include JSON tags; therefore the fieldPodReferencesin the struct:will cause issues while generating code.
controller-genexpects each struct's fields to have JSON tags, and this imported type fromk8s.io/apimachinery/pkg/typesdoes not.A potential solution is to define:
in the same package, and then change
PodGroupto:I've done the following locally and have verified that
make generatesucceeds.This project has done the same.
Given the size of the PR, I've structured it such that it will be trivial to review commit wise.
I would highly recommend doing so since quite a few commits can be skipped as they are generated.
PLEASE SQUASH AND MERGE, DO NOT CREATE A MERGE COMMIT OR REBASE AND MERGE as there are multiple commits, to avoid polluting the git history in main.