-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sds: simplify implementation to reduce dependencies #50828
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6566b8a
wip
kyessenov b58884a
add check
kyessenov a0ebf43
sds: simplify implementation to reduce the dependencies
kyessenov 59b0b6b
debug piggyback
kyessenov 07bebb2
Merge remote-tracking branch 'upstream/master' into xds_sds
kyessenov 7ea0357
disable piggyback
kyessenov c96c08a
Merge remote-tracking branch 'upstream/master' into xds_sds
kyessenov 2fb2a06
merge fix
kyessenov 603ac31
merge fix
kyessenov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,7 @@ import ( | |
"istio.io/istio/pkg/spiffe" | ||
"istio.io/istio/pkg/test/env" | ||
"istio.io/istio/pkg/util/sets" | ||
xdsserver "istio.io/istio/pkg/xds" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same, with |
||
) | ||
|
||
func makeSecret(name string, data map[string]string) *corev1.Secret { | ||
|
@@ -329,7 +330,7 @@ func TestGenerateSDS(t *testing.T) { | |
gen := s.Discovery.Generators[v3.SecretType] | ||
tt.request.Start = time.Now() | ||
secrets, _, _ := gen.Generate(s.SetupProxy(tt.proxy), &model.WatchedResource{ResourceNames: tt.resources}, tt.request) | ||
raw := xdstest.ExtractTLSSecrets(t, model.ResourcesToAny(secrets)) | ||
raw := xdstest.ExtractTLSSecrets(t, xdsserver.ResourcesToAny(secrets)) | ||
|
||
got := map[string]Expected{} | ||
for _, scrt := range raw { | ||
|
@@ -375,14 +376,14 @@ func TestCaching(t *testing.T) { | |
} | ||
|
||
secrets, _, _ := gen.Generate(s.SetupProxy(istiosystem), &model.WatchedResource{ResourceNames: []string{"kubernetes://generic"}}, fullPush) | ||
raw := xdstest.ExtractTLSSecrets(t, model.ResourcesToAny(secrets)) | ||
raw := xdstest.ExtractTLSSecrets(t, xdsserver.ResourcesToAny(secrets)) | ||
if len(raw) != 1 { | ||
t.Fatalf("failed to get expected secrets for authorized proxy: %v", raw) | ||
} | ||
|
||
// We should not get secret returned, even though we are asking for the same one | ||
secrets, _, _ = gen.Generate(s.SetupProxy(otherNamespace), &model.WatchedResource{ResourceNames: []string{"kubernetes://generic"}}, fullPush) | ||
raw = xdstest.ExtractTLSSecrets(t, model.ResourcesToAny(secrets)) | ||
raw = xdstest.ExtractTLSSecrets(t, xdsserver.ResourcesToAny(secrets)) | ||
if len(raw) != 0 { | ||
t.Fatalf("failed to get expected secrets for unauthorized proxy: %v", raw) | ||
} | ||
|
@@ -423,7 +424,7 @@ func TestPrivateKeyProviderProxyConfig(t *testing.T) { | |
gen := s.Discovery.Generators[v3.SecretType] | ||
fullPush := &model.PushRequest{Full: true, Start: time.Now()} | ||
secrets, _, _ := gen.Generate(s.SetupProxy(rawProxy), &model.WatchedResource{ResourceNames: []string{"kubernetes://generic"}}, fullPush) | ||
raw := xdstest.ExtractTLSSecrets(t, model.ResourcesToAny(secrets)) | ||
raw := xdstest.ExtractTLSSecrets(t, xdsserver.ResourcesToAny(secrets)) | ||
for _, scrt := range raw { | ||
if scrt.GetTlsCertificate().GetPrivateKeyProvider() != nil { | ||
t.Fatalf("expect no private key provider in secret") | ||
|
@@ -432,7 +433,7 @@ func TestPrivateKeyProviderProxyConfig(t *testing.T) { | |
|
||
// add private key provider in proxy-config | ||
secrets, _, _ = gen.Generate(s.SetupProxy(pkpProxy), &model.WatchedResource{ResourceNames: []string{"kubernetes://generic"}}, fullPush) | ||
raw = xdstest.ExtractTLSSecrets(t, model.ResourcesToAny(secrets)) | ||
raw = xdstest.ExtractTLSSecrets(t, xdsserver.ResourcesToAny(secrets)) | ||
for _, scrt := range raw { | ||
privateKeyProvider := scrt.GetTlsCertificate().GetPrivateKeyProvider() | ||
if privateKeyProvider == nil { | ||
|
@@ -445,7 +446,7 @@ func TestPrivateKeyProviderProxyConfig(t *testing.T) { | |
|
||
// erase private key provider in proxy-config | ||
secrets, _, _ = gen.Generate(s.SetupProxy(rawProxy), &model.WatchedResource{ResourceNames: []string{"kubernetes://generic"}}, fullPush) | ||
raw = xdstest.ExtractTLSSecrets(t, model.ResourcesToAny(secrets)) | ||
raw = xdstest.ExtractTLSSecrets(t, xdsserver.ResourcesToAny(secrets)) | ||
for _, scrt := range raw { | ||
if scrt.GetTlsCertificate().GetPrivateKeyProvider() != nil { | ||
t.Fatalf("expect no private key provider in secret") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Package name conflict.