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

Update component versions for CAPI, Kind, and other dependencies #383

Merged
merged 6 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Address review comments
- Move from k8s.io/utils/pointer to k8s.io/utils/ptr as pointer will
  be deprecated in the coming release.
  • Loading branch information
thunderboltsid committed Mar 8, 2024
commit 437c4c1af7b04fde1e042b22ec62ae0ec3a73d7c
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
k8s.io/apiextensions-apiserver v0.28.4
k8s.io/apimachinery v0.28.4
k8s.io/client-go v0.28.4
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2
k8s.io/utils v0.0.0-20240102154912-e7106e64919e
sigs.k8s.io/cluster-api v1.6.2
sigs.k8s.io/cluster-api/test v1.6.2
sigs.k8s.io/controller-runtime v0.16.5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1167,8 +1167,8 @@ k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5Ohx
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM=
k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 h1:qY1Ad8PODbnymg2pRbkyMT/ylpTrCM8P2RJ0yroCyIk=
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ=
k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
Expand Down
6 changes: 1 addition & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
//+kubebuilder:scaffold:imports

infrav1alpha4 "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1alpha4"
infrav1 "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1"
"github.com/nutanix-cloud-native/cluster-api-provider-nutanix/controllers"
//+kubebuilder:scaffold:imports
)

var (
Expand All @@ -53,14 +53,10 @@ var gitCommitHash string

func init() {
utilruntime.Must(clientgoscheme.AddToScheme(scheme))

utilruntime.Must(capiv1.AddToScheme(scheme))

utilruntime.Must(bootstrapv1.AddToScheme(scheme))

utilruntime.Must(infrav1alpha4.AddToScheme(scheme))
utilruntime.Must(infrav1.AddToScheme(scheme))

//+kubebuilder:scaffold:scheme
}

Expand Down
8 changes: 4 additions & 4 deletions test/e2e/capx_quick_start_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package e2e

import (
. "github.com/onsi/ginkgo/v2"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"
capi_e2e "sigs.k8s.io/cluster-api/test/e2e"
)

Expand All @@ -44,7 +44,7 @@ var _ = Describe("When following the Cluster API quick-start with ClusterClass",
BootstrapClusterProxy: bootstrapClusterProxy,
ArtifactFolder: artifactFolder,
SkipCleanup: skipCleanup,
Flavor: pointer.String("topology"),
Flavor: ptr.To("topology"),
}
})
})
Expand All @@ -58,7 +58,7 @@ var _ = Describe("When following the Cluster API quick-start with ClusterClass",
// BootstrapClusterProxy: bootstrapClusterProxy,
// ArtifactFolder: artifactFolder,
// SkipCleanup: skipCleanup,
// Flavor: pointer.String("ipv6"),
// Flavor: ptr.To("ipv6"),
// }
// })
// })
Expand All @@ -71,7 +71,7 @@ var _ = Describe("When following the Cluster API quick-start with ClusterClass",
// BootstrapClusterProxy: bootstrapClusterProxy,
// ArtifactFolder: artifactFolder,
// SkipCleanup: skipCleanup,
// Flavor: pointer.String("ignition"),
// Flavor: ptr.To("ignition"),
// }
// })
// })
19 changes: 9 additions & 10 deletions test/e2e/cluster_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ package e2e

import (
. "github.com/onsi/ginkgo/v2"
"k8s.io/utils/pointer"

"k8s.io/utils/ptr"
capi_e2e "sigs.k8s.io/cluster-api/test/e2e"
)

Expand All @@ -46,7 +45,7 @@ var _ = Describe("When upgrading a workload cluster and testing K8S conformance"
// BootstrapClusterProxy: bootstrapClusterProxy,
// ArtifactFolder: artifactFolder,
// SkipCleanup: skipCleanup,
// Flavor: pointer.String("topology"),
// Flavor: ptr.To("topology"),
// // This test is run in CI in parallel with other tests. To keep the test duration reasonable
// // the conformance tests are skipped.
// SkipConformanceTests: true,
Expand All @@ -65,8 +64,8 @@ var _ = Describe("When upgrading a workload cluster with a single control plane
// This test is run in CI in parallel with other tests. To keep the test duration reasonable
// the conformance tests are skipped.
SkipConformanceTests: true,
ControlPlaneMachineCount: pointer.Int64(1),
WorkerMachineCount: pointer.Int64(1),
ControlPlaneMachineCount: ptr.To(int64(1)),
WorkerMachineCount: ptr.To(int64(1)),
}
})
})
Expand All @@ -82,8 +81,8 @@ var _ = Describe("When upgrading a workload cluster with a HA control plane", La
// This test is run in CI in parallel with other tests. To keep the test duration reasonable
// the conformance tests are skipped.
SkipConformanceTests: true,
ControlPlaneMachineCount: pointer.Int64(3),
WorkerMachineCount: pointer.Int64(1),
ControlPlaneMachineCount: ptr.To(int64(3)),
WorkerMachineCount: ptr.To(int64(1)),
}
})
})
Expand All @@ -99,9 +98,9 @@ var _ = Describe("When upgrading a workload cluster with a HA control plane usin
// This test is run in CI in parallel with other tests. To keep the test duration reasonable
// the conformance tests are skipped.
SkipConformanceTests: true,
ControlPlaneMachineCount: pointer.Int64(3),
WorkerMachineCount: pointer.Int64(1),
Flavor: pointer.String("kcp-scale-in"),
ControlPlaneMachineCount: ptr.To(int64(3)),
WorkerMachineCount: ptr.To(int64(1)),
Flavor: ptr.To("kcp-scale-in"),
}
})
})
8 changes: 4 additions & 4 deletions test/e2e/md_scale_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"
capi_e2e "sigs.k8s.io/cluster-api/test/e2e"
"sigs.k8s.io/cluster-api/test/framework"
"sigs.k8s.io/cluster-api/test/framework/clusterctl"
Expand Down Expand Up @@ -96,16 +96,16 @@ var _ = Describe("When testing MachineDeployment scale up/down from 10 replicas
Namespace: namespace.Name,
ClusterName: fmt.Sprintf("%s-%s", specName, util.RandomString(6)),
KubernetesVersion: input.E2EConfig.GetVariable(KubernetesVersion),
ControlPlaneMachineCount: pointer.Int64(1),
WorkerMachineCount: pointer.Int64(10),
ControlPlaneMachineCount: ptr.To(int64(1)),
WorkerMachineCount: ptr.To(int64(10)),
},
ControlPlaneWaiters: input.ControlPlaneWaiters,
WaitForClusterIntervals: input.E2EConfig.GetIntervals(specName, "wait-cluster"),
WaitForControlPlaneIntervals: input.E2EConfig.GetIntervals(specName, "wait-control-plane"),
WaitForMachineDeployments: input.E2EConfig.GetIntervals(specName, "wait-worker-nodes"),
}, clusterResources)

Expect(clusterResources.MachineDeployments[0].Spec.Replicas).To(Equal(pointer.Int32(10)))
Expect(clusterResources.MachineDeployments[0].Spec.Replicas).To(Equal(ptr.To(int32(10))))

By("Scaling the MachineDeployment out to 20")
framework.ScaleAndWaitMachineDeployment(ctx, framework.ScaleAndWaitMachineDeploymentInput{
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/projects_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
"sigs.k8s.io/cluster-api/test/framework/clusterctl"

Expand Down Expand Up @@ -68,7 +68,7 @@ var _ = Describe("Nutanix projects", Label("capx-feature-test", "projects"), fun
invalidProjectNMT := testHelper.createDefaultNMT(clusterName, namespace.Name)
invalidProjectNMT.Spec.Template.Spec.Project = &infrav1.NutanixResourceIdentifier{
Type: "name",
Name: pointer.String(nonExistingProjectName),
Name: ptr.To(nonExistingProjectName),
}
testHelper.createCapiObject(ctx, createCapiObjectParams{
creator: bootstrapClusterProxy.GetClient(),
Expand Down
26 changes: 13 additions & 13 deletions test/e2e/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,14 @@ import (
"strings"
"time"

infrav1 "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1"
"github.com/nutanix-cloud-native/cluster-api-provider-nutanix/controllers"

credentialTypes "github.com/nutanix-cloud-native/prism-go-client/environment/credentials"
prismGoClientV3 "github.com/nutanix-cloud-native/prism-go-client/v3"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gstruct"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"
capiv1 "sigs.k8s.io/cluster-api/api/v1beta1"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
"sigs.k8s.io/cluster-api/test/framework"
Expand All @@ -47,6 +44,9 @@ import (
"sigs.k8s.io/cluster-api/util"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"

infrav1 "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1"
"github.com/nutanix-cloud-native/cluster-api-provider-nutanix/controllers"
)

const (
Expand Down Expand Up @@ -254,16 +254,16 @@ func (t testHelper) createUUIDNMT(ctx context.Context, clusterName, namespace st
MemorySize: resource.MustParse(defaultMemorySize),
Image: infrav1.NutanixResourceIdentifier{
Type: infrav1.NutanixIdentifierUUID,
UUID: pointer.String(imageUUID),
UUID: ptr.To(imageUUID),
},
Cluster: infrav1.NutanixResourceIdentifier{
Type: infrav1.NutanixIdentifierUUID,
UUID: pointer.String(clusterUUID),
UUID: ptr.To(clusterUUID),
},
Subnets: []infrav1.NutanixResourceIdentifier{
{
Type: infrav1.NutanixIdentifierUUID,
UUID: pointer.String(subnetUUID),
UUID: ptr.To(subnetUUID),
},
},
SystemDiskSize: resource.MustParse(defaultSystemDiskSize),
Expand Down Expand Up @@ -426,8 +426,8 @@ func (t testHelper) deployCluster(params deployClusterParams, clusterResources *
Namespace: params.namespace.Name,
ClusterName: params.clusterName,
KubernetesVersion: t.e2eConfig.GetVariable(KubernetesVersion),
ControlPlaneMachineCount: pointer.Int64(1),
WorkerMachineCount: pointer.Int64(1),
ControlPlaneMachineCount: ptr.To(int64(1)),
WorkerMachineCount: ptr.To(int64(1)),
}

t.createClusterFromConfig(ctx, clusterctl.ApplyClusterTemplateAndWaitInput{
Expand All @@ -449,8 +449,8 @@ func (t testHelper) deployClusterAndWait(params deployClusterParams, clusterReso
Namespace: params.namespace.Name,
ClusterName: params.clusterName,
KubernetesVersion: t.e2eConfig.GetVariable(KubernetesVersion),
ControlPlaneMachineCount: pointer.Int64(1),
WorkerMachineCount: pointer.Int64(1),
ControlPlaneMachineCount: ptr.To(int64(1)),
WorkerMachineCount: ptr.To(int64(1)),
}

clusterctl.ApplyClusterTemplateAndWait(ctx, clusterctl.ApplyClusterTemplateAndWaitInput{
Expand Down Expand Up @@ -537,15 +537,15 @@ func (t testHelper) getNutanixResourceIdentifierFromEnv(envVarKey string) infrav
Expect(envVarValue).ToNot(BeEmpty(), "expected environment variable %s to be set", envVarKey)
return infrav1.NutanixResourceIdentifier{
Type: nameType,
Name: pointer.String(envVarValue),
Name: ptr.To(envVarValue),
}
}

func (t testHelper) getNutanixResourceIdentifierFromE2eConfig(variableKey string) infrav1.NutanixResourceIdentifier {
variableValue := t.getVariableFromE2eConfig(variableKey)
return infrav1.NutanixResourceIdentifier{
Type: nameType,
Name: pointer.String(variableValue),
Name: ptr.To(variableValue),
}
}

Expand Down