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

OCPBUGS-20124: FastFix: Merge https://github.com/kubernetes/cloud-provider-openstack:release-1.25 into release-4.12 #220

Merged
merged 4 commits into from
Oct 12, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ Refer to [Getting Started Guide](/docs/developers-guide.md/) for setting up deve
Please join us on [Kubernetes provider-openstack slack channel](https://kubernetes.slack.com/messages/provider-openstack)

Project Co-Leads:
* @lxkong - Lingxian Kong
* @ramineni - Anusha Ramineni
* @chrigl - Christoph Glaubitz
* @dulek - Michał Dulko
* @jichenjc - Chen Ji
* @kayrus
* @zetaab - Jesse Haka

## License

Expand Down
9 changes: 7 additions & 2 deletions pkg/csi/cinder/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ func (cs *controllerServer) ControllerUnpublishVolume(ctx context.Context, req *
}

func (cs *controllerServer) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error) {
klog.V(4).Infof("ListVolumes: called with %+#v request", req)

if req.MaxEntries < 0 {
return nil, status.Error(codes.InvalidArgument, fmt.Sprintf(
Expand All @@ -297,7 +298,7 @@ func (cs *controllerServer) ListVolumes(ctx context.Context, req *csi.ListVolume
return nil, status.Error(codes.Internal, fmt.Sprintf("ListVolumes failed with error %v", err))
}

var ventries []*csi.ListVolumesResponse_Entry
ventries := make([]*csi.ListVolumesResponse_Entry, 0, len(vlist))
for _, v := range vlist {
ventry := csi.ListVolumesResponse_Entry{
Volume: &csi.Volume{
Expand All @@ -307,13 +308,16 @@ func (cs *controllerServer) ListVolumes(ctx context.Context, req *csi.ListVolume
}

status := &csi.ListVolumesResponse_VolumeStatus{}
status.PublishedNodeIds = make([]string, 0, len(v.Attachments))
for _, attachment := range v.Attachments {
status.PublishedNodeIds = append(status.PublishedNodeIds, attachment.ServerID)
}
ventry.Status = status

ventries = append(ventries, &ventry)
}

klog.V(4).Infof("ListVolumes: completed with %d entries and %q next token", len(ventries), nextPageToken)
return &csi.ListVolumesResponse{
Entries: ventries,
NextToken: nextPageToken,
Expand Down Expand Up @@ -479,7 +483,7 @@ func (cs *controllerServer) ListSnapshots(ctx context.Context, req *csi.ListSnap
return nil, status.Errorf(codes.Internal, "ListSnapshots failed with error %v", err)
}

var sentries []*csi.ListSnapshotsResponse_Entry
sentries := make([]*csi.ListSnapshotsResponse_Entry, 0, len(slist))
for _, v := range slist {
ctime := timestamppb.New(v.CreatedAt)
if err := ctime.CheckValid(); err != nil {
Expand Down Expand Up @@ -583,6 +587,7 @@ func (cs *controllerServer) ControllerGetVolume(ctx context.Context, req *csi.Co
}

status := &csi.ControllerGetVolumeResponse_VolumeStatus{}
status.PublishedNodeIds = make([]string, 0, len(volume.Attachments))
for _, attachment := range volume.Attachments {
status.PublishedNodeIds = append(status.PublishedNodeIds, attachment.ServerID)
}
Expand Down
4 changes: 3 additions & 1 deletion pkg/csi/cinder/controllerserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,9 @@ func TestListVolumes(t *testing.T) {
VolumeId: FakeVol3.ID,
CapacityBytes: int64(FakeVol3.Size * 1024 * 1024 * 1024),
},
Status: &csi.ListVolumesResponse_VolumeStatus{},
Status: &csi.ListVolumesResponse_VolumeStatus{
PublishedNodeIds: []string{},
},
},
},
NextToken: "",
Expand Down
4 changes: 2 additions & 2 deletions pkg/csi/cinder/openstack/openstack_snapshots.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ func (os *OpenStack) ListSnapshots(filters map[string]string) ([]snapshots.Snaps
}

if nextPageURL != "" {
queryParams, err := url.ParseQuery(nextPageURL)
pageURL, err := url.Parse(nextPageURL)
if err != nil {
return false, err
}
nextPageToken = queryParams.Get("marker")
nextPageToken = pageURL.Query().Get("marker")
}

return false, nil
Expand Down
4 changes: 2 additions & 2 deletions pkg/csi/cinder/openstack/openstack_volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ func (os *OpenStack) ListVolumes(limit int, startingToken string) ([]volumes.Vol
}

if nextPageURL != "" {
queryParams, err := url.ParseQuery(nextPageURL)
pageURL, err := url.Parse(nextPageURL)
if err != nil {
return false, err
}
nextPageToken = queryParams.Get("marker")
nextPageToken = pageURL.Query().Get("marker")
}

return false, nil
Expand Down
2 changes: 1 addition & 1 deletion tests/playbooks/roles/install-docker/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
docker_version: 5:19.03.15~3-0~ubuntu-focal
docker_version: 5:20.10.18~3-0~ubuntu-focal
2 changes: 1 addition & 1 deletion tests/playbooks/roles/install-docker/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# apt-get update; apt install -y docker-ce=<version>
- name: Install docker-ce
apt:
name: docker-ce={{ docker_version }}
name: docker-ce #={{ docker_version }}
state: present
update_cache: yes

Expand Down