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

[CLOYSTER-130] Do not allow choosing the internal NIC when selecting the external #88

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

arthurmco
Copy link
Collaborator

@arthurmco arthurmco commented Nov 26, 2024

Remove the selected internal NIC when presenting a list of possible external interfaces.

Also remove the act of selecting an interface (and filling the parameters) from saving them to the model, to allow a better error handling later.

Also remove conflicts that happen when we run the software twice, of connections already existing, by deleting the old before creating the new one.

@arthurmco arthurmco self-assigned this Nov 26, 2024
Copy link

sonarcloud bot commented Nov 26, 2024

@dhilst
Copy link

dhilst commented Nov 26, 2024

Also remove conflicts that happen when we run the software twice, of connections already existing, by deleting the old one before creating the new one.

We'll need almost everything that can be done in the cluster to be idempotent. I usually use Idemp suffix to clarify that something should be idempotent. I would suggest an idempotent abstract class, but I don't know if it is too early. Something like (in pseudo code)

class Idemp {
  bool check() = 0;
  void doit(args) { if check() { return; } else /* do stuff */ }
}

I'm afraid of using inheritance for that, I don't know if we can have a compositional way of expressing this. Maybe using concepts?

@dhilst
Copy link

dhilst commented Nov 26, 2024

idempotent

Just to make it clear, by idempotent, in this case, I mean "doing something twice yields the same result". For example, enabling the same service twice should be the same as enabling the service once. Adding the same address to the same network twice should be the same as adding that address to the network once.

In general, for any task T, doing T(), T(); T(), T(); T(); ...; T() should be the same.

It makes things easier too if for each task T we have an inverse that undoes T, let's say R, so that T(); R() puts the system in the same state it was before. So T(); R(); T() is the same as T(), and R should be idempotent too so T(); R(); R(); T(); is the same as T(); R(); T(), which is the same as T().

The motivation is that, if we have these properties (idempotency and inverse) we do not have to worry about the order things are executed, they all converge to some predictable state. If I have a task P that depends on T I can just call T() in Q and if P depends on T too I can just call it again, P and Q can be executed in any order, and doesn't need to know on each other. The inverse is one way of achieving idempotency, but it may not always be possible, for example, you cannot delete the hostname of a machine, only change it, so there is no reverse for setting up a hostname, adding an IP address to a network has an inverse.

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