Fix clusters href
@@ -120,10 +120,6 @@ func NewBareMetalInventory(db *gorm.DB, log logrus.FieldLogger, hostApi host.API
return b
}
-func buildHref(base, id string) *string {
- return swag.String(fmt.Sprintf("%s/%ss/%s", baseHref, base, id))
-}
-
// create discovery image generation job, return job name and error
func (b *bareMetalInventory) createImageJob(cluster *models.Cluster, jobName, imgName, ignitionConfig string) *batch.Job {
return &batch.Job{
@@ -223,7 +219,7 @@ func (b *bareMetalInventory) RegisterCluster(ctx context.Context, params install
log.Infof("Register cluster: %s with id %s", swag.StringValue(params.NewClusterParams.Name), id)
cluster := models.Cluster{
ID: &id,
- Href: buildHref(ResourceKindCluster, id.String()),
+ Href: swag.String(fmt.Sprintf("%s/clusters/%s", baseHref, id.String())),
Kind: swag.String(ResourceKindCluster),
APIVip: params.NewClusterParams.APIVip,
BaseDNSDomain: params.NewClusterParams.BaseDNSDomain,
