-
Notifications
You must be signed in to change notification settings - Fork 116
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
Route flannel via existing wireguard interface #178
base: master
Are you sure you want to change the base?
Conversation
@xetys @mavimo @JohnnyQQQQ pls advise how to pass codeclimate 4 return statements limit |
@voron IMHO codeclimate check should be ignored in this case. We should "bypass" the check removing the last |
The latter option is the proper way to do that I think. The motivation
behind that comes to mind when someone reads the code for the first time.
Reading two functions with less return statements will be easier to
understand than one function with more. It feels like codeclimate is a
little bit Nazi on that, but the idea behind that still makes sense.
So I suggest to split that into two functions and then we need to test it,
as you stated it is not tested yet. After that I think we can merge it.
Marco Vito Moscaritolo <[email protected]> schrieb am So., 26. Aug.
2018, 15:24:
… @voron <https://github.com/voron> IMHO codeclimate check should be
ignored in this case. We should "bypass" the check removing the last if
and return err, if no error it return nil. This should work but make code
less comprehensible so I prefer to keep it as is.
I just suggest to move the wireguard setup in a separate function as we do
for flannel.
Other possible solution is to create a new function prepareNetwork that
invoke flannel config and wireguard config creating only one return value
(but still a workaround)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#178 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACoVc0Gigk6hUKQpbettPPOh7kLsvJ7Vks5uUqFzgaJpZM4WMbgI>
.
|
@xetys IMHO this rule is too strict in Golang context where the early return approach is a standard, especially for error returning. Aside the above opinion, on the previous comment my last proposal was: func (provisioner *NodeProvisioner) preparePackages() error {
// ...
err = provisioner.prepareNetwork()
if err != nil {
return err
}
return nil
}
func (provisioner *NodeProvisioner) prepareNetwork() error {
err = provisioner.prepareFlannel()
if err != nil {
return err
}
err = provisioner.prepareWireguard()
if err != nil {
return err
}
return nil
} but after consideration I think we should invoke |
@mavimo @xetys I tried to implement some function separation, but I had to cheat anyway, as |
report your test results then please |
Manual cluster create looks good with 1 master and 1 worker : TX offload disabled on |
Here is corresponding flannel issue. flannel healthz check doesn't look useful too. I added to PR and tested "delete flannel pod" work-around, now add-worker/add-external-worker perform as expected. But it's just a work-around. |
Hi, wanna refresh the state on this PR. Is it ready to be reviewed? Does it work for you as expected? |
Yes, the only issue is codeclimate IDK how to avoid.
Yes |
Any updates? |
@itsmepetrov we are working to change the way we create internal network to use the Hetzner network feature. |
Untested
Closes #139