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
f85ac902
Commit
f85ac902
authored
Oct 25, 2016
by
Andy Goldstein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add lister-gen
parent
f67ecd73
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
99 additions
and
0 deletions
+99
-0
.import-restrictions
cmd/libs/go2idl/lister-gen/.import-restrictions
+1
-0
lister.go
cmd/libs/go2idl/lister-gen/generators/lister.go
+0
-0
tags.go
cmd/libs/go2idl/lister-gen/generators/tags.go
+33
-0
main.go
cmd/libs/go2idl/lister-gen/main.go
+48
-0
.linted_packages
hack/.linted_packages
+1
-0
update-codegen.sh
hack/update-codegen.sh
+16
-0
No files found.
cmd/libs/go2idl/lister-gen/.import-restrictions
0 → 100644
View file @
f85ac902
{}
cmd/libs/go2idl/lister-gen/generators/lister.go
0 → 100644
View file @
f85ac902
This diff is collapsed.
Click to expand it.
cmd/libs/go2idl/lister-gen/generators/tags.go
0 → 100644
View file @
f85ac902
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
generators
import
(
"github.com/golang/glog"
"k8s.io/gengo/types"
)
// extractBoolTagOrDie gets the comment-tags for the key and asserts that, if
// it exists, the value is boolean. If the tag did not exist, it returns
// false.
func
extractBoolTagOrDie
(
key
string
,
lines
[]
string
)
bool
{
val
,
err
:=
types
.
ExtractSingleBoolCommentTag
(
"+"
,
key
,
false
,
lines
)
if
err
!=
nil
{
glog
.
Fatalf
(
err
.
Error
())
}
return
val
}
cmd/libs/go2idl/lister-gen/main.go
0 → 100644
View file @
f85ac902
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
main
import
(
"path/filepath"
"k8s.io/gengo/args"
"k8s.io/kubernetes/cmd/libs/go2idl/lister-gen/generators"
"github.com/golang/glog"
"github.com/spf13/pflag"
)
func
main
()
{
arguments
:=
&
args
.
GeneratorArgs
{
OutputBase
:
args
.
DefaultSourceTree
(),
GoHeaderFilePath
:
filepath
.
Join
(
args
.
DefaultSourceTree
(),
"k8s.io/kubernetes/hack/boilerplate/boilerplate.go.txt"
),
GeneratedBuildTag
:
"ignore_autogenerated"
,
OutputFileBaseName
:
"zz_generated"
,
OutputPackagePath
:
"k8s.io/kubernetes/pkg/client/listers"
,
}
arguments
.
AddFlags
(
pflag
.
CommandLine
)
// Run it.
if
err
:=
arguments
.
Execute
(
generators
.
NameSystems
(),
generators
.
DefaultNameSystem
(),
generators
.
Packages
,
);
err
!=
nil
{
glog
.
Fatalf
(
"Error: %v"
,
err
)
}
glog
.
V
(
2
)
.
Info
(
"Completed successfully."
)
}
hack/.linted_packages
View file @
f85ac902
...
...
@@ -33,6 +33,7 @@ cmd/libs/go2idl/generator
cmd/libs/go2idl/go-to-protobuf
cmd/libs/go2idl/go-to-protobuf/protoc-gen-gogo
cmd/libs/go2idl/import-boss
cmd/libs/go2idl/lister-gen
cmd/libs/go2idl/openapi-gen
cmd/libs/go2idl/parser
cmd/libs/go2idl/set-gen
...
...
hack/update-codegen.sh
View file @
f85ac902
...
...
@@ -26,11 +26,13 @@ kube::golang::setup_env
BUILD_TARGETS
=(
cmd/libs/go2idl/client-gen
cmd/libs/go2idl/set-gen
cmd/libs/go2idl/lister-gen
)
make
-C
"
${
KUBE_ROOT
}
"
WHAT
=
"
${
BUILD_TARGETS
[*]
}
"
clientgen
=
$(
kube::util::find-binary
"client-gen"
)
setgen
=
$(
kube::util::find-binary
"set-gen"
)
listergen
=
$(
kube::util::find-binary
"lister-gen"
)
# Please do not add any logic to this shell script. Add logic to the go code
# that generates the set-gen program.
...
...
@@ -63,4 +65,18 @@ ${clientgen} --clientset-name=federation_internalclientset --clientset-path=k8s.
${
clientgen
}
--clientset-name
=
federation_release_1_5
--clientset-path
=
k8s.io/kubernetes/federation/client/clientset_generated
--input
=
"../../federation/apis/federation/v1beta1"
,
"api/v1"
,
"extensions/v1beta1"
--included-types-overrides
=
"api/v1/Service,api/v1/Namespace,extensions/v1beta1/ReplicaSet,api/v1/Secret,extensions/v1beta1/Ingress,extensions/v1beta1/Deployment,extensions/v1beta1/DaemonSet,api/v1/ConfigMap,api/v1/Event"
"
$@
"
${
setgen
}
"
$@
"
LISTERGEN_APIS
=(
pkg/api
pkg/api/v1
$(
cd
${
KUBE_ROOT
}
find pkg/apis
-name
types.go | xargs
dirname
|
sort
)
)
LISTERGEN_APIS
=(
${
LISTERGEN_APIS
[@]/#/k8s.io/kubernetes/
}
)
LISTERGEN_APIS
=
$(
IFS
=
,
;
echo
"
${
LISTERGEN_APIS
[*]
}
"
)
${
listergen
}
--input-dirs
"
${
LISTERGEN_APIS
}
"
"
$@
"
# You may add additional calls of code generators like set-gen above.
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