Skip to content

Conversation

@erikgb
Copy link
Member

@erikgb erikgb commented Nov 8, 2025

This enables the modernize linter and fixes new errors by applying the principles laid out in cert-manager/approver-policy#740.

In addition to run make fix-golangci-lint after enabling the linter, I manually modified the metadata API field markers.

Signed-off-by: Erik Godding Boye <[email protected]>
@cert-manager-prow cert-manager-prow bot added the dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. label Nov 8, 2025
@erikgb erikgb requested a review from Copilot November 8, 2025 11:06
@cert-manager-prow
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign wallrj for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cert-manager-prow cert-manager-prow bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 8, 2025
The bundle has "changeit" as the default password.
For more information refer to this link https://cert-manager.io/docs/faq/#keystore-passwords
Deprecated: Writing JKS is subject for removal. Please migrate to PKCS12.
Format is deprecated: Writing JKS is subject for removal. Please migrate to PKCS12.
Copy link
Member Author

Choose a reason for hiding this comment

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

This change appeared unexpectedly when running make generate. There is probably a bug in our CI that allowed this leftover from an older PR to pop up here.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request modernizes the codebase to use Go 1.24 features by replacing interface{} with any, using strings.SplitSeq() instead of strings.Split(), adopting maps.Copy(), and updating API field tags. The changes also include enabling the modernize linter and updating documentation.

  • Replaced interface{} with any alias throughout the codebase
  • Migrated from strings.Split() to strings.SplitSeq() for iteration
  • Used maps.Copy() instead of manual map copying
  • Updated JSON tags for Kubernetes API types to remove omitempty on metadata fields

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
trust-packages/debian/main.go Updated to use strings.SplitSeq() for iterating over split strings
pkg/util/pem_test.go Updated to use strings.SplitSeq() for iterating over split strings
pkg/util/conversion/conversion.go Replaced []interface{} with []any for fuzzer function
pkg/bundle/internal/target/target_test.go Replaced interface{} with any for resource patches and function signatures
pkg/bundle/internal/target/target.go Added maps import and replaced manual map copying with maps.Copy(), updated function signature to use any
pkg/bundle/bundle_test.go Replaced []interface{} with []any for expected patches slice
pkg/apis/trustmanager/v1alpha2/types_cluster_bundle.go Updated ObjectMeta JSON tag from metadata,omitempty to metadata and added alignment
pkg/apis/trust/v1alpha1/types_bundle.go Updated ObjectMeta JSON tag from metadata,omitempty to metadata and added alignment
pkg/apis/trust/v1alpha1/conversion_test.go Replaced []interface{} with []any for fuzzer function
deploy/charts/trust-manager/templates/crd-trust.cert-manager.io_bundles.yaml Updated JKS deprecation message to clarify "Format is deprecated"
.golangci.yaml Removed exclusion rules that disabled the modernize linter

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

metav1.ObjectMeta `json:"metadata,omitempty"`
metav1.TypeMeta `json:",inline"`
// +optional
metav1.ObjectMeta `json:"metadata"`
Copy link

Copilot AI Nov 8, 2025

Choose a reason for hiding this comment

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

Removing omitempty from the metadata JSON tag is a breaking API change. The field will now always be serialized even when empty, which could break existing clients that depend on the field being omitted when not set. Consider whether this breaking change is intentional and properly documented in the release notes.

Suggested change
metav1.ObjectMeta `json:"metadata"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Copilot uses AI. Check for mistakes.
metav1.ObjectMeta `json:"metadata,omitempty"`
metav1.TypeMeta `json:",inline"`
// +optional
metav1.ObjectMeta `json:"metadata"`
Copy link

Copilot AI Nov 8, 2025

Choose a reason for hiding this comment

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

Removing omitempty from the metadata JSON tag is a breaking API change. The field will now always be serialized even when empty, which could break existing clients that depend on the field being omitted when not set. Consider whether this breaking change is intentional and properly documented in the release notes.

Copilot uses AI. Check for mistakes.
@erikgb
Copy link
Member Author

erikgb commented Nov 8, 2025

/cc @inteon

@cert-manager-prow cert-manager-prow bot requested a review from inteon November 8, 2025 11:13
@inteon
Copy link
Member

inteon commented Nov 8, 2025

This is a duplicate of #786

@erikgb
Copy link
Member Author

erikgb commented Nov 8, 2025

This is a duplicate of #786

Whoops, sorry. I will review your PR instead. 😊

/close

@cert-manager-prow cert-manager-prow bot closed this Nov 8, 2025
@cert-manager-prow
Copy link
Contributor

@erikgb: Closed this PR.

In response to this:

This is a duplicate of #786

Whoops, sorry. I will review your PR instead. 😊

/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants