mirror of
https://github.com/openziti/zrok.git
synced 2025-02-08 14:29:52 +01:00
lint (#131)
This commit is contained in:
parent
d238809481
commit
2fda4351ed
@ -78,16 +78,16 @@ func assertZrokProxyConfigType(edge *rest_management_api_client.ZitiEdgeManageme
|
|||||||
func getIdentityId(identityName string) (string, error) {
|
func getIdentityId(identityName string) (string, error) {
|
||||||
zif, err := zrokdir.ZitiIdentityFile(identityName)
|
zif, err := zrokdir.ZitiIdentityFile(identityName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", errors.Wrapf(err, "error opening identity '%v' from zrokdir: %v", identityName)
|
return "", errors.Wrapf(err, "error opening identity '%v' from zrokdir", identityName)
|
||||||
}
|
}
|
||||||
zcfg, err := config2.NewFromFile(zif)
|
zcfg, err := config2.NewFromFile(zif)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", errors.Wrapf(err, "error loading ziti config from file '%v': %v", zif)
|
return "", errors.Wrapf(err, "error loading ziti config from file '%v'", zif)
|
||||||
}
|
}
|
||||||
zctx := ziti.NewContextWithConfig(zcfg)
|
zctx := ziti.NewContextWithConfig(zcfg)
|
||||||
id, err := zctx.GetCurrentIdentity()
|
id, err := zctx.GetCurrentIdentity()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", errors.Wrapf(err, "error getting current identity from '%v': %v", zif)
|
return "", errors.Wrapf(err, "error getting current identity from '%v'", zif)
|
||||||
}
|
}
|
||||||
return id.Id, nil
|
return id.Id, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user