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
b0a3f492
Commit
b0a3f492
authored
Apr 19, 2017
by
xu fei
Committed by
xu fei
Apr 19, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove strings.compare(), use string native operation
parent
08ea5387
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
4 deletions
+4
-4
validation.go
pkg/apis/storage/validation/validation.go
+1
-1
photon.go
pkg/cloudprovider/providers/photon/photon.go
+1
-1
printers_test.go
pkg/printers/internalversion/printers_test.go
+1
-1
helpers.go
...8s.io/kube-aggregator/pkg/apis/apiregistration/helpers.go
+1
-1
No files found.
pkg/apis/storage/validation/validation.go
View file @
b0a3f492
...
@@ -42,7 +42,7 @@ func ValidateStorageClassUpdate(storageClass, oldStorageClass *storage.StorageCl
...
@@ -42,7 +42,7 @@ func ValidateStorageClassUpdate(storageClass, oldStorageClass *storage.StorageCl
allErrs
=
append
(
allErrs
,
field
.
Forbidden
(
field
.
NewPath
(
"parameters"
),
"updates to parameters are forbidden."
))
allErrs
=
append
(
allErrs
,
field
.
Forbidden
(
field
.
NewPath
(
"parameters"
),
"updates to parameters are forbidden."
))
}
}
if
st
rings
.
Compare
(
storageClass
.
Provisioner
,
oldStorageClass
.
Provisioner
)
!=
0
{
if
st
orageClass
.
Provisioner
!=
oldStorageClass
.
Provisioner
{
allErrs
=
append
(
allErrs
,
field
.
Forbidden
(
field
.
NewPath
(
"provisioner"
),
"updates to provisioner are forbidden."
))
allErrs
=
append
(
allErrs
,
field
.
Forbidden
(
field
.
NewPath
(
"provisioner"
),
"updates to provisioner are forbidden."
))
}
}
return
allErrs
return
allErrs
...
...
pkg/cloudprovider/providers/photon/photon.go
View file @
b0a3f492
...
@@ -622,7 +622,7 @@ func (pc *PCCloud) DiskIsAttached(pdID string, nodeName k8stypes.NodeName) (bool
...
@@ -622,7 +622,7 @@ func (pc *PCCloud) DiskIsAttached(pdID string, nodeName k8stypes.NodeName) (bool
}
}
for
_
,
vm
:=
range
disk
.
VMs
{
for
_
,
vm
:=
range
disk
.
VMs
{
if
strings
.
Compare
(
vm
,
vmID
)
==
0
{
if
vm
==
vmID
{
return
true
,
nil
return
true
,
nil
}
}
}
}
...
...
pkg/printers/internalversion/printers_test.go
View file @
b0a3f492
...
@@ -2143,7 +2143,7 @@ func TestPrintService(t *testing.T) {
...
@@ -2143,7 +2143,7 @@ func TestPrintService(t *testing.T) {
printService
(
&
test
.
service
,
buf
,
printers
.
PrintOptions
{})
printService
(
&
test
.
service
,
buf
,
printers
.
PrintOptions
{})
// We ignore time
// We ignore time
if
buf
.
String
()
!=
test
.
expect
{
if
buf
.
String
()
!=
test
.
expect
{
t
.
Fatalf
(
"Expected: %s,
got: %s %d"
,
test
.
expect
,
buf
.
String
(),
strings
.
Compare
(
test
.
expect
,
buf
.
String
()
))
t
.
Fatalf
(
"Expected: %s,
but got: %s"
,
test
.
expect
,
buf
.
String
(
))
}
}
buf
.
Reset
()
buf
.
Reset
()
}
}
...
...
staging/src/k8s.io/kube-aggregator/pkg/apis/apiregistration/helpers.go
View file @
b0a3f492
...
@@ -55,7 +55,7 @@ func (s ByPriority) Len() int { return len(s) }
...
@@ -55,7 +55,7 @@ func (s ByPriority) Len() int { return len(s) }
func
(
s
ByPriority
)
Swap
(
i
,
j
int
)
{
s
[
i
],
s
[
j
]
=
s
[
j
],
s
[
i
]
}
func
(
s
ByPriority
)
Swap
(
i
,
j
int
)
{
s
[
i
],
s
[
j
]
=
s
[
j
],
s
[
i
]
}
func
(
s
ByPriority
)
Less
(
i
,
j
int
)
bool
{
func
(
s
ByPriority
)
Less
(
i
,
j
int
)
bool
{
if
s
[
i
]
.
Spec
.
Priority
==
s
[
j
]
.
Spec
.
Priority
{
if
s
[
i
]
.
Spec
.
Priority
==
s
[
j
]
.
Spec
.
Priority
{
return
s
trings
.
Compare
(
s
[
i
]
.
Name
,
s
[
j
]
.
Name
)
<
0
return
s
[
i
]
.
Name
<
s
[
j
]
.
Name
}
}
return
s
[
i
]
.
Spec
.
Priority
<
s
[
j
]
.
Spec
.
Priority
return
s
[
i
]
.
Spec
.
Priority
<
s
[
j
]
.
Spec
.
Priority
}
}
...
...
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