mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-11-11 16:25:05 -05:00
AB#2286 Return only primary IPs for instance metadata operations (#335)
Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
parent
5c00dafe9b
commit
4151d365fb
21 changed files with 180 additions and 185 deletions
|
|
@ -73,7 +73,9 @@ func (f *Fetcher) DiscoverDebugdIPs(ctx context.Context) ([]string, error) {
|
|||
}
|
||||
var ips []string
|
||||
for _, instance := range instances {
|
||||
ips = append(ips, instance.PrivateIPs...)
|
||||
if instance.VPCIP != "" {
|
||||
ips = append(ips, instance.VPCIP)
|
||||
}
|
||||
}
|
||||
return ips, nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,13 +31,13 @@ func TestDiscoverDebugIPs(t *testing.T) {
|
|||
meta: stubMetadata{
|
||||
listRes: []metadata.InstanceMetadata{
|
||||
{
|
||||
PrivateIPs: []string{"192.0.2.0"},
|
||||
VPCIP: "192.0.2.0",
|
||||
},
|
||||
{
|
||||
PrivateIPs: []string{"192.0.2.1"},
|
||||
VPCIP: "192.0.2.1",
|
||||
},
|
||||
{
|
||||
PrivateIPs: []string{"192.0.2.2"},
|
||||
VPCIP: "192.0.2.2",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue