Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Karthik-K-N, this was changed recently via #1869
cc @dharaneeshvrd
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ref. #1933