Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kubelet tests broken on Macs with uppercase names #5174

Merged
merged 1 commit into from
Mar 9, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkg/kubelet/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"fmt"
"os"
"reflect"
"strings"
"sync"

"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
Expand Down Expand Up @@ -367,5 +368,6 @@ func GeneratePodName(name string) (string, error) {
if err != nil {
return "", err
}
hostname = strings.ToLower(hostname)
return fmt.Sprintf("%s-%s", name, hostname), nil
}
2 changes: 2 additions & 0 deletions pkg/kubelet/config/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"os"
"path/filepath"
"sort"
"strings"
"time"

"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
Expand Down Expand Up @@ -172,6 +173,7 @@ func extractFromFile(filename string) (api.BoundPod, error) {
if err != nil {
return pod, err
}
hostname = strings.ToLower(hostname)

if len(pod.UID) == 0 {
hasher := md5.New()
Expand Down
2 changes: 2 additions & 0 deletions pkg/kubelet/config/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"encoding/json"
"net/http/httptest"
"os"
"strings"
"testing"
"time"

Expand Down Expand Up @@ -118,6 +119,7 @@ func TestExtractInvalidManifest(t *testing.T) {

func TestExtractFromHTTP(t *testing.T) {
hostname, _ := os.Hostname()
hostname = strings.ToLower(hostname)

var testCases = []struct {
desc string
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ func GetHostname(hostnameOverride string) string {
}
hostname = fqdn
}
return strings.TrimSpace(string(hostname))
return strings.ToLower(strings.TrimSpace(string(hostname)))
}