瀏覽代碼

Use existing oauth Token struct rather than create our own

Guillaume Tardif 5 年之前
父節點
當前提交
fffb3aa3f9
共有 1 個文件被更改,包括 3 次插入4 次删除
  1. 3 4
      aci/convert/registry_credentials.go

+ 3 - 4
aci/convert/registry_credentials.go

@@ -26,6 +26,8 @@ import (
 	"os/exec"
 	"strings"
 
+	"golang.org/x/oauth2"
+
 	"github.com/Azure/azure-sdk-for-go/profiles/latest/containerinstance/mgmt/containerinstance"
 	"github.com/Azure/go-autorest/autorest/to"
 	compose "github.com/compose-spec/compose-go/types"
@@ -167,10 +169,7 @@ func (c cliRegistryHelper) autoLoginAcr(registry string) error {
 		return err
 	}
 
-	type acrToken struct {
-		RefreshToken string `json:"refresh_token"`
-	}
-	newToken := acrToken{}
+	newToken := oauth2.Token{}
 	if err := json.Unmarshal(bits, &newToken); err != nil {
 		return err
 	}