Skip to content

Commit 1e33adb

Browse files
authored
🌱 Bump cluster-api and govmomi, separate flavorgen (#3233)
* Bump sigs.k8s.io/cluster-api to 20241023 * move packaging to a separate go module * Bump govmomi to v0.45.1 * review fixes * fixup verify-modules
1 parent 3d1f616 commit 1e33adb

File tree

12 files changed

+468
-146
lines changed

12 files changed

+468
-146
lines changed

‎.golangci.yml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,14 @@ issues:
211211
- linters:
212212
- staticcheck
213213
text: "SA1019: \"sigs.k8s.io/cluster-api-provider-vsphere/apis/(v1alpha3|v1alpha4)\" is deprecated: This package will be removed in one of the next releases."
214+
# Deprecations for Cluster API's ClusterCacheTracker
215+
- linters:
216+
- staticcheck
217+
text: "SA1019: remote.(ClusterCacheTracker|ClusterCacheReconciler|ClusterCacheTrackerOptions|NewClusterCacheTracker) is deprecated: This will be removed in Cluster API v1.10, use clustercache.(ClusterCache|SetupWithManager) instead."
218+
# Deprecations for Cluster API's predicates.ClusterUnpausedAndInfrastructureReady
219+
- linters:
220+
- staticcheck
221+
text: "SA1019: predicates.ClusterUnpausedAndInfrastructureReady is deprecated: This predicate is deprecated and will be removed in a future version, use ClusterPausedTransitionsOrInfrastructureReady instead."
214222
- linters:
215223
- revive
216224
text: "exported: exported method .*\\.(Reconcile|SetupWithManager|SetupWebhookWithManager) should have comment or be unexported"

‎Makefile‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
5858
BIN_DIR := bin
5959
BUILD_DIR := .build
6060
TEST_DIR := test
61+
PACKAGING_DIR := packaging
6162
VCSIM_DIR := test/infrastructure/vcsim
6263
NETOP_DIR := test/infrastructure/net-operator
6364
TEST_EXTENSION_DIR := test/extension
@@ -181,7 +182,7 @@ IMPORT_BOSS_VER := v0.28.1
181182
IMPORT_BOSS := $(abspath $(TOOLS_BIN_DIR)/$(IMPORT_BOSS_BIN))
182183
IMPORT_BOSS_PKG := k8s.io/code-generator/cmd/import-boss
183184

184-
CAPI_HACK_TOOLS_VER := 75c986db9e38190a2313eaf6e5f97d955fa96b65 # Note: this is the commit ID of CAPI 75c986db9e38190a2313eaf6e5f97d955fa96b65 from 2024-10-02
185+
CAPI_HACK_TOOLS_VER := 5d54746e010854a1316e72733e13577d4d5695ec # Note: this is the commit ID of CAPI 5d54746e010854a1316e72733e13577d4d5695ec from 2024-10-23
185186

186187
BOSKOSCTL_BIN := boskosctl
187188
BOSKOSCTL := $(abspath $(TOOLS_BIN_DIR)/$(BOSKOSCTL_BIN))
@@ -359,6 +360,7 @@ generate-go-conversions: $(CONTROLLER_GEN) $(CONVERSION_GEN) ## Runs Go related
359360
generate-modules: ## Run go mod tidy to ensure modules are up to date
360361
go mod tidy
361362
cd $(TEST_DIR); go mod tidy
363+
cd $(PACKAGING_DIR); go mod tidy
362364

363365
.PHONY: generate-doctoc
364366
generate-doctoc:
@@ -460,6 +462,7 @@ generate-test-infra-prowjobs: $(PROWJOB_GEN) ## Generates the prowjob configurat
460462
lint: $(GOLANGCI_LINT) ## Lint the codebase
461463
$(GOLANGCI_LINT) run -v $(GOLANGCI_LINT_EXTRA_ARGS)
462464
cd $(TEST_DIR); $(GOLANGCI_LINT) run --path-prefix $(TEST_DIR) --config $(ROOT_DIR)/.golangci.yml -v $(GOLANGCI_LINT_EXTRA_ARGS)
465+
cd $(PACKAGING_DIR); $(GOLANGCI_LINT) run --path-prefix $(PACKAGING_DIR) --config $(ROOT_DIR)/.golangci.yml -v $(GOLANGCI_LINT_EXTRA_ARGS)
463466

464467
.PHONY: lint-fix
465468
lint-fix: $(GOLANGCI_LINT) ## Lint the codebase and run auto-fixers if supported by the linter
@@ -482,7 +485,7 @@ verify-go-directive:
482485

483486
.PHONY: verify-modules
484487
verify-modules: generate-modules ## Verify go modules are up to date
485-
@if !(git diff --quiet HEAD -- go.sum go.mod $(TEST_DIR)/go.mod $(TEST_DIR)/go.sum); then \
488+
@if !(git diff --quiet HEAD -- go.sum go.mod $(TEST_DIR)/go.mod $(TEST_DIR)/go.sum $(PACKAGING_DIR)/go.mod $(PACKAGING_DIR)/go.sum); then \
486489
git diff; \
487490
echo "go module files are out of date"; exit 1; \
488491
fi
@@ -529,7 +532,8 @@ verify-licenses: ## Verify licenses
529532
verify-govulncheck: $(GOVULNCHECK) ## Verify code for vulnerabilities
530533
$(GOVULNCHECK) ./... && R1=$$? || R1=$$?; \
531534
$(GOVULNCHECK) -C "$(TEST_DIR)" ./... && R2=$$? || R2=$$?; \
532-
if [ "$$R1" -ne "0" ] || [ "$$R2" -ne "0" ]; then \
535+
$(GOVULNCHECK) -C "$(PACKAGING_DIR)" ./... && R3=$$? || R3=$$?; \
536+
if [ "$$R1" -ne "0" ] || [ "$$R2" -ne "0" ] || [ "$$R3" -ne "0" ]; then \
533537
exit 1; \
534538
fi
535539

@@ -786,7 +790,9 @@ e2e-flavors-main: $(RELEASE_DIR)
786790

787791
.PHONY: generate-flavors
788792
generate-flavors: $(FLAVOR_DIR)
789-
go run ./packaging/flavorgen --output-dir $(FLAVOR_DIR)
793+
cd $(PACKAGING_DIR)/flavorgen; go build -o flavorgen ./
794+
$(PACKAGING_DIR)/flavorgen/flavorgen --output-dir $(FLAVOR_DIR)
795+
rm $(PACKAGING_DIR)/flavorgen/flavorgen
790796

791797
.PHONY: release-staging
792798
release-staging: ## Build and push container images to the staging registry

‎controllers/vspherecluster_controller.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func AddClusterControllerToManager(ctx context.Context, controllerManagerCtx *ca
158158
),
159159
).
160160
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(mgr.GetScheme(), predicateLog, controllerManagerCtx.WatchFilterValue)).
161-
WithEventFilter(predicates.ResourceIsNotExternallyManaged(predicateLog)).
161+
WithEventFilter(predicates.ResourceIsNotExternallyManaged(mgr.GetScheme(), predicateLog)).
162162
Build(reconciler)
163163
if err != nil {
164164
return err

‎controllers/vspheremachine_controller.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func AddMachineControllerToManager(ctx context.Context, controllerManagerContext
111111
&clusterv1.Cluster{},
112112
handler.EnqueueRequestsFromMapFunc(r.enqueueClusterToMachineRequests),
113113
ctrlbldr.WithPredicates(
114-
predicates.ClusterUnpausedAndInfrastructureReady(predicateLog),
114+
predicates.ClusterUnpausedAndInfrastructureReady(mgr.GetScheme(), predicateLog),
115115
),
116116
).
117117
// Watch a GenericEvent channel for the controlled resource.
@@ -168,7 +168,7 @@ func AddMachineControllerToManager(ctx context.Context, controllerManagerContext
168168
&clusterv1.Cluster{},
169169
handler.EnqueueRequestsFromMapFunc(r.enqueueClusterToMachineRequests),
170170
ctrlbldr.WithPredicates(
171-
predicates.ClusterUnpausedAndInfrastructureReady(predicateLog),
171+
predicates.ClusterUnpausedAndInfrastructureReady(mgr.GetScheme(), predicateLog),
172172
),
173173
).Complete(r)
174174
}

‎go.mod‎

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module sigs.k8s.io/cluster-api-provider-vsphere
22

33
go 1.22.0
44

5-
replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.8.0-rc.0.0.20241001133950-75c986db9e38
5+
replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.8.0-rc.0.0.20241022191051-5d54746e0108
66

77
replace github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels => github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels v0.0.0-20240404200847-de75746a9505
88

@@ -12,7 +12,7 @@ require (
1212
// The version of vm-operator should be kept in sync with the manifests at: config/deployments/integration-tests
1313
github.com/vmware-tanzu/vm-operator/api v1.8.6
1414
github.com/vmware-tanzu/vm-operator/external/ncp v0.0.0-20240404200847-de75746a9505
15-
github.com/vmware/govmomi v0.43.0
15+
github.com/vmware/govmomi v0.45.1
1616
)
1717

1818
require (
@@ -41,8 +41,6 @@ require (
4141
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8
4242
sigs.k8s.io/cluster-api v0.0.0-00010101000000-000000000000
4343
sigs.k8s.io/controller-runtime v0.19.0
44-
sigs.k8s.io/kustomize/api v0.17.3
45-
sigs.k8s.io/kustomize/kyaml v0.17.2
4644
sigs.k8s.io/yaml v1.4.0
4745
)
4846

@@ -54,20 +52,16 @@ require (
5452
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
5553
github.com/felixge/httpsnoop v1.0.4 // indirect
5654
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
57-
github.com/go-errors/errors v1.4.2 // indirect
5855
github.com/go-logr/stdr v1.2.2 // indirect
5956
github.com/go-logr/zapr v1.3.0 // indirect
6057
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
6158
github.com/google/gnostic-models v0.6.8 // indirect
6259
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 // indirect
63-
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
6460
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect
65-
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
6661
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
6762
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
6863
github.com/stretchr/objx v0.5.2 // indirect
6964
github.com/x448/float16 v0.8.4 // indirect
70-
github.com/xlab/treeprint v1.2.0 // indirect
7165
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
7266
go.opentelemetry.io/otel v1.28.0 // indirect
7367
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect
@@ -76,18 +70,17 @@ require (
7670
go.opentelemetry.io/otel/sdk v1.28.0 // indirect
7771
go.opentelemetry.io/otel/trace v1.28.0 // indirect
7872
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
79-
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect
8073
go.uber.org/multierr v1.11.0 // indirect
8174
go.uber.org/zap v1.27.0 // indirect
82-
golang.org/x/net v0.29.0 // indirect
75+
golang.org/x/net v0.30.0 // indirect
8376
golang.org/x/oauth2 v0.23.0 // indirect
8477
golang.org/x/sync v0.8.0 // indirect
85-
golang.org/x/sys v0.25.0 // indirect
86-
golang.org/x/term v0.24.0 // indirect
87-
golang.org/x/text v0.18.0 // indirect
78+
golang.org/x/sys v0.26.0 // indirect
79+
golang.org/x/term v0.25.0 // indirect
80+
golang.org/x/text v0.19.0 // indirect
8881
google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 // indirect
8982
google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect
90-
google.golang.org/grpc v1.65.0 // indirect
83+
google.golang.org/grpc v1.65.1 // indirect
9184
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
9285
gopkg.in/warnings.v0 v0.1.2 // indirect
9386
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 // indirect

0 commit comments

Comments
 (0)