Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
02590e9a
Commit
02590e9a
authored
Mar 09, 2015
by
Victor Marmol
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5174 from smarterclayton/lowercase_hostname
Kubelet tests broken on Macs with uppercase names
parents
ee1e40d4
0f873376
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
1 deletion
+7
-1
config.go
pkg/kubelet/config/config.go
+2
-0
file.go
pkg/kubelet/config/file.go
+2
-0
http_test.go
pkg/kubelet/config/http_test.go
+2
-0
node.go
pkg/util/node.go
+1
-1
No files found.
pkg/kubelet/config/config.go
View file @
02590e9a
...
@@ -20,6 +20,7 @@ import (
...
@@ -20,6 +20,7 @@ import (
"fmt"
"fmt"
"os"
"os"
"reflect"
"reflect"
"strings"
"sync"
"sync"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
...
@@ -367,5 +368,6 @@ func GeneratePodName(name string) (string, error) {
...
@@ -367,5 +368,6 @@ func GeneratePodName(name string) (string, error) {
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
}
}
hostname
=
strings
.
ToLower
(
hostname
)
return
fmt
.
Sprintf
(
"%s-%s"
,
name
,
hostname
),
nil
return
fmt
.
Sprintf
(
"%s-%s"
,
name
,
hostname
),
nil
}
}
pkg/kubelet/config/file.go
View file @
02590e9a
...
@@ -25,6 +25,7 @@ import (
...
@@ -25,6 +25,7 @@ import (
"os"
"os"
"path/filepath"
"path/filepath"
"sort"
"sort"
"strings"
"time"
"time"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
...
@@ -172,6 +173,7 @@ func extractFromFile(filename string) (api.BoundPod, error) {
...
@@ -172,6 +173,7 @@ func extractFromFile(filename string) (api.BoundPod, error) {
if
err
!=
nil
{
if
err
!=
nil
{
return
pod
,
err
return
pod
,
err
}
}
hostname
=
strings
.
ToLower
(
hostname
)
if
len
(
pod
.
UID
)
==
0
{
if
len
(
pod
.
UID
)
==
0
{
hasher
:=
md5
.
New
()
hasher
:=
md5
.
New
()
...
...
pkg/kubelet/config/http_test.go
View file @
02590e9a
...
@@ -20,6 +20,7 @@ import (
...
@@ -20,6 +20,7 @@ import (
"encoding/json"
"encoding/json"
"net/http/httptest"
"net/http/httptest"
"os"
"os"
"strings"
"testing"
"testing"
"time"
"time"
...
@@ -118,6 +119,7 @@ func TestExtractInvalidManifest(t *testing.T) {
...
@@ -118,6 +119,7 @@ func TestExtractInvalidManifest(t *testing.T) {
func
TestExtractFromHTTP
(
t
*
testing
.
T
)
{
func
TestExtractFromHTTP
(
t
*
testing
.
T
)
{
hostname
,
_
:=
os
.
Hostname
()
hostname
,
_
:=
os
.
Hostname
()
hostname
=
strings
.
ToLower
(
hostname
)
var
testCases
=
[]
struct
{
var
testCases
=
[]
struct
{
desc
string
desc
string
...
...
pkg/util/node.go
View file @
02590e9a
...
@@ -34,5 +34,5 @@ func GetHostname(hostnameOverride string) string {
...
@@ -34,5 +34,5 @@ func GetHostname(hostnameOverride string) string {
}
}
hostname
=
fqdn
hostname
=
fqdn
}
}
return
strings
.
T
rimSpace
(
string
(
hostname
))
return
strings
.
T
oLower
(
strings
.
TrimSpace
(
string
(
hostname
)
))
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment