Skip to content

Commit

Permalink
Changed the test to take the addresses from the k8s client
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Savian <[email protected]>
  • Loading branch information
vitorsavian committed Sep 15, 2023
1 parent 9719c6d commit a3b9501
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/integration/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,19 @@ func ParseAPIInfo() (string, error) {
return "", err
}

result, err := client.RESTClient().Get().AbsPath("/api").DoRaw(context.TODO())
endpoints, err := client.CoreV1().Endpoints("default").Get(context.Background(), "kubernetes", metav1.GetOptions{})
if err != nil {
return "", err
}

return string(result), nil
var addresses []string
for _, subset := range endpoints.Subsets {
for _, address := range subset.Addresses {
addresses = append(addresses, address.IP)
}
}

return strings.Join(addresses, ","), nil
}

// RunCommand Runs command on the host
Expand Down

0 comments on commit a3b9501

Please sign in to comment.