From 0bb7eb16a0337a4a1a63386f0f6369ada3c6ed5e Mon Sep 17 00:00:00 2001 From: Predrag Janosevic Date: Mon, 15 Jan 2024 16:22:50 +0100 Subject: [PATCH 1/2] Prepare release --- CHANGELOG.md | 4 ++-- version/version.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d98ca184e..1b1d5a2aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,8 @@ Changelog ========= -Unreleased ----------- +0.102.3 +------- - v2: fix issue with iam role labels #614 diff --git a/version/version.go b/version/version.go index abe8dce69..b34cd4abb 100644 --- a/version/version.go +++ b/version/version.go @@ -2,4 +2,4 @@ package version // Version represents the current egoscale version. -const Version = "0.102.2" +const Version = "0.102.3" From 1ace995a320f63c460a2efbb5630680f7dee8271 Mon Sep 17 00:00:00 2001 From: Pierre-Emmanuel Jacquier <15922119+pierre-emmanuelJ@users.noreply.github.com> Date: Wed, 17 Jan 2024 10:52:56 +0000 Subject: [PATCH 2/2] V3: Get zone name from URL Signed-off-by: Pierre-Emmanuel Jacquier <15922119+pierre-emmanuelJ@users.noreply.github.com> --- v3/client.go | 11 +++++++++++ v3/generator/client/client.tmpl | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/v3/client.go b/v3/client.go index e48bc0dca..c1134ba2c 100755 --- a/v3/client.go +++ b/v3/client.go @@ -27,6 +27,17 @@ const ( BGSof1 URL = "https://api-bg-sof-1.exoscale.com/v2" ) +// Zone gets the zone name from the URL. +func (u URL) Zone() (string, bool) { + for zone, url := range Zones { + if url == u { + return zone, true + } + } + + return "", false +} + // Zones represents a list of all Exoscale zone. var Zones map[string]URL = map[string]URL{ "ch-gva-2": CHGva2, diff --git a/v3/generator/client/client.tmpl b/v3/generator/client/client.tmpl index b44f84b5a..7dda67974 100644 --- a/v3/generator/client/client.tmpl +++ b/v3/generator/client/client.tmpl @@ -5,6 +5,17 @@ const ( {{ .Enum }} ) +// Zone gets the zone name from the URL. +func (u URL) Zone() (string, bool) { + for zone, url := range Zones { + if url == u { + return zone, true + } + } + + return "", false +} + // Zones represents a list of all Exoscale zone. var Zones map[string]URL = map[string]URL{ {{ .Zones }}