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
7589ef92
Commit
7589ef92
authored
Aug 08, 2017
by
NickrenREN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean validation_test go file
When i wrote test cases for local storage quota, found some unused vars and useless code, remove them
parent
5793be77
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
17 deletions
+0
-17
validation_test.go
pkg/api/validation/validation_test.go
+0
-17
No files found.
pkg/api/validation/validation_test.go
View file @
7589ef92
...
@@ -38,11 +38,6 @@ import (
...
@@ -38,11 +38,6 @@ import (
const
(
const
(
dnsLabelErrMsg
=
"a DNS-1123 label must consist of"
dnsLabelErrMsg
=
"a DNS-1123 label must consist of"
dnsSubdomainLabelErrMsg
=
"a DNS-1123 subdomain"
dnsSubdomainLabelErrMsg
=
"a DNS-1123 subdomain"
labelErrMsg
=
"a valid label must be an empty string or consist of"
lowerCaseLabelErrMsg
=
"a valid label must consist of"
maxLengthErrMsg
=
"must be no more than"
namePartErrMsg
=
"name part must consist of"
nameErrMsg
=
"a qualified name must consist of"
envVarNameErrMsg
=
"a valid environment variable name must consist of"
envVarNameErrMsg
=
"a valid environment variable name must consist of"
)
)
...
@@ -9349,29 +9344,17 @@ func TestValidateBasicAuthSecret(t *testing.T) {
...
@@ -9349,29 +9344,17 @@ func TestValidateBasicAuthSecret(t *testing.T) {
var
(
var
(
missingBasicAuthUsernamePasswordKeys
=
validBasicAuthSecret
()
missingBasicAuthUsernamePasswordKeys
=
validBasicAuthSecret
()
// invalidBasicAuthUsernamePasswordKey = validBasicAuthSecret()
// emptyBasicAuthUsernameKey = validBasicAuthSecret()
// emptyBasicAuthPasswordKey = validBasicAuthSecret()
)
)
delete
(
missingBasicAuthUsernamePasswordKeys
.
Data
,
api
.
BasicAuthUsernameKey
)
delete
(
missingBasicAuthUsernamePasswordKeys
.
Data
,
api
.
BasicAuthUsernameKey
)
delete
(
missingBasicAuthUsernamePasswordKeys
.
Data
,
api
.
BasicAuthPasswordKey
)
delete
(
missingBasicAuthUsernamePasswordKeys
.
Data
,
api
.
BasicAuthPasswordKey
)
// invalidBasicAuthUsernamePasswordKey.Data[api.BasicAuthUsernameKey] = []byte("bad")
// invalidBasicAuthUsernamePasswordKey.Data[api.BasicAuthPasswordKey] = []byte("bad")
// emptyBasicAuthUsernameKey.Data[api.BasicAuthUsernameKey] = []byte("")
// emptyBasicAuthPasswordKey.Data[api.BasicAuthPasswordKey] = []byte("")
tests
:=
map
[
string
]
struct
{
tests
:=
map
[
string
]
struct
{
secret
api
.
Secret
secret
api
.
Secret
valid
bool
valid
bool
}{
}{
"valid"
:
{
validBasicAuthSecret
(),
true
},
"valid"
:
{
validBasicAuthSecret
(),
true
},
"missing username and password"
:
{
missingBasicAuthUsernamePasswordKeys
,
false
},
"missing username and password"
:
{
missingBasicAuthUsernamePasswordKeys
,
false
},
// "invalid username and password": {invalidBasicAuthUsernamePasswordKey, false},
// "empty username": {emptyBasicAuthUsernameKey, false},
// "empty password": {emptyBasicAuthPasswordKey, false},
}
}
for
name
,
tc
:=
range
tests
{
for
name
,
tc
:=
range
tests
{
...
...
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