Skip to content

Commit

Permalink
Merge pull request #94 from hortonworks/quickfix
Browse files Browse the repository at this point in the history
Fix GCP stack collection and add check to version fetch script
  • Loading branch information
Bajzathd authored Mar 29, 2023
2 parents 3bc64b8 + 9726d1d commit f19994f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ set -x

if [ "$VERSION" = "latest" ]; then
VERSION=$(curl "https://api.github.com/repos/hortonworks/cloud-haunter/releases/latest" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/' | cut -c2-)
if [ -z "$VERSION" ]; then
echo "Failed to fetch latest version from GitHub"
exit 1
fi
fi

curl -LOs https://github.com/hortonworks/cloud-haunter/releases/download/v${VERSION}/cloud-haunter_${VERSION}_$(uname)_x86_64.tgz
Expand Down
4 changes: 3 additions & 1 deletion gcp/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ func (p gcpProvider) GetStacks() ([]*types.Stack, error) {
for _, networkInterface := range gcpInstance.NetworkInterfaces {
if network, ok := networksBySelfLink[networkInterface.Network]; ok {
networkName = network.Name
firewallName = firewallsByNetwork[network.SelfLink].Name
if firewall, ok := firewallsByNetwork[network.SelfLink]; ok {
firewallName = firewall.Name
}
for _, subnet := range network.Subnetworks {
subnetParts := strings.Split(subnet, "/")
subnetNames = append(subnetNames, subnetParts[len(subnetParts)-1])
Expand Down

0 comments on commit f19994f

Please sign in to comment.