This commit is contained in:
Michael Quigley 2022-12-05 14:06:53 -05:00
parent d238809481
commit 2fda4351ed
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62

View File

@ -78,16 +78,16 @@ func assertZrokProxyConfigType(edge *rest_management_api_client.ZitiEdgeManageme
func getIdentityId(identityName string) (string, error) {
zif, err := zrokdir.ZitiIdentityFile(identityName)
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)
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)
id, err := zctx.GetCurrentIdentity()
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
}