Skip to content

Commit

Permalink
fix: BuildResourceName
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishan Arya committed Nov 8, 2024
1 parent 1e8b08a commit d891822
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion modules/dagger/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"encoding/json"
"fmt"
"html/template"
"math"
"strings"
"time"

Expand Down Expand Up @@ -198,7 +199,7 @@ func (dd *daggerDriver) getHelmRelease(res resource.Resource, conf Config,
"FLINK_PARALLELISM": conf.Replicas,
},
"projectID": res.Project,
"name": conf.DeploymentID,
"name": modules.BuildResourceName("dagger", res.Name, res.Project, math.MaxInt),
"team": conf.Team,
"flink_name": conf.FlinkName,
"prometheus_url": conf.PrometheusURL,
Expand Down
2 changes: 1 addition & 1 deletion modules/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func BuildResourceName(kind, name, projectID string, limit int) string {
if charSizeToRemove >= 0 {
qualifiedName = sluggedName
} else {
qualifiedName = fmt.Sprintf("%s-%s", sluggedName[:charSizeToRemove+-(hashLength+1)], hashStr)
qualifiedName = fmt.Sprintf("%s-%s", sluggedName[:len(sluggedName)+(charSizeToRemove+-(hashLength+1))], hashStr)
}

return slug(strings.Join([]string{projectID, qualifiedName, kind}, "-"))
Expand Down

0 comments on commit d891822

Please sign in to comment.