Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return true when PowerVS network is already created during ReconcileNetwork #1931

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cloud/scope/powervs_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ func (s *PowerVSClusterScope) ReconcileNetwork() (bool, error) {
if networkID != nil {
s.V(3).Info("Found PowerVS network in IBM Cloud", "id", networkID)
s.SetStatus(infrav1beta2.ResourceTypeNetwork, infrav1beta2.ResourceReference{ID: networkID, ControllerCreated: ptr.To(false)})
return false, nil
return true, nil
Copy link
Member

Choose a reason for hiding this comment

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

what will happen when network is there not not in ready state?

Copy link
Contributor

Choose a reason for hiding this comment

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

Are you asking for not ready state for DHCP server? If so we never check for ready state of DHCP server when ever user provides an existing DHCP server name, We try to formulate the possible network name from DHCP server name : https://github.com/Karthik-K-N/cluster-api-provider-ibmcloud/blob/3eb2b524c65167565c595d01e475497b066ef22a/cloud/scope/powervs_cluster.go#L884-L891

I think we should check for DHCP server state as well but not sure there will be condition where DHCP server is not ready but still has network.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also @Amulyam24 this ReconcileNetwork is not following the format of other reconcile function, In every other we expect requeue and error but here we are looking for DHCPactive or err, Thats the main reason for this uncaught error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also @Amulyam24 this ReconcileNetwork is not following the format of other reconcile function, In every other we expect requeue and error but here we are looking for DHCPactive or err, Thats the main reason for this uncaught error.

@Karthik-K-N, this was changed recently via #1869
cc @dharaneeshvrd

Copy link
Contributor

Choose a reason for hiding this comment

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

Since we are not requeuing based on ReconcileNetwork return values, made the changes to set NetworkReady condition based on DHCP server active state returned from ReconcileNetwork.
Missed to handle the existing DHCP server logic, with this change it would return true and NetworkReady can be set to true.
Agree and we should check the state of DHCP server and decide the DHCP server is ok or not based on that.
Because underneath its just a VM, there is a possibility for network to be created and VM can go into bad state.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok then shall I create a issue to track this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ref. #1933

}

dhcpServer, err := s.createDHCPServer()
Expand Down