Skip to content

Commit

Permalink
migrate to upstream gophercloud so go get works again
Browse files Browse the repository at this point in the history
  • Loading branch information
sbueringer committed Oct 8, 2019
1 parent ce58f38 commit 4967210
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ based on [k8s.io/sample-cli-plugin](https://github.com/kubernetes/kubernetes/tre

Just execute the following and make sure `$GOPATH/bin` is in your `$PATH`:
````
go get github.com/sbueringer/kubectl-openstack-plugin/cmd/kubectl-openstack
GO111MODULE=on go get github.com/sbueringer/kubectl-openstack-plugin/cmd/kubectl-openstack
````

Note: this currently only works without GO111MODULE=on because a replace directive for gophercloud is used. (see also: https://github.com/golang/go/issues/30354)
Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/sbueringer/kubectl-openstack-plugin
require (
github.com/gogo/protobuf v1.3.0 // indirect
github.com/googleapis/gnostic v0.3.1 // indirect
github.com/gophercloud/gophercloud v0.4.0
github.com/gophercloud/gophercloud v0.4.1-0.20191008023454-1effcf51002d
github.com/mattn/go-runewidth v0.0.3 // indirect
github.com/olekukonko/tablewriter v0.0.0-20180912035003-be2c049b30cc
github.com/spf13/cobra v0.0.5
Expand All @@ -17,6 +17,4 @@ require (
k8s.io/utils v0.0.0-20190923111123-69764acb6e8e // indirect
)

replace github.com/gophercloud/gophercloud v0.4.0 => github.com/sbueringer/gophercloud v0.4.0

go 1.13
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsC
github.com/googleapis/gnostic v0.3.1 h1:WeAefnSUHlBb0iJKwxFDZdbfGwkd7xRNuV+IpXMJhYk=
github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU=
github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8=
github.com/gophercloud/gophercloud v0.4.1-0.20191008023454-1effcf51002d h1:11UfK10mn0Zsh1KBsUgX2eoPhhVl21d7osW6M0ETDGI=
github.com/gophercloud/gophercloud v0.4.1-0.20191008023454-1effcf51002d/go.mod h1:b1k/BkBA9smzYde6p6zYLIe5JNAEoJzUWaIRh+9A/j0=
github.com/gregjones/httpcache v0.0.0-20170728041850-787624de3eb7 h1:6TSoaYExHper8PYsJu23GWVNOyYRCSnIFyxKgLSZ54w=
github.com/gregjones/httpcache v0.0.0-20170728041850-787624de3eb7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
Expand Down Expand Up @@ -144,8 +146,6 @@ github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/sbueringer/gophercloud v0.4.0 h1:+9wP+Ypv1goqiEHsgNEOyGPUrRXBelxhnK6tzkTFoug=
github.com/sbueringer/gophercloud v0.4.0/go.mod h1:b1k/BkBA9smzYde6p6zYLIe5JNAEoJzUWaIRh+9A/j0=
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
Expand Down
8 changes: 2 additions & 6 deletions pkg/cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,8 @@ func (o *ServerOptions) getPrettyServerList(context string, nodes map[string]v1.
var attachedVolumes []string
overallNovaAttachmentCount := 0
for _, attachedVolume := range s.AttachedVolumes {
for key, volumeID := range attachedVolume {
if key == "id" {
attachmentCount[volumeID]++
overallNovaAttachmentCount++
}
}
attachmentCount[attachedVolume.ID]++
overallNovaAttachmentCount++
}
for a := range attachmentCount {
attachments = append(attachments, a)
Expand Down
6 changes: 2 additions & 4 deletions pkg/cmd/volume-fix.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,8 @@ func (o *VolumesFixOptions) runWithConfig(context string) error {
var srvs []servers.Server
for _, srv := range serversMap {
for _, attachedVolume := range srv.AttachedVolumes {
for key, volumeID := range attachedVolume {
if key == "id" && volumeID == vID {
srvs = append(srvs, srv)
}
if attachedVolume.ID == vID {
srvs = append(srvs, srv)
}
}
}
Expand Down

0 comments on commit 4967210

Please sign in to comment.