Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/chart/chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ func (t *Testing) CheckVersionIncrement(chart *Chart) error {
}

if result >= 0 {
return errors.New("chart version not ok. Needs a version bump! ")
return errors.New("chart version not ok. Needs a version bump!")
}

fmt.Println("Chart version ok.")
Expand Down
8 changes: 5 additions & 3 deletions pkg/tool/kubectl.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,16 @@ func (k Kubectl) WaitForDeployments(namespace string, selector string) error {
}

func (k Kubectl) GetPodsforDeployment(namespace string, deployment string) ([]string, error) {
jsonString, _ := k.exec.RunProcessAndCaptureStdout("kubectl",
jsonString, err := k.exec.RunProcessAndCaptureStdout("kubectl",
fmt.Sprintf("--request-timeout=%s", k.timeout),
"get", "deployment", deployment, "--namespace", namespace, "--output=json")
var deploymentMap map[string]any
err := json.Unmarshal([]byte(jsonString), &deploymentMap)
if err != nil {
return nil, err
}
var deploymentMap map[string]any
if err := json.Unmarshal([]byte(jsonString), &deploymentMap); err != nil {
return nil, err
}

spec := deploymentMap["spec"].(map[string]any)
selector := spec["selector"].(map[string]any)
Expand Down
6 changes: 3 additions & 3 deletions pkg/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import (

const chars = "1234567890abcdefghijklmnopqrstuvwxyz"

var sanitizeNameRe = regexp.MustCompile("^[^a-zA-Z0-9]+")

type Maintainer struct {
Name string `yaml:"name"`
Email string `yaml:"email"`
Expand Down Expand Up @@ -217,14 +219,12 @@ func GithubGroupsEnd(w io.Writer) {
}

func SanitizeName(s string, maxLength int) string {
reg := regexp.MustCompile("^[^a-zA-Z0-9]+")

excess := len(s) - maxLength
result := s
if excess > 0 {
result = s[excess:]
}
return reg.ReplaceAllString(result, "")
return sanitizeNameRe.ReplaceAllString(result, "")
}

func GetRandomPort() (int, error) {
Expand Down