Fix key creation apiAPP
[ZITADOPER-1]
This commit is contained in:
@@ -198,14 +198,14 @@ func (wr *wrappedAPIAppReconciler) reconcileKeys(ctx context.Context, ztdClient
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if wr.APIApp.Status.KeyId != "" {
|
if wr.APIApp.Status.KeyId != "" {
|
||||||
_, err = ztdClient.GetAppKey(middleware.SetOrgID(ctx, org.Status.OrgId), &pb.GetAppKeyRequest{
|
_, err := ztdClient.GetAppKey(middleware.SetOrgID(ctx, org.Status.OrgId), &pb.GetAppKeyRequest{
|
||||||
ProjectId: project.Status.ProjectId,
|
ProjectId: project.Status.ProjectId,
|
||||||
AppId: wr.APIApp.Status.AppId,
|
AppId: wr.APIApp.Status.AppId,
|
||||||
KeyId: wr.APIApp.Status.KeyId,
|
KeyId: wr.APIApp.Status.KeyId,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if strings.Contains(err.Error(), "AlreadyExists") {
|
if !strings.Contains(err.Error(), "not found") {
|
||||||
return nil
|
return fmt.Errorf("Could not get key: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,7 +142,9 @@ func (wr *wrappedProjectReconciler) reconcileProject(ctx context.Context, ztdCli
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error getting project: %v", err)
|
if !strings.Contains(err.Error(), "not found") {
|
||||||
|
return fmt.Errorf("Error getting project: %v", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user