Skip to content

Commit

Permalink
Bump CAPI to v1.8.0-rc.0
Browse files Browse the repository at this point in the history
  • Loading branch information
chrischdi committed Jul 30, 2024
1 parent 25174d5 commit b81542b
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 58 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ IMPORT_BOSS_VER := v0.28.1
IMPORT_BOSS := $(abspath $(TOOLS_BIN_DIR)/$(IMPORT_BOSS_BIN))
IMPORT_BOSS_PKG := k8s.io/code-generator/cmd/import-boss

CAPI_HACK_TOOLS_VER := 176d7705c42f7254521dc3afd6cac0a65fcc4584 # Note: this is the commit ID of CAPI v1.8.0-beta.1
CAPI_HACK_TOOLS_VER := c05c45e8c9096e232acf60ebc31a6d9ef837c318 # Note: this is the commit ID of CAPI v1.8.0-rc.0

BOSKOSCTL_BIN := boskosctl
BOSKOSCTL := $(abspath $(TOOLS_BIN_DIR)/$(BOSKOSCTL_BIN))
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module sigs.k8s.io/cluster-api-provider-vsphere

go 1.22.0

replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.8.0-beta.1
replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.8.0-rc.0

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

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1009,8 +1009,8 @@ rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.0 h1:Tc9rS7JJoZ9sl3OpL4842oIk6lH7gWBb0JOmJ0ute7M=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.0/go.mod h1:1ewhL9l1gkPcU/IU/6rFYfikf+7Y5imWv7ARVbBOzNs=
sigs.k8s.io/cluster-api v1.8.0-beta.1 h1:VDEw9hLARr/yxmHbfMtuwpsG0ZEZeay7djl1wllY/B8=
sigs.k8s.io/cluster-api v1.8.0-beta.1/go.mod h1:TNkfly2mrCG8O6DjGFru0USq1NhWbo2njpSXxKrRgL0=
sigs.k8s.io/cluster-api v1.8.0-rc.0 h1:Q103UfK++rI160mtURBjg4ovJ9vxJTIrrdkL7NQBdFQ=
sigs.k8s.io/cluster-api v1.8.0-rc.0/go.mod h1:TNkfly2mrCG8O6DjGFru0USq1NhWbo2njpSXxKrRgL0=
sigs.k8s.io/controller-runtime v0.9.0/go.mod h1:TgkfvrhhEw3PlI0BRL/5xM+89y3/yc0ZDfdbTl84si8=
sigs.k8s.io/controller-runtime v0.18.4 h1:87+guW1zhvuPLh1PHybKdYFLU0YJp4FhJRmiHvm5BZw=
sigs.k8s.io/controller-runtime v0.18.4/go.mod h1:TVoGrfdpbA9VRFaRnKgk9P5/atA0pMwq+f+msb9M8Sg=
Expand Down
48 changes: 28 additions & 20 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,18 @@ var (
logOptions = logs.NewOptions()
controllerName = "cluster-api-vsphere-manager"

enableContentionProfiling bool
leaderElectionLeaseDuration time.Duration
leaderElectionRenewDeadline time.Duration
leaderElectionRetryPeriod time.Duration
managerOpts manager.Options
restConfigBurst int
restConfigQPS float32
syncPeriod time.Duration
webhookOpts webhook.Options
watchNamespace string
enableContentionProfiling bool
leaderElectionLeaseDuration time.Duration
leaderElectionRenewDeadline time.Duration
leaderElectionRetryPeriod time.Duration
managerOpts manager.Options
restConfigBurst int
restConfigQPS float32
clusterCacheTrackerClientQPS float32
clusterCacheTrackerClientBurst int
syncPeriod time.Duration
webhookOpts webhook.Options
watchNamespace string

clusterCacheTrackerConcurrency int
vSphereClusterConcurrency int
Expand All @@ -85,8 +87,7 @@ var (
vSphereClusterIdentityConcurrency int
vSphereDeploymentZoneConcurrency int

tlsOptions = capiflags.TLSOptions{}
diagnosticsOptions = capiflags.DiagnosticsOptions{}
managerOptions = capiflags.ManagerOptions{}

defaultProfilerAddr = os.Getenv("PROFILER_ADDR")
defaultSyncPeriod = manager.DefaultSyncPeriod
Expand Down Expand Up @@ -181,10 +182,16 @@ func InitFlags(fs *pflag.FlagSet) {
"The minimum interval at which watched resources are reconciled (e.g. 15m)")

fs.Float32Var(&restConfigQPS, "kube-api-qps", 20,
"Maximum queries per second from the controller client to the Kubernetes API server. Defaults to 20")
"Maximum queries per second from the controller client to the Kubernetes API server.")

fs.IntVar(&restConfigBurst, "kube-api-burst", 30,
"Maximum number of queries that should be allowed in one burst from the controller client to the Kubernetes API server. Default 30")
"Maximum number of queries that should be allowed in one burst from the controller client to the Kubernetes API server.")

fs.Float32Var(&clusterCacheTrackerClientQPS, "clustercachetracker-client-qps", 20,
"Maximum queries per second from the cluster cache tracker clients to the Kubernetes API server of workload clusters.")

fs.IntVar(&clusterCacheTrackerClientBurst, "clustercachetracker-client-burst", 30,
"Maximum number of queries that should be allowed in one burst from the cluster cache tracker clients to the Kubernetes API server of workload clusters.")

fs.IntVar(&webhookOpts.Port, "webhook-port", defaultWebhookPort,
"Webhook Server port")
Expand All @@ -196,8 +203,7 @@ func InitFlags(fs *pflag.FlagSet) {
"The address the health endpoint binds to.",
)

capiflags.AddTLSOptions(fs, &tlsOptions)
capiflags.AddDiagnosticsOptions(fs, &diagnosticsOptions)
capiflags.AddManagerOptions(fs, &managerOptions)
feature.MutableGates.AddFlag(fs)
}

Expand Down Expand Up @@ -298,15 +304,15 @@ func main() {
return nil
}

tlsOptionOverrides, err := capiflags.GetTLSOptionOverrideFuncs(tlsOptions)
tlsOptions, metricsOptions, err := capiflags.GetManagerOptions(managerOptions)
if err != nil {
setupLog.Error(err, "unable to add TLS settings to the webhook server")
setupLog.Error(err, "Unable to start manager: invalid flags")
os.Exit(1)
}
webhookOpts.TLSOpts = tlsOptionOverrides
webhookOpts.TLSOpts = tlsOptions
managerOpts.WebhookServer = webhook.NewServer(webhookOpts)
managerOpts.AddToManager = addToManager
managerOpts.Metrics = capiflags.GetDiagnosticsOptions(diagnosticsOptions)
managerOpts.Metrics = *metricsOptions

// Set up the context that's going to be used in controllers and for the manager.
ctx := ctrl.SetupSignalHandler()
Expand Down Expand Up @@ -446,6 +452,8 @@ func setupRemoteClusterCacheTracker(ctx context.Context, mgr ctrlmgr.Manager) (*
SecretCachingClient: secretCachingClient,
ControllerName: controllerName,
Log: &ctrl.Log,
ClientQPS: clusterCacheTrackerClientQPS,
ClientBurst: clusterCacheTrackerClientBurst,
},
)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/config/vsphere.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ providers:
type: CoreProvider
versions:
- name: "v1.8.0" # supported release in the v1beta1 series
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.8.0-beta.1/core-components.yaml"
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.8.0-rc.0/core-components.yaml"
type: "url"
contract: v1beta1
files:
Expand Down Expand Up @@ -67,7 +67,7 @@ providers:
type: BootstrapProvider
versions:
- name: "v1.8.0" # supported release in the v1beta1 series
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.8.0-beta.1/bootstrap-components.yaml"
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.8.0-rc.0/bootstrap-components.yaml"
type: "url"
contract: v1beta1
files:
Expand Down Expand Up @@ -107,7 +107,7 @@ providers:
type: ControlPlaneProvider
versions:
- name: "v1.8.0" # supported release in the v1beta1 series
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.8.0-beta.1/control-plane-components.yaml"
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.8.0-rc.0/control-plane-components.yaml"
type: "url"
contract: v1beta1
files:
Expand Down
20 changes: 8 additions & 12 deletions test/extension/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ var (
webhookCertName string
webhookKeyName string
healthAddr string
tlsOptions = flags.TLSOptions{}
diagnosticsOptions = flags.DiagnosticsOptions{}
managerOptions = flags.ManagerOptions{}
logOptions = logs.NewOptions()
)

Expand Down Expand Up @@ -136,10 +135,10 @@ func InitFlags(fs *pflag.FlagSet) {
"The minimum interval at which watched resources are reconciled (e.g. 15m)")

fs.Float32Var(&restConfigQPS, "kube-api-qps", 20,
"Maximum queries per second from the controller client to the Kubernetes API server. Defaults to 20")
"Maximum queries per second from the controller client to the Kubernetes API server.")

fs.IntVar(&restConfigBurst, "kube-api-burst", 30,
"Maximum number of queries that should be allowed in one burst from the controller client to the Kubernetes API server. Default 30")
"Maximum number of queries that should be allowed in one burst from the controller client to the Kubernetes API server.")

fs.IntVar(&webhookPort, "webhook-port", 9443,
"Webhook Server port")
Expand All @@ -156,8 +155,7 @@ func InitFlags(fs *pflag.FlagSet) {
fs.StringVar(&healthAddr, "health-addr", ":9440",
"The address the health endpoint binds to.")

flags.AddDiagnosticsOptions(fs, &diagnosticsOptions)
flags.AddTLSOptions(fs, &tlsOptions)
flags.AddManagerOptions(fs, &managerOptions)

// Add test-extension specific flags
// NOTE: it is not mandatory to use the same flag names in all RuntimeExtension, but it is recommended when
Expand Down Expand Up @@ -200,14 +198,12 @@ func main() {
restConfig.Burst = restConfigBurst
restConfig.UserAgent = remote.DefaultClusterAPIUserAgent(controllerName)

tlsOptionOverrides, err := flags.GetTLSOptionOverrideFuncs(tlsOptions)
tlsOptions, metricsOptions, err := flags.GetManagerOptions(managerOptions)
if err != nil {
setupLog.Error(err, "Unable to add TLS settings to the webhook server")
setupLog.Error(err, "Unable to start manager: invalid flags")
os.Exit(1)
}

diagnosticsOpts := flags.GetDiagnosticsOptions(diagnosticsOptions)

if enableContentionProfiling {
goruntime.SetBlockProfileRate(1)
}
Expand All @@ -218,7 +214,7 @@ func main() {
CertDir: webhookCertDir,
CertName: webhookCertName,
KeyName: webhookKeyName,
TLSOpts: tlsOptionOverrides,
TLSOpts: tlsOptions,
Catalog: catalog,
})
if err != nil {
Expand All @@ -236,7 +232,7 @@ func main() {
LeaderElectionResourceLock: resourcelock.LeasesResourceLock,
HealthProbeBindAddress: healthAddr,
PprofBindAddress: profilerAddress,
Metrics: diagnosticsOpts,
Metrics: *metricsOptions,
Cache: cache.Options{
SyncPeriod: &syncPeriod,
},
Expand Down
4 changes: 2 additions & 2 deletions test/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ module sigs.k8s.io/cluster-api-provider-vsphere/test

go 1.22.0

replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.8.0-beta.1
replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.8.0-rc.0

replace sigs.k8s.io/cluster-api/test => sigs.k8s.io/cluster-api/test v1.8.0-beta.1
replace sigs.k8s.io/cluster-api/test => sigs.k8s.io/cluster-api/test v1.8.0-rc.0

replace sigs.k8s.io/cluster-api-provider-vsphere => ../

Expand Down
8 changes: 4 additions & 4 deletions test/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1090,10 +1090,10 @@ rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.0 h1:Tc9rS7JJoZ9sl3OpL4842oIk6lH7gWBb0JOmJ0ute7M=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.0/go.mod h1:1ewhL9l1gkPcU/IU/6rFYfikf+7Y5imWv7ARVbBOzNs=
sigs.k8s.io/cluster-api v1.8.0-beta.1 h1:VDEw9hLARr/yxmHbfMtuwpsG0ZEZeay7djl1wllY/B8=
sigs.k8s.io/cluster-api v1.8.0-beta.1/go.mod h1:TNkfly2mrCG8O6DjGFru0USq1NhWbo2njpSXxKrRgL0=
sigs.k8s.io/cluster-api/test v1.8.0-beta.1 h1:04m4hvYiEqxUcQxA6CpM7E05MOjuyb8ZD8A1evALhJw=
sigs.k8s.io/cluster-api/test v1.8.0-beta.1/go.mod h1:dwVWpEtSXNUTYb+rSQ/KNNv4lVadx26teQB9CS+yaXM=
sigs.k8s.io/cluster-api v1.8.0-rc.0 h1:Q103UfK++rI160mtURBjg4ovJ9vxJTIrrdkL7NQBdFQ=
sigs.k8s.io/cluster-api v1.8.0-rc.0/go.mod h1:TNkfly2mrCG8O6DjGFru0USq1NhWbo2njpSXxKrRgL0=
sigs.k8s.io/cluster-api/test v1.8.0-rc.0 h1:JNAxc+8QE4Vk51NFgtex6Yh4KlTJfVOjOH6ybiO3HTI=
sigs.k8s.io/cluster-api/test v1.8.0-rc.0/go.mod h1:dwVWpEtSXNUTYb+rSQ/KNNv4lVadx26teQB9CS+yaXM=
sigs.k8s.io/controller-runtime v0.9.0/go.mod h1:TgkfvrhhEw3PlI0BRL/5xM+89y3/yc0ZDfdbTl84si8=
sigs.k8s.io/controller-runtime v0.18.4 h1:87+guW1zhvuPLh1PHybKdYFLU0YJp4FhJRmiHvm5BZw=
sigs.k8s.io/controller-runtime v0.18.4/go.mod h1:TVoGrfdpbA9VRFaRnKgk9P5/atA0pMwq+f+msb9M8Sg=
Expand Down
16 changes: 10 additions & 6 deletions test/infrastructure/net-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ var (
restConfigQPS float32
restConfigBurst int
healthAddr string
diagnosticsOptions = flags.DiagnosticsOptions{}
managerOptions = flags.ManagerOptions{}
logOptions = logs.NewOptions()
// net operator specific flags.
networkInterfaceConcurrency int
Expand Down Expand Up @@ -118,15 +118,15 @@ func InitFlags(fs *pflag.FlagSet) {
"The minimum interval at which watched resources are reconciled (e.g. 15m)")

fs.Float32Var(&restConfigQPS, "kube-api-qps", 20,
"Maximum queries per second from the controller client to the Kubernetes API server. Defaults to 20")
"Maximum queries per second from the controller client to the Kubernetes API server.")

fs.IntVar(&restConfigBurst, "kube-api-burst", 30,
"Maximum number of queries that should be allowed in one burst from the controller client to the Kubernetes API server. Default 30")
"Maximum number of queries that should be allowed in one burst from the controller client to the Kubernetes API server.")

fs.StringVar(&healthAddr, "health-addr", ":9440",
"The address the health endpoint binds to.")

flags.AddDiagnosticsOptions(fs, &diagnosticsOptions)
flags.AddManagerOptions(fs, &managerOptions)

feature.MutableGates.AddFlag(fs)
}
Expand Down Expand Up @@ -159,7 +159,11 @@ func main() {
restConfig.Burst = restConfigBurst
restConfig.UserAgent = remote.DefaultClusterAPIUserAgent(controllerName)

diagnosticsOpts := flags.GetDiagnosticsOptions(diagnosticsOptions)
_, metricsOptions, err := flags.GetManagerOptions(managerOptions)
if err != nil {
setupLog.Error(err, "Unable to start manager: invalid flags")
os.Exit(1)
}

var watchNamespaces map[string]cache.Config
if watchNamespace != "" {
Expand All @@ -182,7 +186,7 @@ func main() {
LeaderElectionResourceLock: resourcelock.LeasesResourceLock,
HealthProbeBindAddress: healthAddr,
PprofBindAddress: profilerAddress,
Metrics: diagnosticsOpts,
Metrics: *metricsOptions,
Cache: cache.Options{
DefaultNamespaces: watchNamespaces,
SyncPeriod: &syncPeriod,
Expand Down
17 changes: 10 additions & 7 deletions test/infrastructure/vcsim/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ var (
restConfigQPS float32
restConfigBurst int
healthAddr string
diagnosticsOptions = flags.DiagnosticsOptions{}
managerOptions = flags.ManagerOptions{}
logOptions = logs.NewOptions()
// vcsim specific flags.
vSphereVMConcurrency int
Expand Down Expand Up @@ -159,15 +159,15 @@ func InitFlags(fs *pflag.FlagSet) {
"The minimum interval at which watched resources are reconciled (e.g. 15m)")

fs.Float32Var(&restConfigQPS, "kube-api-qps", 20,
"Maximum queries per second from the controller client to the Kubernetes API server. Defaults to 20")
"Maximum queries per second from the controller client to the Kubernetes API server.")

fs.IntVar(&restConfigBurst, "kube-api-burst", 30,
"Maximum number of queries that should be allowed in one burst from the controller client to the Kubernetes API server. Default 30")
"Maximum number of queries that should be allowed in one burst from the controller client to the Kubernetes API server.")

fs.StringVar(&healthAddr, "health-addr", ":9440",
"The address the health endpoint binds to.")

flags.AddDiagnosticsOptions(fs, &diagnosticsOptions)
flags.AddManagerOptions(fs, &managerOptions)

feature.MutableGates.AddFlag(fs)
}
Expand Down Expand Up @@ -200,8 +200,11 @@ func main() {
restConfig.Burst = restConfigBurst
restConfig.UserAgent = remote.DefaultClusterAPIUserAgent(controllerName)

diagnosticsOpts := flags.GetDiagnosticsOptions(diagnosticsOptions)

_, metricsOptions, err := flags.GetManagerOptions(managerOptions)
if err != nil {
setupLog.Error(err, "Unable to start manager: invalid flags")
os.Exit(1)
}
var watchNamespaces map[string]cache.Config
if watchNamespace != "" {
watchNamespaces = map[string]cache.Config{
Expand All @@ -223,7 +226,7 @@ func main() {
LeaderElectionResourceLock: resourcelock.LeasesResourceLock,
HealthProbeBindAddress: healthAddr,
PprofBindAddress: profilerAddress,
Metrics: diagnosticsOpts,
Metrics: *metricsOptions,
Cache: cache.Options{
DefaultNamespaces: watchNamespaces,
SyncPeriod: &syncPeriod,
Expand Down

0 comments on commit b81542b

Please sign in to comment.