Skip to content

Commit

Permalink
Merge pull request kubernetes-csi#40 from sbezverk/alpha_to_beta
Browse files Browse the repository at this point in the history
Alpha to beta
  • Loading branch information
lpabon authored Mar 22, 2018
2 parents 4e878d7 + 1e3fee6 commit f759283
Show file tree
Hide file tree
Showing 890 changed files with 6,889 additions and 19,423 deletions.
49 changes: 13 additions & 36 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@

[[constraint]]
name = "k8s.io/client-go"
version = "6.0.0"
branch = "master"
4 changes: 2 additions & 2 deletions cmd/csi-attacher/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func main() {
if supportsAttach {
pvLister := factory.Core().V1().PersistentVolumes().Lister()
nodeLister := factory.Core().V1().Nodes().Lister()
vaLister := factory.Storage().V1alpha1().VolumeAttachments().Lister()
vaLister := factory.Storage().V1beta1().VolumeAttachments().Lister()
handler = controller.NewCSIHandler(clientset, attacher, csiConn, pvLister, nodeLister, vaLister)
glog.V(2).Infof("CSI driver supports ControllerPublishUnpublish, using real CSI handler")
} else {
Expand All @@ -135,7 +135,7 @@ func main() {
clientset,
attacher,
handler,
factory.Storage().V1alpha1().VolumeAttachments(),
factory.Storage().V1beta1().VolumeAttachments(),
factory.Core().V1().PersistentVolumes(),
)

Expand Down
6 changes: 3 additions & 3 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ import (
"github.com/golang/glog"

"k8s.io/api/core/v1"
storage "k8s.io/api/storage/v1alpha1"
storage "k8s.io/api/storage/v1beta1"
apierrs "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/util/wait"
coreinformers "k8s.io/client-go/informers/core/v1"
storageinformers "k8s.io/client-go/informers/storage/v1alpha1"
storageinformers "k8s.io/client-go/informers/storage/v1beta1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/kubernetes/scheme"
corev1 "k8s.io/client-go/kubernetes/typed/core/v1"
corelisters "k8s.io/client-go/listers/core/v1"
storagelisters "k8s.io/client-go/listers/storage/v1alpha1"
storagelisters "k8s.io/client-go/listers/storage/v1beta1"
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/tools/record"
"k8s.io/client-go/util/workqueue"
Expand Down
10 changes: 5 additions & 5 deletions pkg/controller/csi_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ import (
"github.com/golang/glog"

"k8s.io/api/core/v1"
storage "k8s.io/api/storage/v1alpha1"
storage "k8s.io/api/storage/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/kubernetes"
corelisters "k8s.io/client-go/listers/core/v1"
storagelisters "k8s.io/client-go/listers/storage/v1alpha1"
storagelisters "k8s.io/client-go/listers/storage/v1beta1"
"k8s.io/client-go/util/workqueue"

"github.com/kubernetes-csi/external-attacher/pkg/connection"
Expand Down Expand Up @@ -163,7 +163,7 @@ func (h *csiHandler) addVAFinalizer(va *storage.VolumeAttachment) (*storage.Volu
clone := va.DeepCopy()
clone.Finalizers = append(clone.Finalizers, finalizerName)
// TODO: use patch to save us from VersionError
newVA, err := h.client.StorageV1alpha1().VolumeAttachments().Update(clone)
newVA, err := h.client.StorageV1beta1().VolumeAttachments().Update(clone)
if err != nil {
return va, err
}
Expand Down Expand Up @@ -315,7 +315,7 @@ func (h *csiHandler) saveAttachError(va *storage.VolumeAttachment, err error) (*
Message: err.Error(),
Time: metav1.Now(),
}
newVa, err := h.client.StorageV1alpha1().VolumeAttachments().Update(clone)
newVa, err := h.client.StorageV1beta1().VolumeAttachments().Update(clone)
if err != nil {
return va, err
}
Expand All @@ -330,7 +330,7 @@ func (h *csiHandler) saveDetachError(va *storage.VolumeAttachment, err error) (*
Message: err.Error(),
Time: metav1.Now(),
}
newVa, err := h.client.StorageV1alpha1().VolumeAttachments().Update(clone)
newVa, err := h.client.StorageV1beta1().VolumeAttachments().Update(clone)
if err != nil {
return va, err
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/controller/csi_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/kubernetes-csi/external-attacher/pkg/connection"

"k8s.io/api/core/v1"
storage "k8s.io/api/storage/v1alpha1"
storage "k8s.io/api/storage/v1beta1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand All @@ -46,7 +46,7 @@ func csiHandlerFactory(client kubernetes.Interface, informerFactory informers.Sh
csi,
informerFactory.Core().V1().PersistentVolumes().Lister(),
informerFactory.Core().V1().Nodes().Lister(),
informerFactory.Storage().V1alpha1().VolumeAttachments().Lister())
informerFactory.Storage().V1beta1().VolumeAttachments().Lister())
}

func pv() *v1.PersistentVolume {
Expand Down Expand Up @@ -104,7 +104,7 @@ func node() *v1.Node {
func TestCSIHandler(t *testing.T) {
vaGroupResourceVersion := schema.GroupVersionResource{
Group: storage.GroupName,
Version: "v1alpha1",
Version: "v1beta1",
Resource: "volumeattachments",
}
pvGroupResourceVersion := schema.GroupVersionResource{
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/framework_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"github.com/kubernetes-csi/external-attacher/pkg/connection"

"k8s.io/api/core/v1"
storage "k8s.io/api/storage/v1alpha1"
storage "k8s.io/api/storage/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/informers"
Expand Down Expand Up @@ -111,7 +111,7 @@ func runTests(t *testing.T, handlerFactory handlerFactory, tests []testCase) {
// Create client and informers
client := fake.NewSimpleClientset(objs...)
informers := informers.NewSharedInformerFactory(client, time.Hour /* disable resync*/)
vaInformer := informers.Storage().V1alpha1().VolumeAttachments()
vaInformer := informers.Storage().V1beta1().VolumeAttachments()
pvInformer := informers.Core().V1().PersistentVolumes()
nodeInformer := informers.Core().V1().Nodes()
// Fill the informers with inital objects so controller can Get() them
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/trivial_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package controller
import (
"github.com/golang/glog"
"k8s.io/api/core/v1"
storage "k8s.io/api/storage/v1alpha1"
storage "k8s.io/api/storage/v1beta1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/util/workqueue"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/trivial_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func trivialHandlerFactory(client kubernetes.Interface, informerFactory informer
func TestTrivialHandler(t *testing.T) {
vaGroupResourceVersion := schema.GroupVersionResource{
Group: storage.GroupName,
Version: "v1alpha1",
Version: "v1beta1",
Resource: "volumeattachments",
}

Expand Down
6 changes: 3 additions & 3 deletions pkg/controller/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package controller
import (
"github.com/golang/glog"
"github.com/kubernetes-csi/external-attacher/pkg/connection"
storage "k8s.io/api/storage/v1alpha1"
storage "k8s.io/api/storage/v1beta1"
"k8s.io/client-go/kubernetes"
)

Expand All @@ -30,7 +30,7 @@ func markAsAttached(client kubernetes.Interface, va *storage.VolumeAttachment, m
clone.Status.AttachmentMetadata = metadata
clone.Status.AttachError = nil
// TODO: use patch to save us from VersionError
newVA, err := client.StorageV1alpha1().VolumeAttachments().Update(clone)
newVA, err := client.StorageV1beta1().VolumeAttachments().Update(clone)
if err != nil {
return va, err
}
Expand Down Expand Up @@ -69,7 +69,7 @@ func markAsDetached(client kubernetes.Interface, va *storage.VolumeAttachment) (
clone.Status.DetachError = nil
clone.Status.AttachmentMetadata = nil
// TODO: use patch to save us from VersionError
newVA, err := client.StorageV1alpha1().VolumeAttachments().Update(clone)
newVA, err := client.StorageV1beta1().VolumeAttachments().Update(clone)
if err != nil {
return va, err
}
Expand Down
1 change: 0 additions & 1 deletion vendor/github.com/google/btree/.travis.yml

This file was deleted.

Loading

0 comments on commit f759283

Please sign in to comment.