Merge pull request #114343 from skitt/autorest-to

Use k8s utils pointer instead of Azure autorest/to
This commit is contained in:
Kubernetes Prow Robot
2022-12-10 09:05:55 -08:00
committed by GitHub
61 changed files with 1476 additions and 1478 deletions

View File

@@ -25,8 +25,8 @@ import (
"github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/to"
"k8s.io/client-go/tools/cache"
"k8s.io/utils/pointer"
"github.com/stretchr/testify/assert"
)
@@ -39,27 +39,27 @@ func Test(t *testing.T) {
}`
result := []containerregistry.Registry{
{
Name: to.StringPtr("foo"),
Name: pointer.String("foo"),
RegistryProperties: &containerregistry.RegistryProperties{
LoginServer: to.StringPtr("*.azurecr.io"),
LoginServer: pointer.String("*.azurecr.io"),
},
},
{
Name: to.StringPtr("bar"),
Name: pointer.String("bar"),
RegistryProperties: &containerregistry.RegistryProperties{
LoginServer: to.StringPtr("*.azurecr.cn"),
LoginServer: pointer.String("*.azurecr.cn"),
},
},
{
Name: to.StringPtr("baz"),
Name: pointer.String("baz"),
RegistryProperties: &containerregistry.RegistryProperties{
LoginServer: to.StringPtr("*.azurecr.de"),
LoginServer: pointer.String("*.azurecr.de"),
},
},
{
Name: to.StringPtr("bus"),
Name: pointer.String("bus"),
RegistryProperties: &containerregistry.RegistryProperties{
LoginServer: to.StringPtr("*.azurecr.us"),
LoginServer: pointer.String("*.azurecr.us"),
},
},
}

View File

@@ -29,13 +29,13 @@ import (
"strings"
"testing"
"github.com/Azure/go-autorest/autorest/to"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/kubernetes/fake"
fakecloud "k8s.io/cloud-provider/fake"
"k8s.io/mount-utils"
"k8s.io/utils/pointer"
"k8s.io/kubernetes/pkg/volume"
volumetest "k8s.io/kubernetes/pkg/volume/testing"
@@ -384,7 +384,7 @@ func TestAppendDefaultMountOptions(t *testing.T) {
},
{
options: []string{"file_mode=0777"},
fsGroup: to.Int64Ptr(0),
fsGroup: pointer.Int64(0),
expected: []string{"file_mode=0777",
fmt.Sprintf("%s=%s", dirMode, defaultDirMode),
fmt.Sprintf("%s=%s", vers, defaultVers),
@@ -395,7 +395,7 @@ func TestAppendDefaultMountOptions(t *testing.T) {
},
{
options: []string{"vers=2.1"},
fsGroup: to.Int64Ptr(1000),
fsGroup: pointer.Int64(1000),
expected: []string{"vers=2.1",
fmt.Sprintf("%s=%s", fileMode, defaultFileMode),
fmt.Sprintf("%s=%s", dirMode, defaultDirMode),
@@ -424,7 +424,7 @@ func TestAppendDefaultMountOptions(t *testing.T) {
},
{
options: []string{"gid=2000"},
fsGroup: to.Int64Ptr(1000),
fsGroup: pointer.Int64(1000),
expected: []string{"gid=2000",
fmt.Sprintf("%s=%s", fileMode, defaultFileMode),
fmt.Sprintf("%s=%s", dirMode, defaultDirMode),