Skip to content

Commit

Permalink
Rename 'info' to 'annotations'
Browse files Browse the repository at this point in the history
  • Loading branch information
fridim committed Sep 18, 2020
1 parent c41d86f commit cacd456
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions docs/api-reference/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,8 @@ components:
description: The list of tolerations for this request. Any taint matching the a toleration will be ignored (all taints ignored == cloud can be selected).
items:
$ref: "#/components/schemas/Toleration"
info:
description: This dictionary allow to provide more information about who makes the request. For example: guid, email, ...
annotations:
description: Key / Value map to provide optional information that will be copied to the placement. Annotations can be used later to filter or identify placements.
type: object
additionalProperties:
type: string
Expand Down
2 changes: 1 addition & 1 deletion internal/api/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func v1PostSchedule(w http.ResponseWriter, req *http.Request, params httprouter.
UUID: t.UUID,
Cloud: results[0],
Date: time.Now().UTC().Format(time.RFC3339),
Info: t.Info,
Annotations: t.Annotations,
}
placement.Save(result)
if err := enc.Encode(result) ; err != nil {
Expand Down
12 changes: 8 additions & 4 deletions internal/api/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ type ScheduleQuery struct {
CloudPreference map[string]string `json:"cloud_preference"`
Tolerations []Toleration `json:"tolerations"`
UUID string `json:"uuid,omitempty"`
Info map[string]string `json:"info"`
Annotations map[string]string `json:"annotations"`
}

type Metadata struct {
Annotations map[string]string `json:"annotations"`
}

type GitCommit struct {
Expand Down Expand Up @@ -99,11 +103,11 @@ type Toleration struct {
type Placement struct {
// The uuid of the CloudForms service
UUID string `json:"uuid,omitempty"`
// Date the placement was made. UTF and RFC3339
// Date the placement was made. UTC and RFC3339
Date string `json:"date"`
// The cloud where it was scheduled to.
Cloud Cloud `json:"cloud"`
// Additional optional information
// Annotations
// +optional
Info map[string]string `json:"info"`
Annotations map[string]string `json:"annotations"`
}
4 changes: 2 additions & 2 deletions templates/placements.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<tr>
<td>Issued</td>
<td>UUID</td>
<td>Info</td>
<td>Annotations</td>
<td>Cloud Name</td>
</tr>

Expand All @@ -21,7 +21,7 @@
</td>
<td>
<ul>
{{ range $key, $val := .Info }}
{{ range $key, $val := .Annotations }}
<li><code>{{ $key }}:&nbsp;{{ $val }}</code></li>
{{ end }}
</ul>
Expand Down

0 comments on commit cacd456

Please sign in to comment.