Skip to content

Commit

Permalink
added annotations to props
Browse files Browse the repository at this point in the history
  • Loading branch information
lidiamokevnina committed Feb 7, 2024
1 parent 56ce7fd commit 9df48d5
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions clientset/v1alpha1/uffizzicluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ type UffizziClusterClient struct {
}

type UffizziClusterProps struct {
Name string
AutoSleep string
Spec v1alpha1.UffizziClusterSpec
Name string
Annotations map[string]string
Spec v1alpha1.UffizziClusterSpec
}

type PatchUffizziClusterProps struct {
Expand Down Expand Up @@ -67,22 +67,14 @@ func (c *UffizziClusterClient) Get(name string, opts metav1.GetOptions) (*v1alph
}

func (c *UffizziClusterClient) Create(clusterProps UffizziClusterProps) (*v1alpha1.UffizziCluster, error) {
autoSleep := clusterProps.AutoSleep

if len(clusterProps.AutoSleep) == 0 {
autoSleep = "true"
}

uffizziCluster := v1alpha1.UffizziCluster{
TypeMeta: metav1.TypeMeta{
Kind: "UffizziCluster",
APIVersion: "uffizzi.com/v1alpha1",
},
ObjectMeta: metav1.ObjectMeta{
Name: clusterProps.Name,
Annotations: map[string]string{
"enterprise.uffizzi.com/http-cluster-sleep": autoSleep,
},
Name: clusterProps.Name,
Annotations: clusterProps.Annotations,
},
Spec: clusterProps.Spec,
}
Expand Down

0 comments on commit 9df48d5

Please sign in to comment.