Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(dependencies): update to capi v1.4.0 #870

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ settings = {
"deploy_cert_manager": True,
"preload_images_for_kind": True,
"kind_cluster_name": "capg",
"capi_version": "v1.3.5",
"capi_version": "v1.4.0",
"cert_manager_version": "v1.11.0",
"kubernetes_version": "v1.25.5",
}
Expand Down
3 changes: 3 additions & 0 deletions api/v1alpha3/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Package v1alpha3 contains the v1alpha3 API implementation.
//
// Deprecated: This package will be removed in one of the next releases.
package v1alpha3

// +k8s:conversion-gen=sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1
2 changes: 1 addition & 1 deletion api/v1alpha3/gcpcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package v1alpha3

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3"
clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" //nolint: staticcheck
)

const (
Expand Down
3 changes: 3 additions & 0 deletions api/v1alpha4/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Package v1alpha4 contains the v1alpha4 API implementation.
//
// Deprecated: This package will be removed in one of the next releases.
package v1alpha4

// +k8s:conversion-gen=sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1
2 changes: 1 addition & 1 deletion api/v1alpha4/gcpcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package v1alpha4

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4"
clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" //nolint: staticcheck
)

const (
Expand Down
10 changes: 5 additions & 5 deletions cloud/scope/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func (m *MachineScope) GetInstanceID() *string {
return nil
}

return pointer.StringPtr(parsed.ID())
return pointer.String(parsed.ID())
}

// GetProviderID returns the GCPMachine providerID from the spec.
Expand All @@ -171,7 +171,7 @@ func (m *MachineScope) GetProviderID() string {
// SetProviderID sets the GCPMachine providerID in spec.
func (m *MachineScope) SetProviderID() {
providerID, _ := providerid.New(m.ClusterGetter.Project(), m.Zone(), m.Name())
m.GCPMachine.Spec.ProviderID = pointer.StringPtr(providerID.String())
m.GCPMachine.Spec.ProviderID = pointer.String(providerID.String())
}

// GetInstanceStatus returns the GCPMachine instance status.
Expand All @@ -191,7 +191,7 @@ func (m *MachineScope) SetReady() {

// SetFailureMessage sets the GCPMachine status failure message.
func (m *MachineScope) SetFailureMessage(v error) {
m.GCPMachine.Status.FailureMessage = pointer.StringPtr(v.Error())
m.GCPMachine.Status.FailureMessage = pointer.String(v.Error())
}

// SetFailureReason sets the GCPMachine status failure reason.
Expand Down Expand Up @@ -253,7 +253,7 @@ func (m *MachineScope) InstanceAdditionalDiskSpec() []*compute.AttachedDisk {
additionalDisk := &compute.AttachedDisk{
AutoDelete: true,
InitializeParams: &compute.AttachedDiskInitializeParams{
DiskSizeGb: pointer.Int64PtrDerefOr(disk.Size, 30),
DiskSizeGb: pointer.Int64Deref(disk.Size, 30),
DiskType: path.Join("zones", m.Zone(), "diskTypes", string(*disk.DeviceType)),
},
}
Expand Down Expand Up @@ -341,7 +341,7 @@ func (m *MachineScope) InstanceSpec(log logr.Logger) *compute.Instance {
Labels: infrav1.Build(infrav1.BuildParams{
ClusterName: m.ClusterGetter.Name(),
Lifecycle: infrav1.ResourceLifecycleOwned,
Role: pointer.StringPtr(m.Role()),
Role: pointer.String(m.Role()),
// TODO(vincepri): Check what needs to be added for the cloud provider label.
Additional: m.ClusterGetter.AdditionalLabels().AddLabels(m.GCPMachine.Spec.AdditionalLabels),
}),
Expand Down
2 changes: 1 addition & 1 deletion cloud/scope/managedcontrolplane.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func (s *ManagedControlPlaneScope) GetAllNodePools(ctx context.Context) ([]infra
if s.AllManagedMachinePools == nil || len(s.AllManagedMachinePools) == 0 {
listOptions := []client.ListOption{
client.InNamespace(s.GCPManagedControlPlane.Namespace),
client.MatchingLabels(map[string]string{clusterv1.ClusterLabelName: s.Cluster.Name}),
client.MatchingLabels(map[string]string{clusterv1.ClusterNameLabel: s.Cluster.Name}),
}

machinePoolList := &clusterv1exp.MachinePoolList{}
Expand Down
2 changes: 1 addition & 1 deletion cloud/services/compute/instances/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (s *Service) createOrGetInstance(ctx context.Context) (*compute.Instance, e
instanceKey := meta.ZonalKey(instanceName, s.scope.Zone())
instanceSpec.Metadata.Items = append(instanceSpec.Metadata.Items, &compute.MetadataItems{
Key: "user-data",
Value: pointer.StringPtr(bootstrapData),
Value: pointer.String(bootstrapData),
})

log.V(2).Info("Looking for instance", "name", instanceName, "zone", s.scope.Zone())
Expand Down
2 changes: 1 addition & 1 deletion clusterctl-settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name": "infrastructure-gcp",
"config": {
"componentsFile": "infrastructure-components.yaml",
"nextVersion": "v1.3.0"
"nextVersion": "v1.4.0"
}
}
8 changes: 8 additions & 0 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ spec:
port: healthz
initialDelaySeconds: 10
periodSeconds: 10
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
privileged: false
runAsUser: 65532
runAsGroup: 65532
env:
- name: NODE_NAME
valueFrom:
Expand Down
2 changes: 1 addition & 1 deletion controllers/gcpmachine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (r *GCPMachineReconciler) GCPClusterToGCPMachines(ctx context.Context) hand
return result
}

labels := map[string]string{clusterv1.ClusterLabelName: cluster.Name}
labels := map[string]string{clusterv1.ClusterNameLabel: cluster.Name}
machineList := &clusterv1.MachineList{}
if err := r.List(ctx, machineList, client.InNamespace(c.Namespace), client.MatchingLabels(labels)); err != nil {
log.Error(err, "failed to list Machines")
Expand Down
2 changes: 1 addition & 1 deletion controllers/gcpmachine_controller_unit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func newMachine(clusterName, machineName string) *clusterv1.Machine {
return &clusterv1.Machine{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
clusterv1.ClusterLabelName: clusterName,
clusterv1.ClusterNameLabel: clusterName,
},
Name: machineName,
Namespace: "default",
Expand Down
9 changes: 3 additions & 6 deletions exp/api/v1beta1/webhook_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"testing"
"time"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

admissionv1beta1 "k8s.io/api/admission/v1beta1"
Expand All @@ -34,7 +34,6 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/envtest"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
)
Expand All @@ -51,9 +50,7 @@ var cancel context.CancelFunc
func TestAPIs(t *testing.T) {
RegisterFailHandler(Fail)

RunSpecsWithDefaultAndCustomReporters(t,
"Webhook Suite",
[]Reporter{printer.NewlineReporter{}})
RunSpecs(t, "Webhook Suite")
}

var _ = BeforeSuite(func() {
Expand Down Expand Up @@ -130,7 +127,7 @@ var _ = BeforeSuite(func() {
return nil
}).Should(Succeed())

}, 60)
})

var _ = AfterSuite(func() {
cancel()
Expand Down
2 changes: 1 addition & 1 deletion exp/controllers/gcpmanagedmachinepool_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func managedControlPlaneToManagedMachinePoolMapFunc(c client.Client, gvk schema.

managedPoolForClusterList := expclusterv1.MachinePoolList{}
if err := c.List(
ctx, &managedPoolForClusterList, client.InNamespace(clusterKey.Namespace), client.MatchingLabels{clusterv1.ClusterLabelName: clusterKey.Name},
ctx, &managedPoolForClusterList, client.InNamespace(clusterKey.Namespace), client.MatchingLabels{clusterv1.ClusterNameLabel: clusterKey.Name},
); err != nil {
log.Error(err, "couldn't list pools for cluster")
return nil
Expand Down
9 changes: 3 additions & 6 deletions exp/controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@ import (
"path/filepath"
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
infrastructurev1beta1 "sigs.k8s.io/cluster-api-provider-gcp/exp/api/v1beta1"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/envtest"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
)
Expand All @@ -42,9 +41,7 @@ var testEnv *envtest.Environment
func TestAPIs(t *testing.T) {
RegisterFailHandler(Fail)

RunSpecsWithDefaultAndCustomReporters(t,
"Controller Suite",
[]Reporter{printer.NewlineReporter{}})
RunSpecs(t, "Controller Suite")
}

var _ = BeforeSuite(func() {
Expand All @@ -71,7 +68,7 @@ var _ = BeforeSuite(func() {
Expect(err).NotTo(HaveOccurred())
Expect(k8sClient).NotTo(BeNil())

}, 60)
})

var _ = AfterSuite(func() {
By("tearing down the test environment")
Expand Down
63 changes: 30 additions & 33 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ require (
github.com/go-logr/logr v1.2.3
github.com/google/go-cmp v0.5.9
github.com/googleapis/gax-go/v2 v2.8.0
github.com/onsi/ginkgo v1.16.5
github.com/onsi/ginkgo/v2 v2.9.2
github.com/onsi/gomega v1.27.5
github.com/pkg/errors v0.9.1
Expand All @@ -21,15 +20,15 @@ require (
golang.org/x/net v0.8.0
google.golang.org/api v0.114.0
google.golang.org/grpc v1.54.0
k8s.io/api v0.25.5
k8s.io/apimachinery v0.25.5
k8s.io/client-go v0.25.5
k8s.io/component-base v0.25.5
k8s.io/api v0.26.1
k8s.io/apimachinery v0.26.1
k8s.io/client-go v0.26.1
k8s.io/component-base v0.26.1
k8s.io/klog/v2 v2.80.1
k8s.io/utils v0.0.0-20220823124924-e9cbc92d1a73
sigs.k8s.io/cluster-api v1.3.5
sigs.k8s.io/cluster-api/test v1.3.5
sigs.k8s.io/controller-runtime v0.13.1
k8s.io/utils v0.0.0-20221128185143-99ec85e7a448
sigs.k8s.io/cluster-api v1.4.0
sigs.k8s.io/cluster-api/test v1.4.0
sigs.k8s.io/controller-runtime v0.14.5
)

require (
Expand All @@ -41,7 +40,7 @@ require (
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
github.com/Microsoft/go-winio v0.5.0 // indirect
github.com/alessio/shellescape v1.4.1 // indirect
github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220418222510-f25a4f6275ed // indirect
github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 // indirect
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver v3.5.1+incompatible // indirect
Expand All @@ -64,13 +63,13 @@ require (
github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gobuffalo/flect v0.3.0 // indirect
github.com/gobuffalo/flect v1.0.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/cel-go v0.12.4 // indirect
github.com/google/cel-go v0.12.6 // indirect
github.com/google/gnostic v0.6.9 // indirect
github.com/google/go-github/v45 v45.2.0 // indirect
github.com/google/go-github/v48 v48.2.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
Expand All @@ -83,63 +82,61 @@ require (
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.2 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.13.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/spf13/afero v1.9.2 // indirect
github.com/spf13/afero v1.9.3 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/cobra v1.6.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/viper v1.13.0 // indirect
github.com/spf13/viper v1.15.0 // indirect
github.com/stoewer/go-strcase v1.2.0 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
github.com/valyala/fastjson v1.6.3 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/valyala/fastjson v1.6.4 // indirect
go.opencensus.io v0.24.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.21.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/oauth2 v0.6.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/term v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.7.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230320184635-7606e756e683 // indirect
google.golang.org/protobuf v1.29.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.25.0 // indirect
k8s.io/apiserver v0.25.0 // indirect
k8s.io/apiextensions-apiserver v0.26.1 // indirect
k8s.io/apiserver v0.26.1 // indirect
k8s.io/cluster-bootstrap v0.25.0 // indirect
k8s.io/kube-openapi v0.0.0-20220803164354-a70c9af30aea // indirect
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/kind v0.17.0 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.3.5
replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.4.0
Loading