Skip to content

Commit

Permalink
feat(GcpVpcPeering): print current state during wait (#837)
Browse files Browse the repository at this point in the history
  • Loading branch information
dushanpantic authored Nov 28, 2024
1 parent d236db0 commit 12cb732
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package vpcpeering

import (
pb "cloud.google.com/go/compute/apiv1/computepb"
"context"

pb "cloud.google.com/go/compute/apiv1/computepb"
"github.com/kyma-project/cloud-manager/pkg/composed"
"github.com/kyma-project/cloud-manager/pkg/util"
)
Expand All @@ -13,7 +14,7 @@ func waitRemoteVpcPeeringAvailable(ctx context.Context, st composed.State) (erro

if state.remoteVpcPeering.GetState() != pb.NetworkPeering_INACTIVE.String() &&
state.remoteVpcPeering.GetState() != pb.NetworkPeering_ACTIVE.String() {
logger.Info("GCP Remote VPC Peering is not ready yet, re-queueing with delay")
logger.Info("GCP Remote VPC Peering is not ready yet, re-queueing with delay", "currentState", state.remoteVpcPeering.GetState())
return composed.StopWithRequeueDelay(util.Timing.T10000ms()), nil
}

Expand Down
5 changes: 3 additions & 2 deletions pkg/kcp/provider/gcp/vpcpeering/waitVpcPeeringActive.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package vpcpeering

import (
pb "cloud.google.com/go/compute/apiv1/computepb"
"context"

pb "cloud.google.com/go/compute/apiv1/computepb"
"github.com/kyma-project/cloud-manager/pkg/composed"
"github.com/kyma-project/cloud-manager/pkg/util"
)
Expand All @@ -12,7 +13,7 @@ func waitVpcPeeringActive(ctx context.Context, st composed.State) (error, contex
logger := composed.LoggerFromCtx(ctx)

if state.kymaVpcPeering.GetState() != pb.NetworkPeering_ACTIVE.String() && state.remoteVpcPeering.GetState() != pb.NetworkPeering_ACTIVE.String() {
logger.Info("GCP VPC Peering is not ready yet, re-queueing with delay")
logger.Info("GCP VPC Peering is not ready yet, re-queueing with delay", "currentState", state.remoteVpcPeering.GetState())
return composed.StopWithRequeueDelay(util.Timing.T10000ms()), nil
}

Expand Down

0 comments on commit 12cb732

Please sign in to comment.