@@ -34,7 +34,6 @@ import (
34
34
"k8s.io/component-helpers/storage/ephemeral"
35
35
"k8s.io/kubernetes/pkg/features"
36
36
kubeletmetrics "k8s.io/kubernetes/pkg/kubelet/metrics"
37
- "k8s.io/kubernetes/test/e2e/feature"
38
37
"k8s.io/kubernetes/test/e2e/framework"
39
38
e2emetrics "k8s.io/kubernetes/test/e2e/framework/metrics"
40
39
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
@@ -626,38 +625,36 @@ var _ = utils.SIGDescribe(framework.WithSerial(), "Volume metrics", func() {
626
625
})
627
626
628
627
// TODO: Merge with bound/unbound tests when "VolumeAttributesClass" feature is enabled by default
629
- f .It ("should create unbound pvc count metrics for pvc controller with volume attributes class dimension after creating pvc only" ,
630
- feature .VolumeAttributesClass , framework .WithFeatureGate (features .VolumeAttributesClass ), func (ctx context.Context ) {
631
- var err error
632
- dimensions := []string {namespaceKey , storageClassKey , volumeAttributeClassKey }
633
- pvcConfigWithVAC := pvcConfig
634
- pvcConfigWithVAC .VolumeAttributesClassName = & volumeAttributesClassName
635
- pvcWithVAC := e2epv .MakePersistentVolumeClaim (pvcConfigWithVAC , ns )
636
- pvc , err = e2epv .CreatePVC (ctx , c , ns , pvcWithVAC )
637
- framework .ExpectNoError (err , "Error creating pvc: %v" , err )
638
- waitForPVControllerSync (ctx , metricsGrabber , unboundPVCKey , volumeAttributeClassKey )
639
- controllerMetrics , err := metricsGrabber .GrabFromControllerManager (ctx )
640
- framework .ExpectNoError (err , "Error getting c-m metricValues: %v" , err )
641
- err = testutil .ValidateMetrics (testutil .Metrics (controllerMetrics ), unboundPVCKey , dimensions ... )
642
- framework .ExpectNoError (err , "Invalid metric in Controller Manager metrics: %q" , unboundPVCKey )
643
- })
628
+ f .It ("should create unbound pvc count metrics for pvc controller with volume attributes class dimension after creating pvc only" , framework .WithFeatureGate (features .VolumeAttributesClass ), func (ctx context.Context ) {
629
+ var err error
630
+ dimensions := []string {namespaceKey , storageClassKey , volumeAttributeClassKey }
631
+ pvcConfigWithVAC := pvcConfig
632
+ pvcConfigWithVAC .VolumeAttributesClassName = & volumeAttributesClassName
633
+ pvcWithVAC := e2epv .MakePersistentVolumeClaim (pvcConfigWithVAC , ns )
634
+ pvc , err = e2epv .CreatePVC (ctx , c , ns , pvcWithVAC )
635
+ framework .ExpectNoError (err , "Error creating pvc: %v" , err )
636
+ waitForPVControllerSync (ctx , metricsGrabber , unboundPVCKey , volumeAttributeClassKey )
637
+ controllerMetrics , err := metricsGrabber .GrabFromControllerManager (ctx )
638
+ framework .ExpectNoError (err , "Error getting c-m metricValues: %v" , err )
639
+ err = testutil .ValidateMetrics (testutil .Metrics (controllerMetrics ), unboundPVCKey , dimensions ... )
640
+ framework .ExpectNoError (err , "Invalid metric in Controller Manager metrics: %q" , unboundPVCKey )
641
+ })
644
642
645
643
// TODO: Merge with bound/unbound tests when "VolumeAttributesClass" feature is enabled by default
646
- f .It ("should create bound pv/pvc count metrics for pvc controller with volume attributes class dimension after creating both pv and pvc" ,
647
- feature .VolumeAttributesClass , framework .WithFeatureGate (features .VolumeAttributesClass ), func (ctx context.Context ) {
648
- var err error
649
- dimensions := []string {namespaceKey , storageClassKey , volumeAttributeClassKey }
650
- pvcConfigWithVAC := pvcConfig
651
- pvcConfigWithVAC .VolumeAttributesClassName = & volumeAttributesClassName
652
- pv , pvc , err = e2epv .CreatePVPVC (ctx , c , f .Timeouts , pvConfig , pvcConfigWithVAC , ns , true )
653
- framework .ExpectNoError (err , "Error creating pv pvc: %v" , err )
654
- waitForPVControllerSync (ctx , metricsGrabber , boundPVKey , storageClassKey )
655
- waitForPVControllerSync (ctx , metricsGrabber , boundPVCKey , volumeAttributeClassKey )
656
- controllerMetrics , err := metricsGrabber .GrabFromControllerManager (ctx )
657
- framework .ExpectNoError (err , "Error getting c-m metricValues: %v" , err )
658
- err = testutil .ValidateMetrics (testutil .Metrics (controllerMetrics ), boundPVCKey , dimensions ... )
659
- framework .ExpectNoError (err , "Invalid metric in Controller Manager metrics: %q" , boundPVCKey )
660
- })
644
+ f .It ("should create bound pv/pvc count metrics for pvc controller with volume attributes class dimension after creating both pv and pvc" , framework .WithFeatureGate (features .VolumeAttributesClass ), func (ctx context.Context ) {
645
+ var err error
646
+ dimensions := []string {namespaceKey , storageClassKey , volumeAttributeClassKey }
647
+ pvcConfigWithVAC := pvcConfig
648
+ pvcConfigWithVAC .VolumeAttributesClassName = & volumeAttributesClassName
649
+ pv , pvc , err = e2epv .CreatePVPVC (ctx , c , f .Timeouts , pvConfig , pvcConfigWithVAC , ns , true )
650
+ framework .ExpectNoError (err , "Error creating pv pvc: %v" , err )
651
+ waitForPVControllerSync (ctx , metricsGrabber , boundPVKey , storageClassKey )
652
+ waitForPVControllerSync (ctx , metricsGrabber , boundPVCKey , volumeAttributeClassKey )
653
+ controllerMetrics , err := metricsGrabber .GrabFromControllerManager (ctx )
654
+ framework .ExpectNoError (err , "Error getting c-m metricValues: %v" , err )
655
+ err = testutil .ValidateMetrics (testutil .Metrics (controllerMetrics ), boundPVCKey , dimensions ... )
656
+ framework .ExpectNoError (err , "Invalid metric in Controller Manager metrics: %q" , boundPVCKey )
657
+ })
661
658
662
659
ginkgo .It ("should create total pv count metrics for with plugin and volume mode labels after creating pv" ,
663
660
func (ctx context.Context ) {
0 commit comments