Skip to content

Commit

Permalink
More comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriziopandini committed Jul 2, 2024
1 parent a720c60 commit 1cf40eb
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 21 deletions.
4 changes: 2 additions & 2 deletions 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.7.0-rc.0.0.20240617064349-5b6043e1b6ec
replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.7.0-rc.0.0.20240701062357-f57b8c8ef777

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 Expand Up @@ -40,7 +40,7 @@ require (
k8s.io/component-base v0.30.2
k8s.io/klog/v2 v2.120.1
k8s.io/utils v0.0.0-20231127182322-b307cd553661
sigs.k8s.io/cluster-api v1.7.0-rc.0.0.20240610140608-2e3860ac7408
sigs.k8s.io/cluster-api v1.7.0-rc.0.0.20240701062357-f57b8c8ef777
sigs.k8s.io/controller-runtime v0.18.4
sigs.k8s.io/kustomize/api v0.17.2
sigs.k8s.io/kustomize/kyaml v0.17.1
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.7.0-rc.0.0.20240617064349-5b6043e1b6ec h1:ikgHzieJg7LTJjvL/o4gcs8pcGBLwXyvuRvrC4Uj7kk=
sigs.k8s.io/cluster-api v1.7.0-rc.0.0.20240617064349-5b6043e1b6ec/go.mod h1:tDxEz5a0levoOzLKny7JMW5S7g2P4fKYHNOMsS9IH/c=
sigs.k8s.io/cluster-api v1.7.0-rc.0.0.20240701062357-f57b8c8ef777 h1:GBOytXqP37lSBbEo3O6NVK3KwJ4B2q0apxyNobkiBNA=
sigs.k8s.io/cluster-api v1.7.0-rc.0.0.20240701062357-f57b8c8ef777/go.mod h1:IzizeknMhBnwJrdEj5tDpheegvn5xZn8n2gLxKvv7/A=
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
13 changes: 6 additions & 7 deletions test/e2e/ownerrefs_finalizers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ var _ = Describe("Ensure OwnerReferences and Finalizers are resilient [vcsim] [s
VSphereReferenceAssertions(),
)
// This check ensures that finalizers are resilient - i.e. correctly re-reconciled, when removed.
// Note: we are not checking finalizers on VirtualMachine (finalizers are added by VM-Operator / vcsim controller)
// as well as other VM Operaror related kinds.
By("Checking that finalizers are resilient")
framework.ValidateFinalizersResilience(ctx, proxy, namespace, clusterName, FilterObjectsWithKindAndName(clusterName),
framework.CoreFinalizersAssertionWithLegacyClusters,
Expand All @@ -129,6 +131,8 @@ var _ = Describe("Ensure OwnerReferences and Finalizers are resilient [vcsim] [s

// This check ensures that the resourceVersions are stable, i.e. it verifies there are no
// continuous reconciles when everything should be stable.
// Note: we are not checking resourceVersions on VirtualMachine (reconciled by VM-Operator)
// as well as other VM Operaror related kinds.
By("Checking that resourceVersions are stable")
framework.ValidateResourceVersionStable(ctx, proxy, namespace, FilterObjectsWithKindAndName(clusterName))
},
Expand All @@ -155,6 +159,7 @@ var (
// Need custom Kubernetes assertions for secrets. Secrets in the CAPV tests can also be owned by the vSphereCluster.
"Secret": func(s types.NamespacedName, owners []metav1.OwnerReference) error {
// When using vcsim CRS cannot be applied (not supported by the fake API server), so ignoring all the Secrets that should be deployed by CRS.
// TODO: re-validate/remove when we bump to CAPI 1.7.3 which includes https://github.com/kubernetes-sigs/cluster-api/pull/10756.
if testTarget == VCSimTestTarget {
if s.Name == csiConfigSecretName || s.Name == cpiCredentialSecretName {
return nil
Expand All @@ -174,6 +179,7 @@ var (
},
"ConfigMap": func(_ types.NamespacedName, owners []metav1.OwnerReference) error {
// When using vcsim CRS cannot be applied (not supported by the fake API server), so ignoring all the ConfigMaps that should be deployed by CRS.
// TODO: re-validate/remove when we bump to CAPI 1.7.3 which includes https://github.com/kubernetes-sigs/cluster-api/pull/10756.
if testTarget == VCSimTestTarget {
return nil
}
Expand Down Expand Up @@ -446,13 +452,6 @@ func FilterObjectsWithKindAndName(clusterName string) func(u unstructured.Unstru
f := clusterctlcluster.FilterClusterObjectsWithNameFilter(clusterName)

return func(u unstructured.Unstructured) bool {
// When using vcsim CRS cannot be applied (not supported by the fake API server), so ignoring.
if testTarget == VCSimTestTarget {
if u.GetKind() == "ClusterResourceSet" {
return false
}
}

// Following objects are for vm-operator (not managed by CAPV), so checking finalizers/resourceVersion is not relevant.
// Note: we are excluding also VirtualMachines, which instead are considered for the ownerReference tests.
if testMode == SupervisorTestMode {
Expand Down
8 changes: 4 additions & 4 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.7.0-rc.0.0.20240617064349-5b6043e1b6ec
replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.7.0-rc.0.0.20240701062357-f57b8c8ef777

replace sigs.k8s.io/cluster-api/test => sigs.k8s.io/cluster-api/test v1.7.0-rc.0.0.20240617064349-5b6043e1b6ec
replace sigs.k8s.io/cluster-api/test => sigs.k8s.io/cluster-api/test v1.7.0-rc.0.0.20240701062357-f57b8c8ef777

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

Expand Down Expand Up @@ -32,7 +32,7 @@ require (
k8s.io/component-base v0.30.2
k8s.io/klog/v2 v2.120.1
k8s.io/utils v0.0.0-20231127182322-b307cd553661
sigs.k8s.io/cluster-api v1.7.0-rc.0.0.20240617064349-5b6043e1b6ec
sigs.k8s.io/cluster-api v1.7.0-rc.0.0.20240701062357-f57b8c8ef777
sigs.k8s.io/cluster-api-provider-vsphere v0.0.0-00010101000000-000000000000
sigs.k8s.io/cluster-api/test v0.0.0-00010101000000-000000000000
sigs.k8s.io/controller-runtime v0.18.4
Expand Down Expand Up @@ -62,7 +62,7 @@ require (
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/docker v26.1.4+incompatible // indirect
github.com/docker/docker v27.0.1+incompatible // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/drone/envsubst/v2 v2.0.0-20210730161058-179042472c46 // indirect
Expand Down
12 changes: 6 additions & 6 deletions test/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
github.com/docker/docker v26.1.4+incompatible h1:vuTpXDuoga+Z38m1OZHzl7NKisKWaWlhjQk7IDPSLsU=
github.com/docker/docker v26.1.4+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v27.0.1+incompatible h1:AbszR+lCnR3f297p/g0arbQoyhAkImxQOR/XO9YZeIg=
github.com/docker/docker v27.0.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c=
github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc=
github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw=
Expand Down Expand Up @@ -1091,10 +1091,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.7.0-rc.0.0.20240617064349-5b6043e1b6ec h1:ikgHzieJg7LTJjvL/o4gcs8pcGBLwXyvuRvrC4Uj7kk=
sigs.k8s.io/cluster-api v1.7.0-rc.0.0.20240617064349-5b6043e1b6ec/go.mod h1:tDxEz5a0levoOzLKny7JMW5S7g2P4fKYHNOMsS9IH/c=
sigs.k8s.io/cluster-api/test v1.7.0-rc.0.0.20240617064349-5b6043e1b6ec h1:D4aMcg7ujLXt+2FatZBRdF8cwXrxmcb4+8PBNyD/fks=
sigs.k8s.io/cluster-api/test v1.7.0-rc.0.0.20240617064349-5b6043e1b6ec/go.mod h1:auf4+RhO9P5jR+6xetig4ClXfp0UmALrhV34/WVbja0=
sigs.k8s.io/cluster-api v1.7.0-rc.0.0.20240701062357-f57b8c8ef777 h1:GBOytXqP37lSBbEo3O6NVK3KwJ4B2q0apxyNobkiBNA=
sigs.k8s.io/cluster-api v1.7.0-rc.0.0.20240701062357-f57b8c8ef777/go.mod h1:IzizeknMhBnwJrdEj5tDpheegvn5xZn8n2gLxKvv7/A=
sigs.k8s.io/cluster-api/test v1.7.0-rc.0.0.20240701062357-f57b8c8ef777 h1:Oe+T2sUD2IF/4FnCjvHuFk/SazgZRlT2wKdmJLbLQMI=
sigs.k8s.io/cluster-api/test v1.7.0-rc.0.0.20240701062357-f57b8c8ef777/go.mod h1:efkFHwm+FS5rTsLQjj02U4qPWj1xOCufya3axC8zNwQ=
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

0 comments on commit 1cf40eb

Please sign in to comment.