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

Syncing latest changes from upstream devel for ceph-csi #300

Merged
merged 4 commits into from
Apr 30, 2024
Merged
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 build.env
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ BASE_IMAGE=quay.io/ceph/ceph:v18
CEPH_VERSION=reef

# standard Golang options
GOLANG_VERSION=1.21.9
GOLANG_VERSION=1.22.2
GO111MODULE=on

# commitlint version
Expand Down
25 changes: 10 additions & 15 deletions e2e/cephfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,6 @@ var _ = Describe(cephfsType, func() {
}

for kmsID, kmsConf := range kmsToTest {
kmsID := kmsID
kmsConf := kmsConf
By("create a storageclass with pool and an encrypted PVC then bind it to an app with "+kmsID, func() {
scOpts := map[string]string{
"encrypted": "true",
Expand Down Expand Up @@ -876,7 +874,7 @@ var _ = Describe(cephfsType, func() {
}
app.Namespace = f.UniqueName
// create PVC and app
for i := 0; i < totalCount; i++ {
for i := range totalCount {
name := fmt.Sprintf("%s%d", f.UniqueName, i)
err = createPVCAndApp(name, f, pvc, app, deployTimeout)
if err != nil {
Expand All @@ -891,7 +889,7 @@ var _ = Describe(cephfsType, func() {
validateSubvolumeCount(f, totalCount, fileSystemName, subvolumegroup)
validateOmapCount(f, totalCount, cephfsType, metadataPool, volumesType)
// delete PVC and app
for i := 0; i < totalCount; i++ {
for i := range totalCount {
name := fmt.Sprintf("%s%d", f.UniqueName, i)
err = deletePVCAndApp(name, f, pvc, app)
if err != nil {
Expand Down Expand Up @@ -1454,7 +1452,7 @@ var _ = Describe(cephfsType, func() {
snap.Namespace = f.UniqueName
snap.Spec.Source.PersistentVolumeClaimName = &pvc.Name
// create snapshot
for i := 0; i < totalCount; i++ {
for i := range totalCount {
go func(n int, s snapapi.VolumeSnapshot) {
s.Name = fmt.Sprintf("%s%d", f.UniqueName, n)
wgErrs[n] = createSnapshot(&s, deployTimeout)
Expand Down Expand Up @@ -1490,7 +1488,7 @@ var _ = Describe(cephfsType, func() {

// create multiple PVC from same snapshot
wg.Add(totalCount)
for i := 0; i < totalCount; i++ {
for i := range totalCount {
go func(n int, p v1.PersistentVolumeClaim, a v1.Pod) {
name := fmt.Sprintf("%s%d", f.UniqueName, n)
wgErrs[n] = createPVCAndApp(name, f, &p, &a, deployTimeout)
Expand Down Expand Up @@ -1522,7 +1520,7 @@ var _ = Describe(cephfsType, func() {

wg.Add(totalCount)
// delete clone and app
for i := 0; i < totalCount; i++ {
for i := range totalCount {
go func(n int, p v1.PersistentVolumeClaim, a v1.Pod) {
name := fmt.Sprintf("%s%d", f.UniqueName, n)
p.Spec.DataSource.Name = name
Expand Down Expand Up @@ -1550,7 +1548,7 @@ var _ = Describe(cephfsType, func() {
// create clones from different snapshots and bind it to an
// app
wg.Add(totalCount)
for i := 0; i < totalCount; i++ {
for i := range totalCount {
go func(n int, p v1.PersistentVolumeClaim, a v1.Pod) {
name := fmt.Sprintf("%s%d", f.UniqueName, n)
p.Spec.DataSource.Name = name
Expand Down Expand Up @@ -1583,7 +1581,7 @@ var _ = Describe(cephfsType, func() {

wg.Add(totalCount)
// delete snapshot
for i := 0; i < totalCount; i++ {
for i := range totalCount {
go func(n int, s snapapi.VolumeSnapshot) {
s.Name = fmt.Sprintf("%s%d", f.UniqueName, n)
wgErrs[n] = deleteSnapshot(&s, deployTimeout)
Expand All @@ -1607,7 +1605,7 @@ var _ = Describe(cephfsType, func() {

wg.Add(totalCount)
// delete clone and app
for i := 0; i < totalCount; i++ {
for i := range totalCount {
go func(n int, p v1.PersistentVolumeClaim, a v1.Pod) {
name := fmt.Sprintf("%s%d", f.UniqueName, n)
p.Spec.DataSource.Name = name
Expand Down Expand Up @@ -1649,7 +1647,6 @@ var _ = Describe(cephfsType, func() {

if testCephFSFscrypt {
for _, kmsID := range []string{"secrets-metadata-test", "vault-test"} {
kmsID := kmsID
By("checking encrypted snapshot-backed volume with KMS "+kmsID, func() {
err := deleteResource(cephFSExamplePath + "storageclass.yaml")
if err != nil {
Expand Down Expand Up @@ -2234,8 +2231,6 @@ var _ = Describe(cephfsType, func() {
"vault-test": vaultKMS,
}
for kmsID, kmsConf := range kmsToTest {
kmsID := kmsID
kmsConf := kmsConf
By("create an encrypted PVC-PVC clone and bind it to an app with "+kmsID, func() {
err := deleteResource(cephFSExamplePath + "storageclass.yaml")
if err != nil {
Expand Down Expand Up @@ -2313,7 +2308,7 @@ var _ = Describe(cephfsType, func() {
appClone.Namespace = f.UniqueName
wg.Add(totalCount)
// create clone and bind it to an app
for i := 0; i < totalCount; i++ {
for i := range totalCount {
go func(n int, p v1.PersistentVolumeClaim, a v1.Pod) {
name := fmt.Sprintf("%s%d", f.UniqueName, n)
wgErrs[n] = createPVCAndApp(name, f, &p, &a, deployTimeout)
Expand Down Expand Up @@ -2345,7 +2340,7 @@ var _ = Describe(cephfsType, func() {

wg.Add(totalCount)
// delete clone and app
for i := 0; i < totalCount; i++ {
for i := range totalCount {
go func(n int, p v1.PersistentVolumeClaim, a v1.Pod) {
name := fmt.Sprintf("%s%d", f.UniqueName, n)
p.Spec.DataSource.Name = name
Expand Down
1 change: 0 additions & 1 deletion e2e/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ Error from server (AlreadyExists): error when creating "STDIN": deployments.apps
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
if got := getStdErr(tt.errString); got != tt.expected {
Expand Down
20 changes: 10 additions & 10 deletions e2e/nfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ var _ = Describe("nfs", func() {
}
app.Namespace = f.UniqueName
// create PVC and app
for i := 0; i < totalCount; i++ {
for i := range totalCount {
name := fmt.Sprintf("%s%d", f.UniqueName, i)
err = createPVCAndApp(name, f, pvc, app, deployTimeout)
if err != nil {
Expand All @@ -542,7 +542,7 @@ var _ = Describe("nfs", func() {

validateSubvolumeCount(f, totalCount, fileSystemName, defaultSubvolumegroup)
// delete PVC and app
for i := 0; i < totalCount; i++ {
for i := range totalCount {
name := fmt.Sprintf("%s%d", f.UniqueName, i)
err = deletePVCAndApp(name, f, pvc, app)
if err != nil {
Expand Down Expand Up @@ -699,7 +699,7 @@ var _ = Describe("nfs", func() {
snap.Namespace = f.UniqueName
snap.Spec.Source.PersistentVolumeClaimName = &pvc.Name
// create snapshot
for i := 0; i < totalCount; i++ {
for i := range totalCount {
go func(n int, s snapapi.VolumeSnapshot) {
s.Name = fmt.Sprintf("%s%d", f.UniqueName, n)
wgErrs[n] = createSnapshot(&s, deployTimeout)
Expand Down Expand Up @@ -736,7 +736,7 @@ var _ = Describe("nfs", func() {

// create multiple PVC from same snapshot
wg.Add(totalCount)
for i := 0; i < totalCount; i++ {
for i := range totalCount {
go func(n int, p v1.PersistentVolumeClaim, a v1.Pod) {
name := fmt.Sprintf("%s%d", f.UniqueName, n)
wgErrs[n] = createPVCAndApp(name, f, &p, &a, deployTimeout)
Expand Down Expand Up @@ -790,7 +790,7 @@ var _ = Describe("nfs", func() {

wg.Add(totalCount)
// delete clone and app
for i := 0; i < totalCount; i++ {
for i := range totalCount {
go func(n int, p v1.PersistentVolumeClaim, a v1.Pod) {
name := fmt.Sprintf("%s%d", f.UniqueName, n)
p.Spec.DataSource.Name = name
Expand All @@ -817,7 +817,7 @@ var _ = Describe("nfs", func() {
validateOmapCount(f, totalCount, cephfsType, metadataPool, snapsType)
// create clones from different snapshots and bind it to an app
wg.Add(totalCount)
for i := 0; i < totalCount; i++ {
for i := range totalCount {
go func(n int, p v1.PersistentVolumeClaim, a v1.Pod) {
name := fmt.Sprintf("%s%d", f.UniqueName, n)
p.Spec.DataSource.Name = name
Expand Down Expand Up @@ -872,7 +872,7 @@ var _ = Describe("nfs", func() {

wg.Add(totalCount)
// delete snapshot
for i := 0; i < totalCount; i++ {
for i := range totalCount {
go func(n int, s snapapi.VolumeSnapshot) {
s.Name = fmt.Sprintf("%s%d", f.UniqueName, n)
wgErrs[n] = deleteSnapshot(&s, deployTimeout)
Expand All @@ -896,7 +896,7 @@ var _ = Describe("nfs", func() {

wg.Add(totalCount)
// delete clone and app
for i := 0; i < totalCount; i++ {
for i := range totalCount {
go func(n int, p v1.PersistentVolumeClaim, a v1.Pod) {
name := fmt.Sprintf("%s%d", f.UniqueName, n)
p.Spec.DataSource.Name = name
Expand Down Expand Up @@ -980,7 +980,7 @@ var _ = Describe("nfs", func() {
appClone.Labels = label
wg.Add(totalCount)
// create clone and bind it to an app
for i := 0; i < totalCount; i++ {
for i := range totalCount {
go func(n int, p v1.PersistentVolumeClaim, a v1.Pod) {
name := fmt.Sprintf("%s%d", f.UniqueName, n)
wgErrs[n] = createPVCAndApp(name, f, &p, &a, deployTimeout)
Expand Down Expand Up @@ -1036,7 +1036,7 @@ var _ = Describe("nfs", func() {

wg.Add(totalCount)
// delete clone and app
for i := 0; i < totalCount; i++ {
for i := range totalCount {
go func(n int, p v1.PersistentVolumeClaim, a v1.Pod) {
name := fmt.Sprintf("%s%d", f.UniqueName, n)
p.Spec.DataSource.Name = name
Expand Down
14 changes: 7 additions & 7 deletions e2e/rbd.go
Original file line number Diff line number Diff line change
Expand Up @@ -2721,7 +2721,7 @@ var _ = Describe("RBD", func() {
}
app.Namespace = f.UniqueName
// create PVC and app
for i := 0; i < totalCount; i++ {
for i := range totalCount {
name := fmt.Sprintf("%s%d", f.UniqueName, i)
err := createPVCAndApp(name, f, pvc, app, deployTimeout)
if err != nil {
Expand All @@ -2733,7 +2733,7 @@ var _ = Describe("RBD", func() {
validateRBDImageCount(f, totalCount, defaultRBDPool)
validateOmapCount(f, totalCount, rbdType, defaultRBDPool, volumesType)
// delete PVC and app
for i := 0; i < totalCount; i++ {
for i := range totalCount {
name := fmt.Sprintf("%s%d", f.UniqueName, i)
err := deletePVCAndApp(name, f, pvc, app)
if err != nil {
Expand Down Expand Up @@ -3316,7 +3316,7 @@ var _ = Describe("RBD", func() {
appClone.Spec.Volumes[0].PersistentVolumeClaim.ClaimName = pvcClone.Name

// create PVC and app
for i := 0; i < totalCount; i++ {
for i := range totalCount {
name := fmt.Sprintf("%s%d", f.UniqueName, i)
label := map[string]string{
"app": name,
Expand All @@ -3329,7 +3329,7 @@ var _ = Describe("RBD", func() {
}
}

for i := 0; i < totalCount; i++ {
for i := range totalCount {
name := fmt.Sprintf("%s%d", f.UniqueName, i)
opt := metav1.ListOptions{
LabelSelector: "app=" + name,
Expand All @@ -3348,7 +3348,7 @@ var _ = Describe("RBD", func() {
}

// delete app
for i := 0; i < totalCount; i++ {
for i := range totalCount {
name := fmt.Sprintf("%s%d", f.UniqueName, i)
appClone.Name = name
err = deletePod(appClone.Name, appClone.Namespace, f.ClientSet, deployTimeout)
Expand Down Expand Up @@ -3552,7 +3552,7 @@ var _ = Describe("RBD", func() {
// validate created backend rbd images
validateRBDImageCount(f, 1, defaultRBDPool)
validateOmapCount(f, 1, rbdType, defaultRBDPool, volumesType)
for i := 0; i < snapChainDepth; i++ {
for i := range snapChainDepth {
var pvcClone, smartClonePVC *v1.PersistentVolumeClaim
snap := getSnapshot(snapshotPath)
snap.Name = fmt.Sprintf("%s-%d", snap.Name, i)
Expand Down Expand Up @@ -3722,7 +3722,7 @@ var _ = Describe("RBD", func() {
validateRBDImageCount(f, 1, defaultRBDPool)
validateOmapCount(f, 1, rbdType, defaultRBDPool, volumesType)

for i := 0; i < cloneChainDepth; i++ {
for i := range cloneChainDepth {
var pvcClone *v1.PersistentVolumeClaim
pvcClone, err = loadPVC(pvcSmartClonePath)
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions e2e/rbd_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ func validateCloneInDifferentPool(f *framework.Framework, snapshotPool, cloneSc,
snap.Spec.Source.PersistentVolumeClaimName = &pvc.Name
// create snapshot
wg.Add(totalCount)
for i := 0; i < totalCount; i++ {
for i := range totalCount {
go func(n int, s snapapi.VolumeSnapshot) {
s.Name = fmt.Sprintf("%s%d", f.UniqueName, n)
wgErrs[n] = createSnapshot(&s, deployTimeout)
Expand Down Expand Up @@ -416,7 +416,7 @@ func validateCloneInDifferentPool(f *framework.Framework, snapshotPool, cloneSc,
pvcClone.Spec.DataSource.Name = fmt.Sprintf("%s%d", f.UniqueName, 0)
// create multiple PVCs from same snapshot
wg.Add(totalCount)
for i := 0; i < totalCount; i++ {
for i := range totalCount {
go func(n int, p v1.PersistentVolumeClaim, a v1.Pod) {
name := fmt.Sprintf("%s%d", f.UniqueName, n)
wgErrs[n] = createPVCAndApp(name, f, &p, &a, deployTimeout)
Expand All @@ -440,7 +440,7 @@ func validateCloneInDifferentPool(f *framework.Framework, snapshotPool, cloneSc,
}
wg.Add(totalCount)
// delete clone and app
for i := 0; i < totalCount; i++ {
for i := range totalCount {
go func(n int, p v1.PersistentVolumeClaim, a v1.Pod) {
name := fmt.Sprintf("%s%d", f.UniqueName, n)
p.Spec.DataSource.Name = name
Expand All @@ -464,7 +464,7 @@ func validateCloneInDifferentPool(f *framework.Framework, snapshotPool, cloneSc,

wg.Add(totalCount)
// delete snapshot
for i := 0; i < totalCount; i++ {
for i := range totalCount {
go func(n int, s snapapi.VolumeSnapshot) {
s.Name = fmt.Sprintf("%s%d", f.UniqueName, n)
wgErrs[n] = deleteSnapshot(&s, deployTimeout)
Expand Down
Loading