Add changelog file. Add meta to ns mock for testing

This commit is contained in:
Jorge Marey 2022-03-07 10:56:56 +01:00
parent a466f01120
commit 372ea7479b
2 changed files with 6 additions and 1 deletions

3
.changelog/12138.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:improvement
namespaces: Allow adding custom metadata to namespaces.
```

View File

@ -2246,8 +2246,10 @@ func AllocNetworkStatus() *structs.AllocNetworkStatus {
} }
func Namespace() *structs.Namespace { func Namespace() *structs.Namespace {
uuid := uuid.Generate()
ns := &structs.Namespace{ ns := &structs.Namespace{
Name: fmt.Sprintf("team-%s", uuid.Generate()), Name: fmt.Sprintf("team-%s", uuid),
Meta: map[string]string{"team": uuid},
Description: "test namespace", Description: "test namespace",
CreateIndex: 100, CreateIndex: 100,
ModifyIndex: 200, ModifyIndex: 200,