Skip to content

Commit

Permalink
new fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DashLHall committed Oct 21, 2024
1 parent 3b9fc61 commit d0c7a70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions api/agent/spire_apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"context"
"errors"

"github.com/google/uuid"

grpc "google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"

Expand Down
10 changes: 5 additions & 5 deletions api/agent/tornjak_apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ func (s *Server) DefineCluster(inp RegisterClusterRequest) error {
return errors.New("cluster definition missing mandatory field - Name")
} else if len(cinfo.PlatformType) == 0 {
return errors.New("cluster definition missing mandatory field - PlatformType")
} else if len(cinfo.EditedName) > 0 {
return errors.New("cluster definition attempts renaming on create cluster - EditedName")
} else if len(cinfo.EditedUid) > 0 {
return errors.New("cluster definition attempts renaming on create cluster - EditedUid")
}
return s.Db.CreateClusterEntry(cinfo)
}
Expand All @@ -103,12 +103,12 @@ type EditClusterRequest tornjakTypes.ClusterInput
// EditCluster registers cluster to local DB
func (s *Server) EditCluster(inp EditClusterRequest) error {
cinfo := tornjakTypes.ClusterInfo(inp.ClusterInstance)
if len(cinfo.Name) == 0 {
if len(cinfo.Uid) == 0 {
return errors.New("cluster definition missing mandatory field - Name")
} else if len(cinfo.PlatformType) == 0 {
return errors.New("cluster definition missing mandatory field - PlatformType")
} else if len(cinfo.EditedName) == 0 {
return errors.New("cluster definition missing mandatory field - EditedName")
} else if len(cinfo.EditedUid) == 0 {
return errors.New("cluster definition missing mandatory field - EditedUid")
}
return s.Db.EditClusterEntry(cinfo)
}
Expand Down

0 comments on commit d0c7a70

Please sign in to comment.