@@ -17,7 +17,7 @@ limitations under the License.
17
17
package store
18
18
19
19
import (
20
- storagev1beta1 "k8s.io/api/storage/v1beta1 "
20
+ storagev1 "k8s.io/api/storage/v1 "
21
21
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22
22
"k8s.io/apimachinery/pkg/runtime"
23
23
"k8s.io/apimachinery/pkg/watch"
37
37
Name : descVolumeAttachmentLabelsName ,
38
38
Type : metric .Gauge ,
39
39
Help : descVolumeAttachmentLabelsHelp ,
40
- GenerateFunc : wrapVolumeAttachmentFunc (func (va * storagev1beta1 .VolumeAttachment ) * metric.Family {
40
+ GenerateFunc : wrapVolumeAttachmentFunc (func (va * storagev1 .VolumeAttachment ) * metric.Family {
41
41
labelKeys , labelValues := kubeLabelsToPrometheusLabels (va .Labels )
42
42
return & metric.Family {
43
43
Metrics : []* metric.Metric {
54
54
Name : "kube_volumeattachment_info" ,
55
55
Type : metric .Gauge ,
56
56
Help : "Information about volumeattachment." ,
57
- GenerateFunc : wrapVolumeAttachmentFunc (func (va * storagev1beta1 .VolumeAttachment ) * metric.Family {
57
+ GenerateFunc : wrapVolumeAttachmentFunc (func (va * storagev1 .VolumeAttachment ) * metric.Family {
58
58
return & metric.Family {
59
59
Metrics : []* metric.Metric {
60
60
{
70
70
Name : "kube_volumeattachment_created" ,
71
71
Type : metric .Gauge ,
72
72
Help : "Unix creation timestamp" ,
73
- GenerateFunc : wrapVolumeAttachmentFunc (func (va * storagev1beta1 .VolumeAttachment ) * metric.Family {
73
+ GenerateFunc : wrapVolumeAttachmentFunc (func (va * storagev1 .VolumeAttachment ) * metric.Family {
74
74
if ! va .CreationTimestamp .IsZero () {
75
75
m := metric.Metric {
76
76
LabelKeys : nil ,
86
86
Name : "kube_volumeattachment_spec_source_persistentvolume" ,
87
87
Type : metric .Gauge ,
88
88
Help : "PersistentVolume source reference." ,
89
- GenerateFunc : wrapVolumeAttachmentFunc (func (va * storagev1beta1 .VolumeAttachment ) * metric.Family {
89
+ GenerateFunc : wrapVolumeAttachmentFunc (func (va * storagev1 .VolumeAttachment ) * metric.Family {
90
90
if va .Spec .Source .PersistentVolumeName != nil {
91
91
return & metric.Family {
92
92
Metrics : []* metric.Metric {
@@ -105,7 +105,7 @@ var (
105
105
Name : "kube_volumeattachment_status_attached" ,
106
106
Type : metric .Gauge ,
107
107
Help : "Information about volumeattachment." ,
108
- GenerateFunc : wrapVolumeAttachmentFunc (func (va * storagev1beta1 .VolumeAttachment ) * metric.Family {
108
+ GenerateFunc : wrapVolumeAttachmentFunc (func (va * storagev1 .VolumeAttachment ) * metric.Family {
109
109
return & metric.Family {
110
110
Metrics : []* metric.Metric {
111
111
{
@@ -121,7 +121,7 @@ var (
121
121
Name : "kube_volumeattachment_status_attachment_metadata" ,
122
122
Type : metric .Gauge ,
123
123
Help : "volumeattachment metadata." ,
124
- GenerateFunc : wrapVolumeAttachmentFunc (func (va * storagev1beta1 .VolumeAttachment ) * metric.Family {
124
+ GenerateFunc : wrapVolumeAttachmentFunc (func (va * storagev1 .VolumeAttachment ) * metric.Family {
125
125
labelKeys , labelValues := mapToPrometheusLabels (va .Status .AttachmentMetadata , "metadata" )
126
126
return & metric.Family {
127
127
Metrics : []* metric.Metric {
@@ -137,9 +137,9 @@ var (
137
137
}
138
138
)
139
139
140
- func wrapVolumeAttachmentFunc (f func (* storagev1beta1 .VolumeAttachment ) * metric.Family ) func (interface {}) * metric.Family {
140
+ func wrapVolumeAttachmentFunc (f func (* storagev1 .VolumeAttachment ) * metric.Family ) func (interface {}) * metric.Family {
141
141
return func (obj interface {}) * metric.Family {
142
- va := obj .(* storagev1beta1 .VolumeAttachment )
142
+ va := obj .(* storagev1 .VolumeAttachment )
143
143
144
144
metricFamily := f (va )
145
145
@@ -155,10 +155,10 @@ func wrapVolumeAttachmentFunc(f func(*storagev1beta1.VolumeAttachment) *metric.F
155
155
func createVolumeAttachmentListWatch (kubeClient clientset.Interface , _ string ) cache.ListerWatcher {
156
156
return & cache.ListWatch {
157
157
ListFunc : func (opts metav1.ListOptions ) (runtime.Object , error ) {
158
- return kubeClient .StorageV1beta1 ().VolumeAttachments ().List (opts )
158
+ return kubeClient .StorageV1 ().VolumeAttachments ().List (opts )
159
159
},
160
160
WatchFunc : func (opts metav1.ListOptions ) (watch.Interface , error ) {
161
- return kubeClient .StorageV1beta1 ().VolumeAttachments ().Watch (opts )
161
+ return kubeClient .StorageV1 ().VolumeAttachments ().Watch (opts )
162
162
},
163
163
}
164
164
}
0 commit comments