-
Notifications
You must be signed in to change notification settings - Fork 114
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
liqoctl: add incoming flag to peer and unpeer commands #2318
Conversation
Hi @hamzalsheikh. Thanks for your PR! I am @adamjensenbot.
Make sure this PR appears in the liqo changelog, adding one of the following labels:
|
Both unpeering commands delete the foreign cluster resource. The unpeer out-of-band have a boolean that prevents that, but is always set to true at the moment. |
Thank @hamzalsheikh! When the Can you change the behavior of the flag you are pointing out? |
Sorry, my comment was ambiguous. No change is being made to the outgoing peering. The flag only changes incoming peering variable in foreign cluster spec. I'm pointing out that the current implementation of the unpeer commands automatically deletes the foreign cluster resource. I haven't changed that, but would suggest actively using the UnpeerOOBMode and adding a similar option to Inband in future enhancements. |
Ok, I tested your implementation; if I peer c1 with c2: # on c2
liqoctl generate peer-command # on c1
liqoctl peer ...
k get foreignclusters.discovery.liqo.io
NAME TYPE OUTGOING PEERING INCOMING PEERING NETWORKING AUTHENTICATION AGE
snowy-wood OutOfBand Established None Established Established 97s Then disable the incoming on the other cluster # on c2
liqoctl unpeer --incoming twilight-shape
k get foreignclusters.discovery.liqo.io
NAME TYPE OUTGOING PEERING INCOMING PEERING NETWORKING AUTHENTICATION AGE
twilight-shape OutOfBand None Pending None Established 3m5s and re-enable the incoming on c2 # on c2
liqoctl peer --incoming twilight-shape
k get foreignclusters.discovery.liqo.io
NAME TYPE OUTGOING PEERING INCOMING PEERING NETWORKING AUTHENTICATION AGE
twilight-shape OutOfBand Established Pending Established Established 4m16s It enables the outgoing peering but not the incoming; I expect to do exactly the opposite, leaving the outgoing in the previous state and enabling the incoming. |
The flag should work as expected now. Running peer and unpeer commands with the --incoming flag will only change the foreign cluster resource .spec.incomingPeeringEnabled to yes and no, respectively. Can you please test and confirm. :) However, the PR is not ready to be merged yet.
Correct me if I'm wrong, I don't think the flag should change the Incoming peering status too (in
|
I think the The liqoctl command should not touch the fc status; it has to be handled by the controller, and it is doing that. I see the status change when I change the incoming sets with the cluster peered. It works as expected. What are you saying about the conditions? Can you give an example? It should be ok not to wait because if the cluster is not peered, no change happens in the status. You may consider waiting for incoming != established if the cluster was initially peered. |
The peer and unpeer commands should be working as intended. I'm not waiting on the peering status change, but the change in the foreign cluster resource: |
Thanks @hamzalsheikh! It looks ok; I will test it deeper in the next few days. |
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.
Hi @hamzalsheikh, there is only a small change; then it's ok and we can merge!
Can you please fix it and squash your commits?
4c816b8
to
cefac7b
Compare
/rebase |
cefac7b
to
a0f4daa
Compare
@hamzalsheikh you need to resolve linting and formatting errors. I think if you run |
a24eb1f
to
f7c56f6
Compare
@hamzalsheikh, you still have a minor linting issue; thanks for fixing the others! |
@hamzalsheikh you still have a minor linting issue (it is a whitespace). Running |
/rebase test=true |
/merge |
Description
The pull request adds an incoming flag in the peer and unpeer commands.
User will be able to explicitly set the incoming flag while executing the commands.
Passing --incoming in peer commands sets the ForeignCluster resource .spec.incomingPeeringEnabled to Yes.
Passing --incoming in unpeer commands sets the ForeignCluster resource .spec.incomingPeeringEnabled to No.
Fixes #957
How Has This Been Tested?