Skip to content

Commit d1dabce

Browse files
tcdowneywinkingturtle-vmw
authored andcommitted
Add optional cell annotations field to CellPresence
- Adds properties for a Diego cell rep to be able to provide arbitrary metadata about the cell ai-assisted=yes
1 parent 6b8c5ee commit d1dabce

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

jobs/rep/spec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ properties:
8282
diego.rep.optional_placement_tags:
8383
description: "Array of optional tags used for scheduling Tasks and LRPs"
8484
default: []
85+
diego.rep.cell_annotations:
86+
description: "Map of string key-value annotations to attach to the cell presence"
87+
default: {}
8588

8689
loggregator.v2_api_port:
8790
description: "Local metron agent gRPC port"

jobs/rep/templates/rep.json.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
max_concurrent_downloads: p("diego.executor.max_concurrent_downloads"),
9797
memory_mb: p("diego.executor.memory_capacity_mb").to_s,
9898
metrics_work_pool_size: p("diego.executor.metrics_work_pool_size"),
99+
cell_annotations: p("diego.rep.cell_annotations"),
99100
optional_placement_tags: p("diego.rep.optional_placement_tags"),
100101
placement_tags: p("diego.rep.placement_tags"),
101102
polling_interval: "#{p("diego.rep.polling_interval_in_seconds")}s",

src/code.cloudfoundry.org/auctioneer/auctionrunnerdelegate/auctionrunnerdelegate_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ var _ = Describe("Auction Runner Delegate", func() {
4141
Describe("fetching cell reps", func() {
4242
Context("when the BSS succeeds", func() {
4343
BeforeEach(func() {
44-
cellPresence1 := models.NewCellPresence("cell-A", "cell-a.url", "", "zone-1", models.NewCellCapacity(123, 456, 789), []string{}, []string{}, []string{}, []string{}, []string{})
45-
cellPresence2 := models.NewCellPresence("cell-B", "cell-b.url", "", "zone-1", models.NewCellCapacity(123, 456, 789), []string{}, []string{}, []string{}, []string{}, []string{})
44+
cellPresence1 := models.NewCellPresence("cell-A", "cell-a.url", "", "zone-1", models.NewCellCapacity(123, 456, 789), []string{}, []string{}, []string{}, []string{}, []string{}, nil)
45+
cellPresence2 := models.NewCellPresence("cell-B", "cell-b.url", "", "zone-1", models.NewCellCapacity(123, 456, 789), []string{}, []string{}, []string{}, []string{}, []string{}, nil)
4646
cells := []*models.CellPresence{&cellPresence1, &cellPresence2}
4747

4848
bbsClient.CellsReturns(cells, nil)
@@ -76,6 +76,7 @@ var _ = Describe("Auction Runner Delegate", func() {
7676
[]string{},
7777
[]string{},
7878
[]string{},
79+
nil,
7980
)
8081
cells := []*models.CellPresence{&cellPresence}
8182
bbsClient.CellsReturns(cells, nil)
@@ -126,6 +127,7 @@ var _ = Describe("Auction Runner Delegate", func() {
126127
[]string{},
127128
[]string{},
128129
[]string{},
130+
nil,
129131
)
130132
cells := []*models.CellPresence{&cellPresence}
131133
bbsClient.CellsReturns(cells, nil)

0 commit comments

Comments
 (0)