Skip to content

Commit

Permalink
Merge pull request #153 from Icinga/fix-cluster
Browse files Browse the repository at this point in the history
Make cluster name nullable
  • Loading branch information
lippserd authored Dec 18, 2024
2 parents c3ae279 + 7815b6d commit 3044b9a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/icinga-kubernetes/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func main() {

clusterInstance := &schemav1.Cluster{
Uuid: schemav1.EnsureUUID(ns.UID),
Name: clusterName,
Name: schemav1.NewNullableString(clusterName),
}

ctx = cluster.NewClusterUuidContext(ctx, clusterInstance.Uuid)
Expand Down
3 changes: 2 additions & 1 deletion pkg/schema/v1/cluster.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package v1

import (
"database/sql"
"github.com/icinga/icinga-go-library/types"
)

type Cluster struct {
Uuid types.UUID
Name string
Name sql.NullString
}
2 changes: 1 addition & 1 deletion schema/mysql/schema.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CREATE TABLE cluster (
uuid binary(16) NOT NULL,
name varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
name varchar(255) COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
PRIMARY KEY (uuid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

Expand Down

0 comments on commit 3044b9a

Please sign in to comment.