Skip to content

Commit

Permalink
lca: updating the seedgenerator - singleton
Browse files Browse the repository at this point in the history
The seedgenerator can have a specific name only.
Updating respectively.

Signed-off-by: Alexander Chuzhoy <[email protected]>
  • Loading branch information
achuzhoy committed May 7, 2024
1 parent 0e0d539 commit ea41196
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/lca/seedgenerator.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import (
goclient "sigs.k8s.io/controller-runtime/pkg/client"
)

const (
seedImageName = "seedimage"
)

// SeedGeneratorBuilder provides struct for the seedgenerator object containing connection to
// the cluster and the seedgenerator definitions.
type SeedGeneratorBuilder struct {
Expand Down Expand Up @@ -51,10 +55,10 @@ func NewSeedGeneratorBuilder(
},
}

if name == "" {
glog.V(100).Infof("The name of the seedgenerator is empty")
if name != seedImageName {
glog.V(100).Infof("The name of the seedgenerator must be " + seedImageName)

builder.errorMsg = "SeedGenerator name cannot be empty"
builder.errorMsg = "SeedGenerator name must be " + seedImageName
}

return &builder
Expand Down

0 comments on commit ea41196

Please sign in to comment.