mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-17 23:57:52 +00:00
Use v2 types with agg discovery
Kubernetes-commit: 462dd326c2e98d937a96d49002883000efe4b2d6
This commit is contained in:
committed by
Kubernetes Publisher
parent
1bed3f14c1
commit
4bf7f9496e
@@ -30,7 +30,7 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
apidiscovery "k8s.io/api/apidiscovery/v2beta1"
|
||||
apidiscovery "k8s.io/api/apidiscovery/v2"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
@@ -643,7 +643,7 @@ func TestCachedDiscoveryClientAggregatedServerGroups(t *testing.T) {
|
||||
return
|
||||
}
|
||||
// Content-type is "aggregated" discovery format.
|
||||
w.Header().Set("Content-Type", discovery.AcceptV2Beta1)
|
||||
w.Header().Set("Content-Type", discovery.AcceptV2)
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write(output)
|
||||
}))
|
||||
|
@@ -28,7 +28,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
apidiscovery "k8s.io/api/apidiscovery/v2beta1"
|
||||
apidiscovery "k8s.io/api/apidiscovery/v2"
|
||||
errorsutil "k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
@@ -1118,7 +1118,7 @@ func TestAggregatedMemCacheGroupsAndMaybeResources(t *testing.T) {
|
||||
output, err := json.Marshal(agg)
|
||||
require.NoError(t, err)
|
||||
// Content-type is "aggregated" discovery format.
|
||||
w.Header().Set("Content-Type", discovery.AcceptV2Beta1)
|
||||
w.Header().Set("Content-Type", discovery.AcceptV2)
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write(output)
|
||||
}))
|
||||
@@ -1161,6 +1161,7 @@ func TestAggregatedMemCacheGroupsAndMaybeResources(t *testing.T) {
|
||||
memClient.Invalidate()
|
||||
assert.False(t, memClient.Fresh())
|
||||
apiGroupList, _, _, err = memClient.GroupsAndMaybeResources()
|
||||
|
||||
require.NoError(t, err)
|
||||
// Test the expected groups are returned for the aggregated format.
|
||||
actualGroupNames = sets.NewString(groupNamesFromList(apiGroupList)...)
|
||||
|
Reference in New Issue
Block a user