mirror of
https://github.com/openziti/ziti.git
synced 2026-10-12 15:28:05 +00:00
Add fix for determining mgmt API path. Fix CLI config dir setting.
This commit is contained in:
+3
-2
@@ -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
|
||||
|
||||
@@ -47,7 +47,6 @@ func WorkingDir() (string, error) {
|
||||
}
|
||||
|
||||
func GetZitiHome() (string, error) {
|
||||
|
||||
// Get path from env variable
|
||||
retVal := os.Getenv(constants.ZitiHomeVarName)
|
||||
|
||||
|
||||
+1
-14
@@ -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
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user