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
119400ad
Commit
119400ad
authored
Apr 11, 2019
by
aaa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use constant blocks to define constants in pkg/kubectl
parent
b359b6bf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
16 deletions
+16
-16
apply_test.go
pkg/kubectl/cmd/apply/apply_test.go
+4
-7
set_serviceaccount_test.go
pkg/kubectl/cmd/set/set_serviceaccount_test.go
+5
-3
model_printer.go
pkg/kubectl/explain/model_printer.go
+7
-6
No files found.
pkg/kubectl/cmd/apply/apply_test.go
View file @
119400ad
...
@@ -100,8 +100,10 @@ const (
...
@@ -100,8 +100,10 @@ const (
dirName
=
"../../../../test/fixtures/pkg/kubectl/cmd/apply/testdir"
dirName
=
"../../../../test/fixtures/pkg/kubectl/cmd/apply/testdir"
filenameRCJSON
=
"../../../../test/fixtures/pkg/kubectl/cmd/apply/rc.json"
filenameRCJSON
=
"../../../../test/fixtures/pkg/kubectl/cmd/apply/rc.json"
filenameWidgetClientside
=
"../../../../test/fixtures/pkg/kubectl/cmd/apply/widget-clientside.yaml"
filenameWidgetClientside
=
"../../../../test/fixtures/pkg/kubectl/cmd/apply/widget-clientside.yaml"
filenameWidgetServerside
=
"../../../../test/fixtures/pkg/kubectl/cmd/apply/widget-serverside.yaml"
filenameWidgetServerside
=
"../../../../test/fixtures/pkg/kubectl/cmd/apply/widget-serverside.yaml"
filenameDeployObjServerside
=
"../../../../test/fixtures/pkg/kubectl/cmd/apply/deploy-serverside.yaml"
filenameDeployObjClientside
=
"../../../../test/fixtures/pkg/kubectl/cmd/apply/deploy-clientside.yaml"
)
)
func
readConfigMapList
(
t
*
testing
.
T
,
filename
string
)
[][]
byte
{
func
readConfigMapList
(
t
*
testing
.
T
,
filename
string
)
[][]
byte
{
...
@@ -870,11 +872,6 @@ func testApplyMultipleObjects(t *testing.T, asList bool) {
...
@@ -870,11 +872,6 @@ func testApplyMultipleObjects(t *testing.T, asList bool) {
}
}
}
}
const
(
filenameDeployObjServerside
=
"../../../../test/fixtures/pkg/kubectl/cmd/apply/deploy-serverside.yaml"
filenameDeployObjClientside
=
"../../../../test/fixtures/pkg/kubectl/cmd/apply/deploy-clientside.yaml"
)
func
readDeploymentFromFile
(
t
*
testing
.
T
,
file
string
)
[]
byte
{
func
readDeploymentFromFile
(
t
*
testing
.
T
,
file
string
)
[]
byte
{
raw
:=
readBytesFromFile
(
t
,
file
)
raw
:=
readBytesFromFile
(
t
,
file
)
obj
:=
&
appsv1
.
Deployment
{}
obj
:=
&
appsv1
.
Deployment
{}
...
...
pkg/kubectl/cmd/set/set_serviceaccount_test.go
View file @
119400ad
...
@@ -41,14 +41,16 @@ import (
...
@@ -41,14 +41,16 @@ import (
"k8s.io/kubernetes/pkg/kubectl/scheme"
"k8s.io/kubernetes/pkg/kubectl/scheme"
)
)
const
serviceAccount
=
"serviceaccount1"
const
(
const
serviceAccountMissingErrString
=
"serviceaccount is required"
serviceAccount
=
"serviceaccount1"
const
resourceMissingErrString
=
`You must provide one or more resources by argument or filename.
serviceAccountMissingErrString
=
"serviceaccount is required"
resourceMissingErrString
=
`You must provide one or more resources by argument or filename.
Example resource specifications include:
Example resource specifications include:
'-f rsrc.yaml'
'-f rsrc.yaml'
'--filename=rsrc.json'
'--filename=rsrc.json'
'<resource> <name>'
'<resource> <name>'
'<resource>'`
'<resource>'`
)
func
TestSetServiceAccountLocal
(
t
*
testing
.
T
)
{
func
TestSetServiceAccountLocal
(
t
*
testing
.
T
)
{
inputs
:=
[]
struct
{
inputs
:=
[]
struct
{
...
...
pkg/kubectl/explain/model_printer.go
View file @
119400ad
...
@@ -21,12 +21,13 @@ import (
...
@@ -21,12 +21,13 @@ import (
"k8s.io/kube-openapi/pkg/util/proto"
"k8s.io/kube-openapi/pkg/util/proto"
)
)
// fieldIndentLevel is the level of indentation for fields.
const
(
const
fieldIndentLevel
=
3
// fieldIndentLevel is the level of indentation for fields.
fieldIndentLevel
=
3
// descriptionIndentLevel is the level of indentation for the
// descriptionIndentLevel is the level of indentation for the
// description.
// description.
const
descriptionIndentLevel
=
5
descriptionIndentLevel
=
5
)
// modelPrinter prints a schema in Writer. Its "Builder" will decide if
// modelPrinter prints a schema in Writer. Its "Builder" will decide if
// it's recursive or not.
// it's recursive or not.
...
...
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