Merged in feature/ZITADOPER-1-initial-operator-build (pull request #4)
Feature/ZITADOPER-1 initial operator build
This commit is contained in:
@@ -389,9 +389,22 @@ func (r *ZitadelClusterReconciler) reconcileDefaultInstance(ctx context.Context,
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return ctrl.Result{}, fmt.Errorf("Error listing instances: %v", err)
|
return ctrl.Result{}, fmt.Errorf("Error listing instances: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, instance := range resp.Result {
|
for _, instance := range resp.Result {
|
||||||
if instance != nil {
|
if instance != nil {
|
||||||
if instance.Id != zitadel.Status.DefaultInstanceId || zitadel.Status.DefaultInstanceId == "" {
|
if instance.Id != zitadel.Status.DefaultInstanceId || zitadel.Status.DefaultInstanceId == "" {
|
||||||
|
for _, domain := range instance.Domains {
|
||||||
|
if domain != nil {
|
||||||
|
if !domain.Generated {
|
||||||
|
if _, err := ztdClient.RemoveDomain(ctx, &pb.RemoveDomainRequest{
|
||||||
|
InstanceId: instance.Id,
|
||||||
|
Domain: domain.Domain,
|
||||||
|
}); err != nil {
|
||||||
|
return ctrl.Result{}, fmt.Errorf("Error removing domain in instance: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
fmt.Println("DELETING INSTANCE")
|
fmt.Println("DELETING INSTANCE")
|
||||||
_, err := ztdClient.RemoveInstance(ctx, &pb.RemoveInstanceRequest{InstanceId: instance.Id})
|
_, err := ztdClient.RemoveInstance(ctx, &pb.RemoveInstanceRequest{InstanceId: instance.Id})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user