Skip to content

Commit

Permalink
feat(schema): add labels to cluster and scheduler_task
Browse files Browse the repository at this point in the history
Also, remove deprecated tags field.
  • Loading branch information
Michal-Leszczynski authored and karol-kokoszka committed Aug 9, 2024
1 parent c0be79b commit 11ecedd
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 17 deletions.
3 changes: 2 additions & 1 deletion pkg/schema/table/table.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/schema/table/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ var SchedulerTaskUpdate = table.New(table.Metadata{
"enabled",
"id",
"name",
"labels",
"properties",
"sched",
"tags",
"type",
},
PartKey: []string{
Expand Down
13 changes: 7 additions & 6 deletions pkg/service/cluster/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ import (

// Cluster specifies a cluster properties.
type Cluster struct {
ID uuid.UUID `json:"id"`
Name string `json:"name"`
Host string `json:"host"`
KnownHosts []string `json:"-"`
Port int `json:"port,omitempty"`
AuthToken string `json:"auth_token"`
ID uuid.UUID `json:"id"`
Name string `json:"name"`
Labels map[string]string `json:"labels"`
Host string `json:"host"`
KnownHosts []string `json:"-"`
Port int `json:"port,omitempty"`
AuthToken string `json:"auth_token"`

ForceTLSDisabled bool `json:"force_tls_disabled"`
ForceNonSSLSessionPort bool `json:"force_non_ssl_session_port"`
Expand Down
19 changes: 10 additions & 9 deletions pkg/service/scheduler/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,15 +323,16 @@ func (s Schedule) backoff() retry.Backoff {

// Task specify task type, properties and schedule.
type Task struct {
ClusterID uuid.UUID `json:"cluster_id"`
Type TaskType `json:"type"`
ID uuid.UUID `json:"id"`
Name string `json:"name"`
Tags []string `json:"tags,omitempty"`
Enabled bool `json:"enabled,omitempty"`
Deleted bool `json:"deleted,omitempty"`
Sched Schedule `json:"schedule,omitempty"`
Properties json.RawMessage `json:"properties,omitempty"`
ClusterID uuid.UUID `json:"cluster_id"`
Type TaskType `json:"type"`
ID uuid.UUID `json:"id"`
Name string `json:"name"`
Labels map[string]string `json:"labels"`
Enabled bool `json:"enabled,omitempty"`
Deleted bool `json:"deleted,omitempty"`
Sched Schedule `json:"schedule,omitempty"`
Properties json.RawMessage `json:"properties,omitempty"`
Tags []string

Status Status `json:"status"`
SuccessCount int `json:"success_count"`
Expand Down
3 changes: 3 additions & 0 deletions schema/v3.3.1.cql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE cluster ADD labels map<text, text>;
ALTER TABLE scheduler_task DROP tags;
ALTER TABLE scheduler_task ADD labels map<text, text>;

0 comments on commit 11ecedd

Please sign in to comment.