f-50: lab: déploiement de two sur les hyperviseurs et provisionnement en un script #50
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
8d1691ae94
commit
f424d15213
16 changed files with 360 additions and 64 deletions
|
|
@ -23,6 +23,7 @@ const (
|
|||
var (
|
||||
namePattern = regexp.MustCompile(`^[a-z][a-z0-9-]{0,14}$`)
|
||||
segmentPattern = regexp.MustCompile(`^[a-z][a-z0-9]{0,11}$`)
|
||||
releasePattern = regexp.MustCompile(`^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$`)
|
||||
)
|
||||
|
||||
func (t *Topology) Validate() error {
|
||||
|
|
@ -206,6 +207,14 @@ func validateExtras(n Node, segments map[string]Segment, add func(string, ...any
|
|||
}
|
||||
}
|
||||
}
|
||||
switch {
|
||||
case n.Role == RoleHypervisor && n.Release == "":
|
||||
add("node %s: a hypervisor needs the release of two to deploy (release: <tag>)", n.Name)
|
||||
case n.Role == RoleHypervisor && !releasePattern.MatchString(n.Release):
|
||||
add("node %s: release %q must match %s", n.Name, n.Release, releasePattern)
|
||||
case n.Role != RoleHypervisor && n.Release != "":
|
||||
add("node %s: release is only for hypervisors", n.Name)
|
||||
}
|
||||
if n.Loopback != "" {
|
||||
prefix, err := netip.ParsePrefix(n.Loopback)
|
||||
switch {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue