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
13a853f3
Commit
13a853f3
authored
Dec 29, 2015
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #19139 from wojtek-t/enable_testing_client_gen
Auto commit by PR queue bot
parents
43cc8923
9d912e84
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
16 deletions
+10
-16
args.go
cmd/libs/go2idl/args/args.go
+3
-2
testType.go
...l/client-gen/testoutput/testgroup/unversioned/testType.go
+1
-13
run-codegen.sh
hack/after-build/run-codegen.sh
+4
-1
update-codegen.sh
hack/update-codegen.sh
+1
-0
verify-codegen.sh
hack/verify-codegen.sh
+1
-0
No files found.
cmd/libs/go2idl/args/args.go
View file @
13a853f3
...
@@ -37,10 +37,12 @@ import (
...
@@ -37,10 +37,12 @@ import (
// Default returns a defaulted GeneratorArgs. You may change the defaults
// Default returns a defaulted GeneratorArgs. You may change the defaults
// before calling AddFlags.
// before calling AddFlags.
func
Default
()
*
GeneratorArgs
{
func
Default
()
*
GeneratorArgs
{
return
&
GeneratorArgs
{
generatorArgs
:=
&
GeneratorArgs
{
OutputBase
:
DefaultSourceTree
(),
OutputBase
:
DefaultSourceTree
(),
GoHeaderFilePath
:
filepath
.
Join
(
DefaultSourceTree
(),
"k8s.io/kubernetes/hack/boilerplate/boilerplate.go.txt"
),
GoHeaderFilePath
:
filepath
.
Join
(
DefaultSourceTree
(),
"k8s.io/kubernetes/hack/boilerplate/boilerplate.go.txt"
),
}
}
generatorArgs
.
AddFlags
(
pflag
.
CommandLine
)
return
generatorArgs
}
}
// GeneratorArgs has arguments common to most generators.
// GeneratorArgs has arguments common to most generators.
...
@@ -105,7 +107,6 @@ func DefaultSourceTree() string {
...
@@ -105,7 +107,6 @@ func DefaultSourceTree() string {
// If you don't need any non-default behavior, use as:
// If you don't need any non-default behavior, use as:
// args.Default().Execute(...)
// args.Default().Execute(...)
func
(
g
*
GeneratorArgs
)
Execute
(
nameSystems
namer
.
NameSystems
,
defaultSystem
string
,
pkgs
func
(
*
generator
.
Context
,
*
GeneratorArgs
)
generator
.
Packages
)
error
{
func
(
g
*
GeneratorArgs
)
Execute
(
nameSystems
namer
.
NameSystems
,
defaultSystem
string
,
pkgs
func
(
*
generator
.
Context
,
*
GeneratorArgs
)
generator
.
Packages
)
error
{
g
.
AddFlags
(
pflag
.
CommandLine
)
pflag
.
Parse
()
pflag
.
Parse
()
b
,
err
:=
g
.
NewBuilder
()
b
,
err
:=
g
.
NewBuilder
()
...
...
cmd/libs/go2idl/client-gen/testoutput/testgroup/unversioned/testType.go
View file @
13a853f3
...
@@ -90,23 +90,11 @@ func (c *testTypes) Delete(name string, options *api.DeleteOptions) error {
...
@@ -90,23 +90,11 @@ func (c *testTypes) Delete(name string, options *api.DeleteOptions) error {
// DeleteCollection deletes a collection of objects.
// DeleteCollection deletes a collection of objects.
func
(
c
*
testTypes
)
DeleteCollection
(
options
*
api
.
DeleteOptions
,
listOptions
api
.
ListOptions
)
error
{
func
(
c
*
testTypes
)
DeleteCollection
(
options
*
api
.
DeleteOptions
,
listOptions
api
.
ListOptions
)
error
{
if
options
==
nil
{
return
c
.
client
.
Delete
()
.
return
c
.
client
.
Delete
()
.
NamespaceIfScoped
(
c
.
ns
,
len
(
c
.
ns
)
>
0
)
.
NamespaceIfScoped
(
c
.
ns
,
len
(
c
.
ns
)
>
0
)
.
Resource
(
"testTypes"
)
.
Resource
(
"testTypes"
)
.
VersionedParams
(
&
listOptions
,
api
.
Scheme
)
.
VersionedParams
(
&
listOptions
,
api
.
Scheme
)
.
Do
()
.
Body
(
options
)
.
Error
()
}
body
,
err
:=
api
.
Scheme
.
EncodeToVersion
(
options
,
c
.
client
.
APIVersion
()
.
String
())
if
err
!=
nil
{
return
err
}
return
c
.
client
.
Delete
()
.
NamespaceIfScoped
(
c
.
ns
,
len
(
c
.
ns
)
>
0
)
.
Resource
(
"testTypes"
)
.
VersionedParams
(
&
listOptions
,
api
.
Scheme
)
.
Body
(
body
)
.
Do
()
.
Do
()
.
Error
()
Error
()
}
}
...
...
hack/after-build/run-codegen.sh
View file @
13a853f3
...
@@ -24,12 +24,15 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
...
@@ -24,12 +24,15 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
kube::golang::setup_env
kube::golang::setup_env
setgen
=
$(
kube::util::find-binary
"set-gen"
)
setgen
=
$(
kube::util::find-binary
"set-gen"
)
clientgen
=
$(
kube::util::find-binary
"client-gen"
)
# Please do not add any logic to this shell script. Add logic to the go code
# Please do not add any logic to this shell script. Add logic to the go code
# that generates the set-gen program.
# that generates the set-gen program.
#
#
# This can be called with one flag, --verify-only, so it works for both the
# This can be called with one flag, --verify-only, so it works for both the
# update- and verify- scripts.
# update- and verify- scripts.
${
clientgen
}
"
$@
"
${
clientgen
}
-t
"
$@
"
${
setgen
}
"
$@
"
${
setgen
}
"
$@
"
# You may add additional calls of code generators like set-gen
below
.
# You may add additional calls of code generators like set-gen
above
.
hack/update-codegen.sh
View file @
13a853f3
...
@@ -25,6 +25,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
...
@@ -25,6 +25,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
kube::golang::setup_env
kube::golang::setup_env
"
${
KUBE_ROOT
}
/hack/build-go.sh"
cmd/libs/go2idl/client-gen
"
${
KUBE_ROOT
}
/hack/build-go.sh"
cmd/libs/go2idl/set-gen
"
${
KUBE_ROOT
}
/hack/build-go.sh"
cmd/libs/go2idl/set-gen
"
${
KUBE_ROOT
}
/hack/after-build/run-codegen.sh"
"
$@
"
"
${
KUBE_ROOT
}
/hack/after-build/run-codegen.sh"
"
$@
"
hack/verify-codegen.sh
View file @
13a853f3
...
@@ -25,6 +25,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
...
@@ -25,6 +25,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
kube::golang::setup_env
kube::golang::setup_env
"
${
KUBE_ROOT
}
/hack/build-go.sh"
cmd/libs/go2idl/client-gen
"
${
KUBE_ROOT
}
/hack/build-go.sh"
cmd/libs/go2idl/set-gen
"
${
KUBE_ROOT
}
/hack/build-go.sh"
cmd/libs/go2idl/set-gen
"
${
KUBE_ROOT
}
/hack/after-build/run-codegen.sh"
--verify-only
"
${
KUBE_ROOT
}
/hack/after-build/run-codegen.sh"
--verify-only
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