Skip to content

Conversation

@vandjelk
Copy link
Contributor

@vandjelk vandjelk commented Oct 13, 2025

Description

Changes proposed in this pull request:

  • loading of local and remote Network moved to common VPC peering reconciler
  • waits if local or remote Network status is not Ready
  • error if local or remote Network status is Error

Related issue(s)

@vandjelk vandjelk requested a review from a team as a code owner October 13, 2025 08:23
Copy link
Contributor

@tmilos77 tmilos77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the logic so it checks the conditions of the network

  • not ready - keep waiting
  • error - set error on peering as well
  • ready - it must have status.network ref

@vandjelk vandjelk changed the title chore(VpcPeering): remove duplicated code that load local and remote KCP Network chore(VpcPeering): remove duplicated code that load local and remote KCP Network Oct 13, 2025
@vandjelk vandjelk requested a review from tmilos77 October 14, 2025 08:07
Copy link
Contributor

@tmilos77 tmilos77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR seems as incomplete with flaws in the logic, would say a makeover if required

  • errors other then NotFound are not handled
  • NotFound error should be communicated in the status
  • nil errors logged in case of deletion
  • whole peering flow interrupted with forget when peering deleted

@vandjelk vandjelk force-pushed the peering/load-kcp-networks branch from c639255 to 6f57c72 Compare October 16, 2025 10:48
Copy link
Contributor

@tmilos77 tmilos77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • for delete edge log error so the case is easily spotted in logs
  • wait for network ready set status and requeue

@vandjelk vandjelk enabled auto-merge (squash) October 22, 2025 09:44
@vandjelk vandjelk requested a review from tmilos77 October 22, 2025 09:45
Copy link
Contributor

@tmilos77 tmilos77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cloud provider specific part can not ignore and continue if local/remote network are not set, either

  • optimistically assume they are set since common part called the provider specific part
  • defensively assert they are not nil and log huge common.ErrLogical if so and return immediately

// remote client can't be created if remote network is not found
if state.remoteNetwork == nil {
return nil, nil
if state.RemoteNetwork() == nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole point of the common load local/remote network refactored out to the common side is that it ensures those objects. If it's a guarantee then it shouldn't be checked, and even less ignored if none is set. If the common part is ensuring local/remote network as they are required then this can not ignore if they are not set.
Either

  • ensure that common part will not call the provider part and local/remote network will always be loaded and optimistically just assume they are set
  • defensively log huge common.ErrLogical if any of them is nil and STOP FURTHER PROCESSING since preconditions are not met

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary nil checks removed.

@vandjelk vandjelk requested a review from tmilos77 October 24, 2025 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants