Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
torgiren
External Dns
Commits
936747c8
Commit
936747c8
authored
3 years ago
by
Raffaele Di Fazio
Committed by
GitHub
3 years ago
Browse files
Options
Download
Email Patches
Plain Diff
removes broken test
Signed-off-by:
GitHub
<
noreply@github.com
>
parent
17a7437e
master
dependabot/go_modules/github.com/Azure/azure-sdk-for-go-61.4.0incompatible
dependabot/go_modules/github.com/aliyun/alibaba-cloud-sdk-go-1.61.1473
dependabot/go_modules/github.com/exoscale/egoscale-1.19.0
dependabot/go_modules/github.com/projectcontour/contour-1.20.0
dependabot/go_modules/k8s.io/apimachinery-0.23.3
raffo/bump-kustomize
raffo/fix-build
raffo/fix-trivy-again
raffo/remove-azure-test
raffo/remove-broken-link
v1.0.0-mf
v0.10.2
external-dns-helm-chart-1.7.1
external-dns-helm-chart-1.7.0
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
provider/azure/azure_test.go
+0
-55
provider/azure/azure_test.go
with
0 additions
and
55 deletions
+0
-55
provider/azure/azure_test.go
+
0
-
55
View file @
936747c8
...
...
@@ -18,12 +18,10 @@ package azure
import
(
"context"
"strings"
"testing"
"github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/to"
"github.com/stretchr/testify/assert"
...
...
@@ -446,59 +444,6 @@ func testAzureApplyChangesInternal(t *testing.T, dryRun bool, client RecordSetsC
}
}
func
TestAzureGetAccessToken
(
t
*
testing
.
T
)
{
env
:=
azure
.
PublicCloud
cfg
:=
config
{
ClientID
:
""
,
ClientSecret
:
""
,
TenantID
:
""
,
UseManagedIdentityExtension
:
false
,
}
_
,
err
:=
getAccessToken
(
cfg
,
env
)
if
err
==
nil
{
t
.
Fatalf
(
"expected to fail, but got no error"
)
}
// Expect to use managed identity in this case
cfg
=
config
{
ClientID
:
"msi"
,
ClientSecret
:
"msi"
,
TenantID
:
"cefe8aef-5127-4d65-a299-012053f81f60"
,
UserAssignedIdentityID
:
"userAssignedIdentityClientID"
,
UseManagedIdentityExtension
:
true
,
}
token
,
err
:=
getAccessToken
(
cfg
,
env
)
if
err
!=
nil
{
t
.
Fatalf
(
"expected to construct a token successfully, but got error %v"
,
err
)
}
_
,
err
=
token
.
MarshalJSON
()
if
err
==
nil
||
!
strings
.
Contains
(
err
.
Error
(),
"marshalling ServicePrincipalMSISecret is not supported"
)
{
t
.
Fatalf
(
"expected to fail to marshal token, but got %v"
,
err
)
}
// Expect to use SPN in this case
cfg
=
config
{
ClientID
:
"SPNClientID"
,
ClientSecret
:
"SPNSecret"
,
TenantID
:
"cefe8aef-5127-4d65-a299-012053f81f60"
,
UserAssignedIdentityID
:
"userAssignedIdentityClientID"
,
UseManagedIdentityExtension
:
true
,
}
token
,
err
=
getAccessToken
(
cfg
,
env
)
if
err
!=
nil
{
t
.
Fatalf
(
"expected to construct a token successfully, but got error %v"
,
err
)
}
innerToken
,
err
:=
token
.
MarshalJSON
()
if
err
!=
nil
{
t
.
Fatalf
(
"expected to marshal token successfully, but got error %v"
,
err
)
}
if
!
strings
.
Contains
(
string
(
innerToken
),
"SPNClientID"
)
{
t
.
Fatalf
(
"expect the clientID of the token is SPNClientID, but got token %s"
,
string
(
innerToken
))
}
}
func
TestAzureNameFilter
(
t
*
testing
.
T
)
{
provider
,
err
:=
newMockedAzureProvider
(
endpoint
.
NewDomainFilter
([]
string
{
"nginx.example.com"
}),
endpoint
.
NewDomainFilter
([]
string
{
"example.com"
}),
provider
.
NewZoneIDFilter
([]
string
{
""
}),
true
,
"k8s"
,
""
,
&
[]
dns
.
Zone
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help