f-88: api: ressource /floating-ips, refus et affichage sur la VM #88

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-10-29 21:48:12 +01:00
commit 385ee9d1f0
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
15 changed files with 942 additions and 12 deletions

View file

@ -14,7 +14,7 @@ import (
)
// prefixes énumère les familles de ressources portant une clé /state.
var prefixes = []string{"vpc/", "subnet/", "vm/", "nat-gateway/"}
var prefixes = []string{"vpc/", "subnet/", "vm/", "nat-gateway/", "floating-ip/"}
// legacyStates traduit l'ancien vocabulaire (états VPC/subnet d'avant
// l'unification, et états VM start/stop) vers l'enum courant.

View file

@ -41,6 +41,8 @@ func TestMigrateStates_LegacyMapping(t *testing.T) {
"nat creating": {"nat-gateway/ng-1", "creating", state.Error},
"nat deleting": {"nat-gateway/ng-2", "deleting", state.Error},
"nat running": {"nat-gateway/ng-3", "running", state.Running},
"fip creating": {"floating-ip/fip-1", "creating", state.Error},
"fip running": {"floating-ip/fip-2", "running", state.Running},
}
for _, c := range cases {
kv.AddInDB(db, c.resource+"/state", c.from)