Merge https://github.com/kubernetes/cloud-provider-vsphere:master (9aa2bf7) into main#118
Conversation
Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.27.3 to 2.28.1. - [Release notes](https://github.com/onsi/ginkgo/releases) - [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md) - [Commits](onsi/ginkgo@v2.27.3...v2.28.1) --- updated-dependencies: - dependency-name: github.com/onsi/ginkgo/v2 dependency-version: 2.28.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.49.0 to 0.51.0. - [Commits](golang/net@v0.49.0...v0.51.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-version: 0.51.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [github.com/vmware/govmomi](https://github.com/vmware/govmomi) from 0.52.0 to 0.53.0. - [Release notes](https://github.com/vmware/govmomi/releases) - [Changelog](https://github.com/vmware/govmomi/blob/main/CHANGELOG.md) - [Commits](vmware/govmomi@v0.52.0...v0.53.0) --- updated-dependencies: - dependency-name: github.com/vmware/govmomi dependency-version: 0.53.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
…les/master/golang.org/x/net-0.51.0 🌱 (chore): Bump golang.org/x/net from 0.49.0 to 0.51.0
…les/test/e2e/master/github.com/vmware/govmomi-0.53.0 🌱 (chore): Bump github.com/vmware/govmomi from 0.52.0 to 0.53.0 in /test/e2e
…les/hack/tools/master/github.com/onsi/ginkgo/v2-2.28.1 🌱 (chore): Bump github.com/onsi/ginkgo/v2 from 2.27.3 to 2.28.1 in /hack/tools
Signed-off-by: Gong Zhang <gongz@vmware.com>
Fix CVE from go.opentelemetry.io/otel/metric 1.36.0
Signed-off-by: Gong Zhang <gongz@vmware.com>
Update security scan actions
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.51.0 to 0.52.0. - [Commits](golang/net@v0.51.0...v0.52.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-version: 0.52.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
…les/master/golang.org/x/net-0.52.0 🌱 (chore): Bump golang.org/x/net from 0.51.0 to 0.52.0
Signed-off-by: Gong Zhang <gongz@vmware.com>
fix go version in security scan
Signed-off-by: Gong Zhang <gongz@vmware.com>
pin go version to 1.25.8
Signed-off-by: Gong Zhang <gongz@vmware.com>
Bump trivy and go version for security scan and fix
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.47.0 to 0.49.0. - [Commits](golang/crypto@v0.47.0...v0.49.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-version: 0.49.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
…les/test/e2e/master/golang.org/x/crypto-0.49.0 🌱 (chore): Bump golang.org/x/crypto from 0.47.0 to 0.49.0 in /test/e2e
Update vm-operator to a version compatible with the required controller-runtime. This is required to satisfy the HasSyncedChecker interface introduced in client-go v0.36.0-beta.0. vm-operator version is aligned with CAPV. Signed-off-by: Gong Zhang <gongz@vmware.com>
Bump k8s group to v0.36.0-beta.0
Dependabot automatically bumped k8s.io dependencies from v0.35.0-rc.0 to v0.36.0-alpha.0 on master before the release-1.35 branch was cut, causing the release branch to inherit wrong dependency versions. Add ignore rules for k8s.io/* to prevent this: - On master: block semver-minor and semver-major auto-bumps. Patch bumps (e.g. 0.35.1 -> 0.35.1) are still allowed. - On release branches (1.35, 1.34, 1.33): fully ignore k8s.io/* including patch updates. As a Kubernetes core component, cloud-provider-vsphere release branches follow the Kubernetes patch release schedule and k8s dependencies are updated manually.
Bumps the all-github-actions group with 1 update: [azure/setup-helm](https://github.com/azure/setup-helm). Updates `azure/setup-helm` from 4 to 5 - [Release notes](https://github.com/azure/setup-helm/releases) - [Changelog](https://github.com/Azure/setup-helm/blob/main/CHANGELOG.md) - [Commits](Azure/setup-helm@v4...v5) --- updated-dependencies: - dependency-name: azure/setup-helm dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-github-actions ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps the onsi group in /test/e2e with 2 updates: [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) and [github.com/onsi/gomega](https://github.com/onsi/gomega). Updates `github.com/onsi/ginkgo/v2` from 2.27.3 to 2.28.1 - [Release notes](https://github.com/onsi/ginkgo/releases) - [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md) - [Commits](onsi/ginkgo@v2.27.3...v2.28.1) Updates `github.com/onsi/gomega` from 1.38.3 to 1.39.0 - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](onsi/gomega@v1.38.3...v1.39.0) --- updated-dependencies: - dependency-name: github.com/onsi/ginkgo/v2 dependency-version: 2.28.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: onsi - dependency-name: github.com/onsi/gomega dependency-version: 1.39.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: onsi ... Signed-off-by: dependabot[bot] <support@github.com>
This commit bumps below dependencies: - k8s.io/* to v0.36.0-rc.0 - go.etcd.io/etcd/client/v3 to v3.6.10
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughIntroduce a version-agnostic VM Operator adapter/factory and hub types; refactor CPI components (instances, loadbalancer, zones, vmservice) to use the adapter; add adapters (v1alpha2, v1alpha5, v1alpha6) with fakes/tests; remove legacy vmoperator client code; plus CI, tooling, chart, manifest, and module/version bumps. ChangesVM Operator adapter + CPI wiring (single DAG)
sequenceDiagram
participant CPI as CloudProvider (Initialize)
participant Factory as vmoperator.Factory
participant Adapter as vmoperator.Adapter (v1alpha*)
participant Dyn as dynamic API server
participant VMService as VMService / LoadBalancer
CPI->>Factory: NewAdapter(apiVersion, rest.Config)
Factory->>Adapter: construct adapter instance
Adapter->>Dyn: CRUD / Get / List VirtualMachine(s) and VirtualMachineService(s)
Dyn-->>Adapter: unstructured typed objects
Adapter-->>CPI: hub types (VirtualMachineInfo / VirtualMachineServiceInfo)
CPI->>VMService: NewLoadBalancer/NewInstances/NewZones(vmop.Interface)
VMService->>Adapter: Get/Create/Update VMService using hub types
Adapter->>Dyn: Update/Create unstructured VMService (including dual-stack)
Dyn-->>Adapter: updated object / errors
Adapter-->>VMService: result (hub types) / errors
CI, tooling, and build updates (independent DAG)
Helm, charts, manifests, and release artifacts (independent DAG)
Tests & supporting changes (scattered, same DAG as adapters)
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes ✨ Finishing Touches🧪 Generate unit tests (beta)
|
|
Hi @cloud-team-rebase-bot[bot]. Thanks for your PR. I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
f987c9f to
3e18e91
Compare
There was a problem hiding this comment.
Actionable comments posted: 4
♻️ Duplicate comments (1)
go.mod (1)
93-93:⚠️ Potential issue | 🟠 Major | ⚡ Quick winThe otel/sdk security vulnerability remains unresolved.
Line 93 still has
go.opentelemetry.io/otel/sdk v1.40.0, which is vulnerable to GHSA-hfvc-g4fc-pqhx (CVE-2026-39883, HIGH severity). As noted in the previous review, this requires upgrade to v1.43.0 or later. Since this is an indirect dependency, consider adding a replace directive if upstream hasn't updated yet.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@go.mod` at line 93, The go.mod currently pins the indirect dependency "go.opentelemetry.io/otel/sdk v1.40.0" which is vulnerable (CVE-2026-39883); update this to v1.43.0 or later and ensure the module graph is consistent by either running "go get go.opentelemetry.io/otel/sdk@v1.43.0" or adding a replace directive for go.opentelemetry.io/otel/sdk -> v1.43.0 (or newer) if the vulnerable version is pulled transitively, then run "go mod tidy" to update go.sum and verify there are no remaining references to v1.40.0.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/cloudprovider/vsphereparavirtual/vmoperator/factory/factory_test.go`:
- Around line 56-61: The test currently calls err.Error() directly which can
panic if err is nil; update the assertions in factory_test.go to first assert or
require that err is non-nil (e.g., use require.Error(t, err) or wrap the
subsequent contains checks in if assert.NotNil(t, err) { ... }) before calling
err.Error(), then check the error text contains "unsupported
vm-operator-api-version" and the factory.V1alpha2, factory.V1alpha5,
factory.V1alpha6 constants; ensure adapter remains asserted nil as before.
In
`@pkg/cloudprovider/vsphereparavirtual/vmoperator/provider/v1alpha2/client_test.go`:
- Around line 292-296: Update the doc comment for listOptsSpy to describe its
actual pass-through behavior: state that listOptsSpy is a minimal
dynamic.Interface spy that records the metav1.ListOptions passed to the most
recent List call and is used to verify that List methods forward the exact
ListOptions (unchanged) to the API server, rather than claiming they inject
ResourceVersion="0"; reference the listOptsSpy variable and the List
call/ExtractFromListOptions behavior so the comment matches the test assertions.
In `@pkg/cloudprovider/vsphereparavirtual/vmoperator/provider/v1alpha2/client.go`:
- Around line 133-140: Add nil input guards at the start of
CreateVirtualMachineService (and the corresponding UpdateVirtualMachineService)
to avoid panics: check if the vmService parameter is nil and return a
descriptive typed error (e.g., fmt.Errorf("vmService is nil")) before accessing
vmService.Namespace or using vmService in
runtime.DefaultUnstructuredConverter.ToUnstructured; this ensures
CreateVirtualMachineService and UpdateVirtualMachineService validate the input
and return an error instead of causing a nil-pointer dereference.
- Around line 80-96: The ListVirtualMachines implementation (and the other
list-returning method in this file that rebuilds only Items) drops ListMeta like
resourceVersion/continue; fix by preserving the original list metadata from the
unstructured list (assign the returned object's ListMeta into the constructed
vmopv1.VirtualMachineList.ListMeta) before returning, so pagination/consistency
fields are kept while still converting each item via
runtime.DefaultUnstructuredConverter.FromUnstructured.
---
Duplicate comments:
In `@go.mod`:
- Line 93: The go.mod currently pins the indirect dependency
"go.opentelemetry.io/otel/sdk v1.40.0" which is vulnerable (CVE-2026-39883);
update this to v1.43.0 or later and ensure the module graph is consistent by
either running "go get go.opentelemetry.io/otel/sdk@v1.43.0" or adding a replace
directive for go.opentelemetry.io/otel/sdk -> v1.43.0 (or newer) if the
vulnerable version is pulled transitively, then run "go mod tidy" to update
go.sum and verify there are no remaining references to v1.40.0.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: f34fe6ba-29e8-463b-8aae-a29a51583658
⛔ Files ignored due to path filters (236)
go.sumis excluded by!**/*.sumhack/tools/go.sumis excluded by!**/*.sumhack/tools/vendor/github.com/google/pprof/profile/merge.gois excluded by!**/vendor/**hack/tools/vendor/github.com/google/pprof/profile/profile.gois excluded by!**/vendor/**hack/tools/vendor/github.com/google/pprof/profile/proto.gois excluded by!**/vendor/**hack/tools/vendor/github.com/google/pprof/profile/prune.gois excluded by!**/vendor/**hack/tools/vendor/github.com/onsi/ginkgo/v2/ginkgo/command/command.gois excluded by!**/vendor/**hack/tools/vendor/github.com/onsi/ginkgo/v2/ginkgo/command/program.gois excluded by!**/vendor/**hack/tools/vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/run.gois excluded by!**/vendor/**hack/tools/vendor/github.com/onsi/ginkgo/v2/ginkgo/main.gois excluded by!**/vendor/**hack/tools/vendor/github.com/onsi/ginkgo/v2/ginkgo/run/run_command.gois excluded by!**/vendor/**hack/tools/vendor/github.com/onsi/ginkgo/v2/internal/reporters/gojson.gois excluded by!**/vendor/**hack/tools/vendor/github.com/onsi/ginkgo/v2/reporters/default_reporter.gois excluded by!**/vendor/**hack/tools/vendor/github.com/onsi/ginkgo/v2/reporters/junit_report.gois excluded by!**/vendor/**hack/tools/vendor/github.com/onsi/ginkgo/v2/reporters/teamcity_report.gois excluded by!**/vendor/**hack/tools/vendor/github.com/onsi/ginkgo/v2/types/config.gois excluded by!**/vendor/**hack/tools/vendor/github.com/onsi/ginkgo/v2/types/errors.gois excluded by!**/vendor/**hack/tools/vendor/github.com/onsi/ginkgo/v2/types/flags.gois excluded by!**/vendor/**hack/tools/vendor/github.com/onsi/ginkgo/v2/types/semver_filter.gois excluded by!**/vendor/**hack/tools/vendor/github.com/onsi/ginkgo/v2/types/types.gois excluded by!**/vendor/**hack/tools/vendor/github.com/onsi/ginkgo/v2/types/version.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/mod/semver/semver.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sync/errgroup/errgroup.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/affinity_linux.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/fdset.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/ifreq_linux.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/ioctl_signed.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/ioctl_unsigned.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/mkall.shis excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/mkerrors.shis excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/syscall_linux.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/syscall_netbsd.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/syscall_solaris.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/syscall_unix.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/zerrors_linux.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/zerrors_linux_386.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/zerrors_linux_arm.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/zerrors_linux_mips.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/zsyscall_linux.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/ztypes_linux.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/go/ast/inspector/cursor.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/go/ast/inspector/inspector.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/go/ast/inspector/iter.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/go/packages/golist.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/go/packages/packages.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/go/packages/visit.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/go/types/objectpath/objectpath.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/go/types/typeutil/callee.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/go/types/typeutil/map.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/aliases/aliases.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/aliases/aliases_go122.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/event/core/event.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/event/core/export.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/event/keys/keys.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/event/label/label.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/gcimporter/bimport.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/gcimporter/iexport.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/gcimporter/iimport.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/gcimporter/iimport_go122.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/gcimporter/ureader.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/gcimporter/ureader_yes.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/gocommand/version.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/pkgbits/version.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/stdlib/deps.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/stdlib/import.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/stdlib/manifest.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/stdlib/stdlib.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/typeparams/coretype.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/typeparams/free.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/typeparams/normalize.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/typesinternal/classify_call.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/typesinternal/element.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/typesinternal/fx.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/typesinternal/isnamed.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/typesinternal/qualifier.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/typesinternal/types.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/typesinternal/varkind.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/typesinternal/varkind_go124.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/typesinternal/zerovalue.gois excluded by!**/vendor/**hack/tools/vendor/golang.org/x/tools/internal/versions/features.gois excluded by!**/vendor/**hack/tools/vendor/modules.txtis excluded by!**/vendor/**test/e2e/go.sumis excluded by!**/*.sumtest/e2e/vendor/github.com/google/pprof/profile/profile.gois excluded by!**/vendor/**test/e2e/vendor/github.com/google/pprof/profile/proto.gois excluded by!**/vendor/**test/e2e/vendor/github.com/moby/spdystream/NOTICEis excluded by!**/vendor/**test/e2e/vendor/github.com/moby/spdystream/connection.gois excluded by!**/vendor/**test/e2e/vendor/github.com/moby/spdystream/spdy/LICENSEis excluded by!**/vendor/**test/e2e/vendor/github.com/moby/spdystream/spdy/PATENTSis excluded by!**/vendor/**test/e2e/vendor/github.com/moby/spdystream/spdy/dictionary.gois excluded by!**/vendor/**test/e2e/vendor/github.com/moby/spdystream/spdy/options.gois excluded by!**/vendor/**test/e2e/vendor/github.com/moby/spdystream/spdy/read.gois excluded by!**/vendor/**test/e2e/vendor/github.com/moby/spdystream/spdy/types.gois excluded by!**/vendor/**test/e2e/vendor/github.com/moby/spdystream/spdy/write.gois excluded by!**/vendor/**test/e2e/vendor/github.com/onsi/ginkgo/v2/CHANGELOG.mdis excluded by!**/vendor/**test/e2e/vendor/github.com/onsi/ginkgo/v2/README.mdis excluded by!**/vendor/**test/e2e/vendor/github.com/onsi/ginkgo/v2/core_dsl.gois excluded by!**/vendor/**test/e2e/vendor/github.com/onsi/ginkgo/v2/decorator_dsl.gois excluded by!**/vendor/**test/e2e/vendor/github.com/onsi/ginkgo/v2/ginkgo/command/command.gois excluded by!**/vendor/**test/e2e/vendor/github.com/onsi/ginkgo/v2/ginkgo/command/program.gois excluded by!**/vendor/**test/e2e/vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/run.gois excluded by!**/vendor/**test/e2e/vendor/github.com/onsi/ginkgo/v2/ginkgo/main.gois excluded by!**/vendor/**test/e2e/vendor/github.com/onsi/ginkgo/v2/ginkgo/run/run_command.gois excluded by!**/vendor/**test/e2e/vendor/github.com/onsi/ginkgo/v2/ginkgo_t_dsl.gois excluded by!**/vendor/**test/e2e/vendor/github.com/onsi/ginkgo/v2/internal/focus.gois excluded by!**/vendor/**test/e2e/vendor/github.com/onsi/ginkgo/v2/internal/group.gois excluded by!**/vendor/**test/e2e/vendor/github.com/onsi/ginkgo/v2/internal/node.gois excluded by!**/vendor/**test/e2e/vendor/github.com/onsi/ginkgo/v2/internal/reporters/gojson.gois excluded by!**/vendor/**test/e2e/vendor/github.com/onsi/ginkgo/v2/internal/suite.gois excluded by!**/vendor/**test/e2e/vendor/github.com/onsi/ginkgo/v2/internal/testingtproxy/testing_t_proxy.gois excluded by!**/vendor/**test/e2e/vendor/github.com/onsi/ginkgo/v2/reporters/default_reporter.gois excluded by!**/vendor/**test/e2e/vendor/github.com/onsi/ginkgo/v2/reporters/junit_report.gois excluded by!**/vendor/**test/e2e/vendor/github.com/onsi/ginkgo/v2/reporters/teamcity_report.gois excluded by!**/vendor/**test/e2e/vendor/github.com/onsi/ginkgo/v2/types/config.gois excluded by!**/vendor/**test/e2e/vendor/github.com/onsi/ginkgo/v2/types/errors.gois excluded by!**/vendor/**test/e2e/vendor/github.com/onsi/ginkgo/v2/types/flags.gois excluded by!**/vendor/**test/e2e/vendor/github.com/onsi/ginkgo/v2/types/semver_filter.gois excluded by!**/vendor/**test/e2e/vendor/github.com/onsi/ginkgo/v2/types/types.gois excluded by!**/vendor/**test/e2e/vendor/github.com/onsi/ginkgo/v2/types/version.gois excluded by!**/vendor/**test/e2e/vendor/github.com/onsi/gomega/CHANGELOG.mdis excluded by!**/vendor/**test/e2e/vendor/github.com/onsi/gomega/gomega_dsl.gois excluded by!**/vendor/**test/e2e/vendor/github.com/onsi/gomega/matchers.gois excluded by!**/vendor/**test/e2e/vendor/github.com/onsi/gomega/matchers/match_error_strictly_matcher.gois excluded by!**/vendor/**test/e2e/vendor/github.com/vmware/govmomi/fault/meta_types.gois excluded by!**/vendor/**test/e2e/vendor/github.com/vmware/govmomi/internal/version/version.gois excluded by!**/vendor/**test/e2e/vendor/github.com/vmware/govmomi/list/lister.gois excluded by!**/vendor/**test/e2e/vendor/github.com/vmware/govmomi/object/datastore.gois excluded by!**/vendor/**test/e2e/vendor/github.com/vmware/govmomi/object/folder.gois excluded by!**/vendor/**test/e2e/vendor/github.com/vmware/govmomi/object/host_system.gois excluded by!**/vendor/**test/e2e/vendor/github.com/vmware/govmomi/object/virtual_device_list.gois excluded by!**/vendor/**test/e2e/vendor/github.com/vmware/govmomi/vapi/internal/internal.gois excluded by!**/vendor/**test/e2e/vendor/github.com/vmware/govmomi/vapi/rest/client.gois excluded by!**/vendor/**test/e2e/vendor/github.com/vmware/govmomi/vapi/rest/errors.gois excluded by!**/vendor/**test/e2e/vendor/github.com/vmware/govmomi/vapi/rest/notifications.gois excluded by!**/vendor/**test/e2e/vendor/github.com/vmware/govmomi/vim25/client.gois excluded by!**/vendor/**test/e2e/vendor/github.com/vmware/govmomi/vim25/methods/methods.gois excluded by!**/vendor/**test/e2e/vendor/github.com/vmware/govmomi/vim25/methods/unreleased.gois excluded by!**/vendor/**test/e2e/vendor/github.com/vmware/govmomi/vim25/mo/extra.gois excluded by!**/vendor/**test/e2e/vendor/github.com/vmware/govmomi/vim25/mo/registry.gois excluded by!**/vendor/**test/e2e/vendor/github.com/vmware/govmomi/vim25/types/enum.gois excluded by!**/vendor/**test/e2e/vendor/github.com/vmware/govmomi/vim25/types/guest.gois excluded by!**/vendor/**test/e2e/vendor/github.com/vmware/govmomi/vim25/types/hardware_version.gois excluded by!**/vendor/**test/e2e/vendor/github.com/vmware/govmomi/vim25/types/helpers.gois excluded by!**/vendor/**test/e2e/vendor/github.com/vmware/govmomi/vim25/types/types.gois excluded by!**/vendor/**test/e2e/vendor/github.com/vmware/govmomi/vim25/types/unreleased.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/crypto/hkdf/hkdf.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/crypto/pbkdf2/pbkdf2.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/crypto/scrypt/scrypt.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/crypto/ssh/cipher.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/crypto/ssh/client_auth.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/net/html/iter.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/net/html/node.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/net/html/nodetype_string.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/net/http2/client_priority_go126.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/net/http2/client_priority_go127.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/net/http2/frame.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/net/http2/hpack/tables.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/net/http2/http2.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/net/http2/server.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/net/http2/transport.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/net/http2/writesched.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/net/http2/writesched_priority_rfc7540.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/net/http2/writesched_priority_rfc9218.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/net/http2/writesched_random.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/net/internal/httpsfv/httpsfv.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/net/websocket/hybi.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sync/singleflight/singleflight.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/cpu/asm_darwin_arm64_gc.sis excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/cpu/cpu_arm64.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/cpu/cpu_darwin_arm64.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/cpu/cpu_darwin_arm64_other.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/cpu/cpu_other_arm64.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/cpu/cpu_windows.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/cpu/cpu_windows_arm64.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/cpu/cpu_x86.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/cpu/syscall_darwin_arm64_gc.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/cpu/zcpu_windows.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/plan9/syscall_plan9.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/unix/affinity_linux.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/unix/ioctl_signed.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/unix/ioctl_unsigned.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/unix/mkall.shis excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/unix/syscall_linux.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/unix/syscall_linux_arm.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/unix/syscall_linux_arm64.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/unix/syscall_linux_loong64.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/unix/syscall_solaris.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/unix/syscall_unix.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/unix/zsyscall_linux.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/unix/ztypes_linux.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/windows/aliases.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/windows/dll_windows.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/windows/registry/key.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/windows/security_windows.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/windows/syscall_windows.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/windows/types_windows.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/sys/windows/zsyscall_windows.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/term/terminal.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/text/cases/tables10.0.0.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/text/cases/tables11.0.0.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/text/cases/tables12.0.0.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/text/cases/tables13.0.0.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/text/cases/tables15.0.0.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/text/cases/tables17.0.0.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/text/cases/tables9.0.0.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/text/message/catalog/catalog.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/text/message/catalog/dict.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/text/message/catalog/go19.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/text/message/catalog/gopre19.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/text/secure/bidirule/bidirule.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/text/unicode/bidi/tables10.0.0.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/text/unicode/bidi/tables11.0.0.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/text/unicode/bidi/tables12.0.0.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/text/unicode/bidi/tables13.0.0.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/text/unicode/bidi/tables15.0.0.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/text/unicode/bidi/tables17.0.0.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/text/unicode/bidi/tables9.0.0.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/text/unicode/norm/forminfo.gois excluded by!**/vendor/**test/e2e/vendor/golang.org/x/text/unicode/norm/tables10.0.0.gois excluded by!**/vendor/**
📒 Files selected for processing (64)
.github/workflows/auto-sync-gh-pages.yml.github/workflows/bump-k8s-dep.yml.github/workflows/bump-test-k8s-dep.yml.github/workflows/generate-release-notes.yml.github/workflows/weekly-security-scan.yamlMakefileREADME.mdcharts/vsphere-cpi-1.35.1.tgzcharts/vsphere-cpi-1.36.0.tgzcharts/vsphere-cpi/Chart.yamlcharts/vsphere-cpi/README.mdcharts/vsphere-cpi/templates/role.yamlcharts/vsphere-cpi/values.yamlcloudbuild-nightly.yamlcloudbuild.yamlcluster/images/controller-manager/Dockerfiledocs/book/tutorials/disable-node-deletion.yamlgo.modhack/tools/go.modindex.yamlmanifests/controller-manager/cloud-controller-manager-roles.yamlmanifests/controller-manager/vsphere-cloud-controller-manager-ds.yamlmanifests/controller-manager/vsphere-cloud-controller-manager-pod.yamlpkg/cloudprovider/vsphereparavirtual/cloud.gopkg/cloudprovider/vsphereparavirtual/instances.gopkg/cloudprovider/vsphereparavirtual/instances_test.gopkg/cloudprovider/vsphereparavirtual/loadbalancer.gopkg/cloudprovider/vsphereparavirtual/loadbalancer_test.gopkg/cloudprovider/vsphereparavirtual/vmoperator.gopkg/cloudprovider/vsphereparavirtual/vmoperator/adapter/v1alpha2/adapter.gopkg/cloudprovider/vsphereparavirtual/vmoperator/adapter/v1alpha2/adapter_test.gopkg/cloudprovider/vsphereparavirtual/vmoperator/adapter/v1alpha2/fake/fake.gopkg/cloudprovider/vsphereparavirtual/vmoperator/adapter/v1alpha5/adapter.gopkg/cloudprovider/vsphereparavirtual/vmoperator/adapter/v1alpha5/adapter_test.gopkg/cloudprovider/vsphereparavirtual/vmoperator/adapter/v1alpha5/fake/fake.gopkg/cloudprovider/vsphereparavirtual/vmoperator/adapter/v1alpha6/adapter.gopkg/cloudprovider/vsphereparavirtual/vmoperator/adapter/v1alpha6/adapter_test.gopkg/cloudprovider/vsphereparavirtual/vmoperator/adapter/v1alpha6/dualstack_unstructured.gopkg/cloudprovider/vsphereparavirtual/vmoperator/adapter/v1alpha6/fake/fake.gopkg/cloudprovider/vsphereparavirtual/vmoperator/client/client.gopkg/cloudprovider/vsphereparavirtual/vmoperator/client/fake_client.gopkg/cloudprovider/vsphereparavirtual/vmoperator/client/virtualmachine_client.gopkg/cloudprovider/vsphereparavirtual/vmoperator/client/virtualmachine_client_test.gopkg/cloudprovider/vsphereparavirtual/vmoperator/client/virtualmachineservice_client.gopkg/cloudprovider/vsphereparavirtual/vmoperator/client/virtualmachineservice_client_test.gopkg/cloudprovider/vsphereparavirtual/vmoperator/factory/factory.gopkg/cloudprovider/vsphereparavirtual/vmoperator/factory/factory_test.gopkg/cloudprovider/vsphereparavirtual/vmoperator/interface.gopkg/cloudprovider/vsphereparavirtual/vmoperator/provider/v1alpha2/client.gopkg/cloudprovider/vsphereparavirtual/vmoperator/provider/v1alpha2/client_test.gopkg/cloudprovider/vsphereparavirtual/vmoperator/provider/v1alpha5/client.gopkg/cloudprovider/vsphereparavirtual/vmoperator/provider/v1alpha5/client_test.gopkg/cloudprovider/vsphereparavirtual/vmoperator/provider/v1alpha6/client.gopkg/cloudprovider/vsphereparavirtual/vmoperator/provider/v1alpha6/client_test.gopkg/cloudprovider/vsphereparavirtual/vmoperator/types/types.gopkg/cloudprovider/vsphereparavirtual/vmservice/types.gopkg/cloudprovider/vsphereparavirtual/vmservice/vmservice.gopkg/cloudprovider/vsphereparavirtual/vmservice/vmservice_test.gopkg/cloudprovider/vsphereparavirtual/zone.gopkg/cloudprovider/vsphereparavirtual/zone_test.goreleases/README.mdreleases/v1.35/vsphere-cloud-controller-manager.yamlreleases/v1.36/vsphere-cloud-controller-manager.yamltest/e2e/go.mod
💤 Files with no reviewable changes (6)
- pkg/cloudprovider/vsphereparavirtual/vmoperator/client/virtualmachine_client_test.go
- pkg/cloudprovider/vsphereparavirtual/vmoperator/client/fake_client.go
- pkg/cloudprovider/vsphereparavirtual/vmoperator/client/virtualmachine_client.go
- pkg/cloudprovider/vsphereparavirtual/vmoperator/client/client.go
- pkg/cloudprovider/vsphereparavirtual/vmoperator/client/virtualmachineservice_client.go
- pkg/cloudprovider/vsphereparavirtual/vmoperator/client/virtualmachineservice_client_test.go
✅ Files skipped from review due to trivial changes (12)
- charts/vsphere-cpi/values.yaml
- charts/vsphere-cpi/Chart.yaml
- docs/book/tutorials/disable-node-deletion.yaml
- pkg/cloudprovider/vsphereparavirtual/vmoperator/factory/factory.go
- .github/workflows/bump-test-k8s-dep.yml
- releases/v1.35/vsphere-cloud-controller-manager.yaml
- .github/workflows/weekly-security-scan.yaml
- .github/workflows/auto-sync-gh-pages.yml
- charts/vsphere-cpi/README.md
- releases/README.md
- README.md
- hack/tools/go.mod
🚧 Files skipped from review as they are similar to previous changes (21)
- cloudbuild-nightly.yaml
- manifests/controller-manager/vsphere-cloud-controller-manager-ds.yaml
- manifests/controller-manager/cloud-controller-manager-roles.yaml
- pkg/cloudprovider/vsphereparavirtual/vmoperator/adapter/v1alpha6/fake/fake.go
- charts/vsphere-cpi/templates/role.yaml
- pkg/cloudprovider/vsphereparavirtual/vmoperator/adapter/v1alpha5/fake/fake.go
- pkg/cloudprovider/vsphereparavirtual/cloud.go
- cloudbuild.yaml
- .github/workflows/bump-k8s-dep.yml
- Makefile
- cluster/images/controller-manager/Dockerfile
- pkg/cloudprovider/vsphereparavirtual/instances_test.go
- pkg/cloudprovider/vsphereparavirtual/loadbalancer.go
- pkg/cloudprovider/vsphereparavirtual/zone.go
- test/e2e/go.mod
- pkg/cloudprovider/vsphereparavirtual/instances.go
- pkg/cloudprovider/vsphereparavirtual/vmoperator/adapter/v1alpha2/fake/fake.go
- index.yaml
- pkg/cloudprovider/vsphereparavirtual/vmoperator/interface.go
- pkg/cloudprovider/vsphereparavirtual/vmservice/vmservice.go
- pkg/cloudprovider/vsphereparavirtual/vmservice/vmservice_test.go
| assert.Error(t, err) | ||
| assert.Nil(t, adapter) | ||
| assert.Contains(t, err.Error(), "unsupported vm-operator-api-version") | ||
| assert.Contains(t, err.Error(), factory.V1alpha2) | ||
| assert.Contains(t, err.Error(), factory.V1alpha5) | ||
| assert.Contains(t, err.Error(), factory.V1alpha6) |
There was a problem hiding this comment.
Prevent panic when reading error details after a failed expectation.
On Line 58, err.Error() is used even though err can still be nil when the expectation fails, which can panic and hide the real failure signal.
Suggested fix
t.Run(tc.name, func(t *testing.T) {
adapter, err := factory.NewAdapter(tc.version, cfg)
- assert.Error(t, err)
+ if err == nil {
+ t.Fatalf("expected error for version %q", tc.version)
+ }
assert.Nil(t, adapter)
assert.Contains(t, err.Error(), "unsupported vm-operator-api-version")
assert.Contains(t, err.Error(), factory.V1alpha2)
assert.Contains(t, err.Error(), factory.V1alpha5)
assert.Contains(t, err.Error(), factory.V1alpha6)
})📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| assert.Error(t, err) | |
| assert.Nil(t, adapter) | |
| assert.Contains(t, err.Error(), "unsupported vm-operator-api-version") | |
| assert.Contains(t, err.Error(), factory.V1alpha2) | |
| assert.Contains(t, err.Error(), factory.V1alpha5) | |
| assert.Contains(t, err.Error(), factory.V1alpha6) | |
| if err == nil { | |
| t.Fatalf("expected error for version %q", tc.version) | |
| } | |
| assert.Nil(t, adapter) | |
| assert.Contains(t, err.Error(), "unsupported vm-operator-api-version") | |
| assert.Contains(t, err.Error(), factory.V1alpha2) | |
| assert.Contains(t, err.Error(), factory.V1alpha5) | |
| assert.Contains(t, err.Error(), factory.V1alpha6) |
🧰 Tools
🪛 golangci-lint (2.12.2)
[error] 60-60: : # k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/apis/nsxnetworking/v1alpha1
pkg/cloudprovider/vsphereparavirtual/apis/nsxnetworking/v1alpha1/register.go:60:3: cannot use &RouteSet{} (value of type *RouteSet) as "k8s.io/apimachinery/pkg/runtime".Object value in argument to scheme.AddKnownTypes: *RouteSet does not implement "k8s.io/apimachinery/pkg/runtime".Object (missing method DeepCopyObject)
pkg/cloudprovider/vsphereparavirtual/apis/nsxnetworking/v1alpha1/register.go:61:3: cannot use &RouteSetList{} (value of type *RouteSetList) as "k8s.io/apimachinery/pkg/runtime".Object value in argument to scheme.AddKnownTypes: *RouteSetList does not implement "k8s.io/apimachinery/pkg/runtime".Object (missing method DeepCopyObject)
pkg/cloudprovider/vsphereparavirtual/apis/nsxnetworking/v1alpha1/register.go:62:3: cannot use &IPPool{} (value of type *IPPool) as "k8s.io/apimachinery/pkg/runtime".Object value in argument to scheme.AddKnownTypes: *IPPool does not implement "k8s.io/apimachinery/pkg/runtime".Object (missing method DeepCopyObject)
pkg/cloudprovider/vsphereparavirtual/apis/nsxnetworking/v1alpha1/register.go:63:3: cannot use &IPPoolList{} (value of type *IPPoolList) as "k8s.io/apimachinery/pkg/runtime".Object value in argument to scheme.AddKnownTypes: *IPPoolList does not implement "k8s.io/apimachinery/pkg/runtime".Object (missing method DeepCopyObject)
(typecheck)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@pkg/cloudprovider/vsphereparavirtual/vmoperator/factory/factory_test.go`
around lines 56 - 61, The test currently calls err.Error() directly which can
panic if err is nil; update the assertions in factory_test.go to first assert or
require that err is non-nil (e.g., use require.Error(t, err) or wrap the
subsequent contains checks in if assert.NotNil(t, err) { ... }) before calling
err.Error(), then check the error text contains "unsupported
vm-operator-api-version" and the factory.V1alpha2, factory.V1alpha5,
factory.V1alpha6 constants; ensure adapter remains asserted nil as before.
| // listOptsSpy is a minimal dynamic.Interface spy that records the | ||
| // metav1.ListOptions passed to the most recent List call. It is used to verify | ||
| // that List methods set ResourceVersion="0" before forwarding the request to | ||
| // the API server, since the client-go fake's ListAction does not expose | ||
| // ResourceVersion (it is discarded by ExtractFromListOptions). |
There was a problem hiding this comment.
Fix listOptsSpy doc to match pass-through behavior.
The comment says list methods inject ResourceVersion="0", but these tests assert unchanged pass-through.
Suggested edit
// listOptsSpy is a minimal dynamic.Interface spy that records the
// metav1.ListOptions passed to the most recent List call. It is used to verify
-// that List methods set ResourceVersion="0" before forwarding the request to
+// that List methods pass ResourceVersion through unchanged to
// the API server, since the client-go fake's ListAction does not expose
// ResourceVersion (it is discarded by ExtractFromListOptions).📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // listOptsSpy is a minimal dynamic.Interface spy that records the | |
| // metav1.ListOptions passed to the most recent List call. It is used to verify | |
| // that List methods set ResourceVersion="0" before forwarding the request to | |
| // the API server, since the client-go fake's ListAction does not expose | |
| // ResourceVersion (it is discarded by ExtractFromListOptions). | |
| // listOptsSpy is a minimal dynamic.Interface spy that records the | |
| // metav1.ListOptions passed to the most recent List call. It is used to verify | |
| // that List methods pass ResourceVersion through unchanged to | |
| // the API server, since the client-go fake's ListAction does not expose | |
| // ResourceVersion (it is discarded by ExtractFromListOptions). |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@pkg/cloudprovider/vsphereparavirtual/vmoperator/provider/v1alpha2/client_test.go`
around lines 292 - 296, Update the doc comment for listOptsSpy to describe its
actual pass-through behavior: state that listOptsSpy is a minimal
dynamic.Interface spy that records the metav1.ListOptions passed to the most
recent List call and is used to verify that List methods forward the exact
ListOptions (unchanged) to the API server, rather than claiming they inject
ResourceVersion="0"; reference the listOptsSpy variable and the List
call/ExtractFromListOptions behavior so the comment matches the test assertions.
| func (c *Client) ListVirtualMachines(ctx context.Context, namespace string, opts metav1.ListOptions) (*vmopv1.VirtualMachineList, error) { | ||
| obj, err := c.dynamicClient.Resource(VirtualMachineGVR).Namespace(namespace).List(ctx, opts) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| list := &vmopv1.VirtualMachineList{ | ||
| Items: make([]vmopv1.VirtualMachine, 0, len(obj.Items)), | ||
| } | ||
| for i := range obj.Items { | ||
| vm := &vmopv1.VirtualMachine{} | ||
| if err := runtime.DefaultUnstructuredConverter.FromUnstructured(obj.Items[i].UnstructuredContent(), vm); err != nil { | ||
| return nil, err | ||
| } | ||
| list.Items = append(list.Items, *vm) | ||
| } | ||
| return list, nil | ||
| } |
There was a problem hiding this comment.
Preserve list metadata when converting unstructured lists.
Both list methods rebuild only Items, dropping ListMeta fields like resourceVersion and continue. That can break pagination/consistency-aware callers.
Proposed fix
func (c *Client) ListVirtualMachines(ctx context.Context, namespace string, opts metav1.ListOptions) (*vmopv1.VirtualMachineList, error) {
obj, err := c.dynamicClient.Resource(VirtualMachineGVR).Namespace(namespace).List(ctx, opts)
if err != nil {
return nil, err
}
- list := &vmopv1.VirtualMachineList{
- Items: make([]vmopv1.VirtualMachine, 0, len(obj.Items)),
- }
- for i := range obj.Items {
- vm := &vmopv1.VirtualMachine{}
- if err := runtime.DefaultUnstructuredConverter.FromUnstructured(obj.Items[i].UnstructuredContent(), vm); err != nil {
- return nil, err
- }
- list.Items = append(list.Items, *vm)
- }
+ list := &vmopv1.VirtualMachineList{}
+ if err := runtime.DefaultUnstructuredConverter.FromUnstructured(obj.UnstructuredContent(), list); err != nil {
+ return nil, err
+ }
return list, nil
}
@@
func (c *Client) ListVirtualMachineServices(ctx context.Context, namespace string, opts metav1.ListOptions) (*vmopv1.VirtualMachineServiceList, error) {
obj, err := c.dynamicClient.Resource(VirtualMachineServiceGVR).Namespace(namespace).List(ctx, opts)
if err != nil {
return nil, err
}
- list := &vmopv1.VirtualMachineServiceList{
- Items: make([]vmopv1.VirtualMachineService, 0, len(obj.Items)),
- }
- for i := range obj.Items {
- vmService := &vmopv1.VirtualMachineService{}
- if err := runtime.DefaultUnstructuredConverter.FromUnstructured(obj.Items[i].UnstructuredContent(), vmService); err != nil {
- return nil, err
- }
- list.Items = append(list.Items, *vmService)
- }
+ list := &vmopv1.VirtualMachineServiceList{}
+ if err := runtime.DefaultUnstructuredConverter.FromUnstructured(obj.UnstructuredContent(), list); err != nil {
+ return nil, err
+ }
return list, nil
}Also applies to: 112-128
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@pkg/cloudprovider/vsphereparavirtual/vmoperator/provider/v1alpha2/client.go`
around lines 80 - 96, The ListVirtualMachines implementation (and the other
list-returning method in this file that rebuilds only Items) drops ListMeta like
resourceVersion/continue; fix by preserving the original list metadata from the
unstructured list (assign the returned object's ListMeta into the constructed
vmopv1.VirtualMachineList.ListMeta) before returning, so pagination/consistency
fields are kept while still converting each item via
runtime.DefaultUnstructuredConverter.FromUnstructured.
| func (c *Client) CreateVirtualMachineService(ctx context.Context, vmService *vmopv1.VirtualMachineService) (*vmopv1.VirtualMachineService, error) { | ||
| unstructuredObj, err := runtime.DefaultUnstructuredConverter.ToUnstructured(vmService) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| unstructuredObj["apiVersion"] = VirtualMachineServiceGVR.Group + "/" + VirtualMachineServiceGVR.Version | ||
| unstructuredObj["kind"] = "VirtualMachineService" | ||
| obj, err := c.dynamicClient.Resource(VirtualMachineServiceGVR).Namespace(vmService.Namespace).Create(ctx, &unstructured.Unstructured{Object: unstructuredObj}, metav1.CreateOptions{}) |
There was a problem hiding this comment.
Add nil input guards for create/update to avoid panics.
A nil vmService causes a nil-pointer dereference at vmService.Namespace instead of returning a typed error.
Proposed fix
import (
"context"
+ "errors"
@@
func (c *Client) CreateVirtualMachineService(ctx context.Context, vmService *vmopv1.VirtualMachineService) (*vmopv1.VirtualMachineService, error) {
+ if vmService == nil {
+ return nil, errors.New("virtualMachineService is nil")
+ }
unstructuredObj, err := runtime.DefaultUnstructuredConverter.ToUnstructured(vmService)
if err != nil {
return nil, err
}
@@
func (c *Client) UpdateVirtualMachineService(ctx context.Context, vmService *vmopv1.VirtualMachineService) (*vmopv1.VirtualMachineService, error) {
+ if vmService == nil {
+ return nil, errors.New("virtualMachineService is nil")
+ }
unstructuredObj, err := runtime.DefaultUnstructuredConverter.ToUnstructured(vmService)
if err != nil {
return nil, err
}Also applies to: 153-160
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@pkg/cloudprovider/vsphereparavirtual/vmoperator/provider/v1alpha2/client.go`
around lines 133 - 140, Add nil input guards at the start of
CreateVirtualMachineService (and the corresponding UpdateVirtualMachineService)
to avoid panics: check if the vmService parameter is nil and return a
descriptive typed error (e.g., fmt.Errorf("vmService is nil")) before accessing
vmService.Namespace or using vmService in
runtime.DefaultUnstructuredConverter.ToUnstructured; this ensures
CreateVirtualMachineService and UpdateVirtualMachineService validate the input
and return an error instead of causing a nil-pointer dereference.
- --cluster-ip-family (ipv4/ipv6/ipv4ipv6/ipv6ipv4): controls NodeInternalIP ordering on the registered Node. Non-ipv4 values require --vm-operator-api-version >= v1alpha6; IPv6 with the route controller additionally requires --enable-vpc-mode=true. - NodeAddresses now reports all non-link-local interface addresses with IP-canonicalized deduplication, not just the primary IP. - Route controller: per-family StaticRoute CR naming (bare name for IPv4, -ipv6 suffix for IPv6); ListRoutes strips the suffix only when the CR's destination CIDR is IPv6, so node names that legitimately end in -ipv6 round-trip correctly. DeleteRoute now treats NotFound as success and returns underlying errors instead of silently swallowing them. - Thread clusterIPFamily through instances, vmop adapters, and the route controller; add networkutil strip helpers for per-family filtering.
Update OWNERS according Openshift project needs. Remove upstream OWNERS_ALIASES file, we do not use it at the moment. # Conflicts: # OWNERS_ALIASES # Conflicts: # OWNERS_ALIASES # Conflicts: # OWNERS_ALIASES # Conflicts: # OWNERS_ALIASES # Conflicts: # OWNERS_ALIASES
Added Openshift specific builds scripts, linter/tests/etc runners. Extended makefile with OCP specific targets. Upstream version of lint, and fmt pollutes go.mod and go.sum files, so, own versions of such scripts was introduced.
…ents OCP build system does expect *.assembly.stream.json and build system specific Dockerfile files to be copied into the build container. Remove respective entries from the .dockerignore to satisfy this requirement.
# Conflicts: # .github/workflows/release.yml # Conflicts: # .github/workflows/auto-release-helm-chart.yml # Conflicts: # .github/workflows/auto-release-helm-chart.yml # Conflicts: # .github/workflows/auto-release-helm-chart.yml # Conflicts: # .github/workflows/auto-release-helm-chart.yml # Conflicts: # .github/workflows/auto-release-helm-chart.yml # Conflicts: # .github/workflows/auto-release-helm-chart.yml
…ainer image to be consistent with ART for 4.17 Reconciling with https://github.com/openshift/ocp-build-data/tree/4c1326094222f9209876f06833179a1b9178faf7/images/ose-vsphere-cloud-controller-manager.yml
…ainer image to be consistent with ART for 4.18 Reconciling with https://github.com/openshift/ocp-build-data/tree/827ab4ccce9cbbcf82c9dbaf6398b61d6cff8d7a/images/ose-vsphere-cloud-controller-manager.yml
This change converts the script to not download goimports in favor of using the available binary from the path. This is being implemented to avoid situations where the latest version of goimports clashes with the go language version specified in the go.mod.
…ainer image to be consistent with ART for 4.19 Reconciling with https://github.com/openshift/ocp-build-data/tree/2ea3e6158c93ca104b9d59fd58a71536fa01fb2d/images/ose-vsphere-cloud-controller-manager.yml
…ainer image to be consistent with ART for 4.20 Reconciling with https://github.com/openshift/ocp-build-data/tree/dfb5c7d531490cfdc61a3b88bc533702b9624997/images/ose-vsphere-cloud-controller-manager.yml
…ainer image to be consistent with ART for 4.21 Reconciling with https://github.com/openshift/ocp-build-data/tree/3f07d84a47b15417f7743cfc35510788f4bd1ff9/images/ose-vsphere-cloud-controller-manager.yml
…ainer image to be consistent with ART for 4.22 Reconciling with https://github.com/openshift/ocp-build-data/tree/087d1930e36b609f77d73bd8a313d85c940cff4d/images/ose-vsphere-cloud-controller-manager.yml
…ainer image to be consistent with ART for 4.22 Reconciling with https://github.com/openshift/ocp-build-data/tree/992b0dc3f0e12d86e7466dadf1eb51b2584a9a83/images/ose-vsphere-cloud-controller-manager.yml
3e18e91 to
9cfc1f8
Compare
Summary by CodeRabbit
Chores
New Features
Tests