Add fix for determining mgmt API path. Fix CLI config dir setting.

This commit is contained in:
Paul Lorenz
2023-06-21 11:20:04 -04:00
parent 32e1e02e98
commit fa297c7860
4 changed files with 12 additions and 19 deletions
+3 -2
View File
@@ -2,7 +2,9 @@
## What's New
This is a bugfix release.
* IMPORTANT: If you update your OpenZiti binaries to this version or later (which can be done easily with the `getZiti()` function, you will need to migrate any existing network that has been developed using OpenZiti v0.27.5 or earlier binaries as the new binaries will expect the new environment variable names. A function `performMigration()` has been provided in the `ziti-cli-script.sh` for this purpose. Simply source the latest `ziti-cli-script.sh`, and your current network's .env file, then run `performMigration()` to update environment variable name references. If the migration process cannot find your existing environment file in the default location, you will need to provide the path to the migration function, ex: `performMigration <path-to-environment-file>`
* If you were using the `ZITI_HOME` environment variable to configure where your ziti CLI profiles were stored, you should now use `ZITI_CONFIG_DIR` instead.
## Component Updates and Bug Fixes
@@ -31,7 +33,6 @@ This is a bugfix release.
* [Issue #761](https://github.com/openziti/ziti/issues/761) - Remove Management Listener section from controller config.
* [Issue #650](https://github.com/openziti/ziti/issues/650) - Removed/Updated references to `ZITI_EDGE_CONTROLLER_API`
* Quickstart environment variable names have been cleaned up.
* IMPORTANT: If you update your OpenZiti binaries to this version or later (which can be done easily with the `getZiti()` function, you will need to migrate any existing network that has been developed using OpenZiti v0.27.5 or earlier binaries as the new binaries will expect the new environment variable names. A function `performMigration()` has been provided in the `ziti-cli-script.sh` for this purpose. Simply source the latest `ziti-cli-script.sh`, and your current network's .env file, then run `performMigration()` to update environment variable name references. If the migration process cannot find your existing environment file in the default location, you will need to provide the path to the migration function, ex: `performMigration <path-to-environment-file>`
* [Issue #1030](https://github.com/openziti/ziti/issues/1030) - Provide an upgrade path for quickstart cleanup
# Release 0.28.1
-1
View File
@@ -47,7 +47,6 @@ func WorkingDir() (string, error) {
}
func GetZitiHome() (string, error) {
// Get path from env variable
retVal := os.Getenv(constants.ZitiHomeVarName)
+1 -14
View File
@@ -37,7 +37,7 @@ func HomeDir() string {
}
func ConfigDir() (string, error) {
path := os.Getenv("ZITI_HOME")
path := os.Getenv("ZITI_CONFIG_DIR")
if path != "" {
return path, nil
}
@@ -55,19 +55,6 @@ func ConfigDir() (string, error) {
return path, nil
}
func FabricConfigDir() (string, error) {
h, err := ConfigDir()
if err != nil {
return "", err
}
path := filepath.Join(h, "fabric")
err = os.MkdirAll(path, DefaultWritePermissions)
if err != nil {
return "", err
}
return path, nil
}
func ZitiAppConfigDir(zitiApp string) (string, error) {
h, err := ConfigDir()
if err != nil {
+8 -2
View File
@@ -862,10 +862,16 @@ func EdgeControllerGetManagementApiBasePath(host string, cert string) string {
client.SetRootCertificate(cert)
}
resp, err := client.R().Get("/version")
// check v1 path first
resp, err := client.R().Get("/edge/client/v1/version")
if err != nil || resp.StatusCode() != http.StatusOK {
return host
// if v1 path fails, fall back to removed /version path
resp, err = client.R().Get("/version")
if err != nil || resp.StatusCode() != http.StatusOK {
return host
}
}
data, err := gabs.ParseJSON(resp.Body())