mirror of
https://github.com/openziti/zrok.git
synced 2025-06-20 01:37:52 +02:00
incorporate auto-rebase for environments pointed at https://api.zrok.io (#936)
This commit is contained in:
parent
9cc6d9a71e
commit
e3d3b20f74
@ -6,8 +6,10 @@ import (
|
|||||||
"github.com/openziti/zrok/environment/env_core"
|
"github.com/openziti/zrok/environment/env_core"
|
||||||
"github.com/openziti/zrok/environment/env_v0_3"
|
"github.com/openziti/zrok/environment/env_v0_3"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
const V = "v0.4"
|
const V = "v0.4"
|
||||||
@ -286,6 +288,13 @@ func loadEnvironment() (*env_core.Environment, error) {
|
|||||||
ZitiIdentity: env.ZId,
|
ZitiIdentity: env.ZId,
|
||||||
ApiEndpoint: env.ApiEndpoint,
|
ApiEndpoint: env.ApiEndpoint,
|
||||||
}
|
}
|
||||||
|
if strings.HasPrefix(env.ApiEndpoint, "https://api.zrok.io") {
|
||||||
|
out.ApiEndpoint = "https://api-v1.zrok.io"
|
||||||
|
if err := saveEnvironment(out); err != nil {
|
||||||
|
return nil, errors.Wrap(err, "error auto-rebasing apiEndpoint")
|
||||||
|
}
|
||||||
|
logrus.Info("auto-rebased 'apiEndpoint' for v1.0.x")
|
||||||
|
}
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user