Merge pull request #24242 from thockin/godep_vendor_dir
Automatic merge from submit-queue Move godeps to vendor/ This is a first-step towards glide support, maybe we don't want or need to take this, but it was easy to try. This fails to compile, not sure why: ``` # k8s.io/kubernetes/pkg/apis/extensions/v1beta1 _output/local/go/src/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion_generated.go:2703: undefined: extensions.ClusterAutoscaler _output/local/go/src/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion_generated.go:2703: undefined: ClusterAutoscaler _output/local/go/src/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion_generated.go:2719: undefined: extensions.ClusterAutoscaler _output/local/go/src/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion_generated.go:2719: undefined: ClusterAutoscaler _output/local/go/src/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion_generated.go:2723: undefined: extensions.ClusterAutoscalerList _output/local/go/src/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion_generated.go:2723: undefined: ClusterAutoscalerList _output/local/go/src/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion_generated.go:3468: Convert_extensions_JobSpec_To_v1beta1_JobSpec redeclared in this block previous declaration at _output/local/go/src/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion.go:328 _output/local/go/src/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion_generated.go:3845: Convert_extensions_ScaleStatus_To_v1beta1_ScaleStatus redeclared in this block previous declaration at _output/local/go/src/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion.go:98 _output/local/go/src/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion_generated.go:4737: Convert_v1beta1_JobSpec_To_extensions_JobSpec redeclared in this block previous declaration at _output/local/go/src/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion.go:380 _output/local/go/src/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion_generated.go:5186: Convert_v1beta1_ScaleStatus_To_extensions_ScaleStatus redeclared in this block previous declaration at _output/local/go/src/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion.go:120 _output/local/go/src/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion_generated.go:2723: too many errors !!! Error in /home/thockin/tmp/godep-vendor/src/k8s.io/kubernetes/hack/lib/golang.sh:417 ```
This commit is contained in:
83
Godeps/.license_file_state
generated
83
Godeps/.license_file_state
generated
@@ -1,7 +1,3 @@
|
||||
# These files have been checked upstream and are either missing or have no
|
||||
# valuable license/copyright info in them
|
||||
# To regenerate this list, remove this file and rerun update-godep-licenses.sh
|
||||
#
|
||||
bitbucket.org/ww/goautoneg/master/LICENSE
|
||||
bitbucket.org/ww/goautoneg/master/LICENSE.code
|
||||
bitbucket.org/ww/goautoneg/master/LICENSE.txt
|
||||
@@ -18,7 +14,6 @@ raw.githubusercontent.com/armon/go-metrics/master/NOTICE
|
||||
raw.githubusercontent.com/armon/go-metrics/master/NOTICE.txt
|
||||
raw.githubusercontent.com/armon/go-metrics/master/README
|
||||
raw.githubusercontent.com/armon/go-metrics/master/README.md
|
||||
raw.githubusercontent.com/beorn7/perks/master/LICENSE
|
||||
raw.githubusercontent.com/beorn7/perks/master/LICENSE.code
|
||||
raw.githubusercontent.com/beorn7/perks/master/LICENSE.txt
|
||||
raw.githubusercontent.com/beorn7/perks/master/LICENSE.md
|
||||
@@ -33,10 +28,6 @@ raw.githubusercontent.com/boltdb/bolt/master/NOTICE
|
||||
raw.githubusercontent.com/boltdb/bolt/master/NOTICE.txt
|
||||
raw.githubusercontent.com/boltdb/bolt/master/README
|
||||
raw.githubusercontent.com/boltdb/bolt/master/README.md
|
||||
raw.githubusercontent.com/camlistore/go4/master/NOTICE
|
||||
raw.githubusercontent.com/camlistore/go4/master/NOTICE.txt
|
||||
raw.githubusercontent.com/camlistore/go4/master/README
|
||||
raw.githubusercontent.com/camlistore/go4/master/README.md
|
||||
raw.githubusercontent.com/ClusterHQ/flocker-go/master/NOTICE
|
||||
raw.githubusercontent.com/ClusterHQ/flocker-go/master/NOTICE.txt
|
||||
raw.githubusercontent.com/ClusterHQ/flocker-go/master/README
|
||||
@@ -69,6 +60,9 @@ raw.githubusercontent.com/davecgh/go-spew/master/NOTICE
|
||||
raw.githubusercontent.com/davecgh/go-spew/master/NOTICE.txt
|
||||
raw.githubusercontent.com/davecgh/go-spew/master/README
|
||||
raw.githubusercontent.com/davecgh/go-spew/master/README.md
|
||||
raw.githubusercontent.com/daviddengcn/go-colortext/master/LICENSE.code
|
||||
raw.githubusercontent.com/daviddengcn/go-colortext/master/LICENSE.txt
|
||||
raw.githubusercontent.com/daviddengcn/go-colortext/master/LICENSE.md
|
||||
raw.githubusercontent.com/daviddengcn/go-colortext/master/NOTICE
|
||||
raw.githubusercontent.com/daviddengcn/go-colortext/master/NOTICE.txt
|
||||
raw.githubusercontent.com/daviddengcn/go-colortext/master/README
|
||||
@@ -77,6 +71,14 @@ raw.githubusercontent.com/dgrijalva/jwt-go/master/NOTICE
|
||||
raw.githubusercontent.com/dgrijalva/jwt-go/master/NOTICE.txt
|
||||
raw.githubusercontent.com/dgrijalva/jwt-go/master/README
|
||||
raw.githubusercontent.com/dgrijalva/jwt-go/master/README.md
|
||||
raw.githubusercontent.com/docker/engine-api/master/NOTICE
|
||||
raw.githubusercontent.com/docker/engine-api/master/NOTICE.txt
|
||||
raw.githubusercontent.com/docker/engine-api/master/README
|
||||
raw.githubusercontent.com/docker/engine-api/master/README.md
|
||||
raw.githubusercontent.com/docker/go-connections/master/NOTICE
|
||||
raw.githubusercontent.com/docker/go-connections/master/NOTICE.txt
|
||||
raw.githubusercontent.com/docker/go-connections/master/README
|
||||
raw.githubusercontent.com/docker/go-connections/master/README.md
|
||||
raw.githubusercontent.com/elazarl/go-bindata-assetfs/master/NOTICE
|
||||
raw.githubusercontent.com/elazarl/go-bindata-assetfs/master/NOTICE.txt
|
||||
raw.githubusercontent.com/elazarl/go-bindata-assetfs/master/README
|
||||
@@ -97,6 +99,9 @@ raw.githubusercontent.com/fsouza/go-dockerclient/master/NOTICE
|
||||
raw.githubusercontent.com/fsouza/go-dockerclient/master/NOTICE.txt
|
||||
raw.githubusercontent.com/fsouza/go-dockerclient/master/README
|
||||
raw.githubusercontent.com/fsouza/go-dockerclient/master/README.md
|
||||
raw.githubusercontent.com/garyburd/redigo/master/LICENSE.code
|
||||
raw.githubusercontent.com/garyburd/redigo/master/LICENSE.txt
|
||||
raw.githubusercontent.com/garyburd/redigo/master/LICENSE.md
|
||||
raw.githubusercontent.com/garyburd/redigo/master/NOTICE
|
||||
raw.githubusercontent.com/garyburd/redigo/master/NOTICE.txt
|
||||
raw.githubusercontent.com/garyburd/redigo/master/README
|
||||
@@ -105,16 +110,17 @@ raw.githubusercontent.com/ghodss/yaml/master/NOTICE
|
||||
raw.githubusercontent.com/ghodss/yaml/master/NOTICE.txt
|
||||
raw.githubusercontent.com/ghodss/yaml/master/README
|
||||
raw.githubusercontent.com/ghodss/yaml/master/README.md
|
||||
raw.githubusercontent.com/go-ini/ini/master/NOTICE
|
||||
raw.githubusercontent.com/go-ini/ini/master/NOTICE.txt
|
||||
raw.githubusercontent.com/go-ini/ini/master/README
|
||||
raw.githubusercontent.com/go-ini/ini/master/README.md
|
||||
raw.githubusercontent.com/godbus/dbus/master/NOTICE
|
||||
raw.githubusercontent.com/godbus/dbus/master/NOTICE.txt
|
||||
raw.githubusercontent.com/godbus/dbus/master/README
|
||||
raw.githubusercontent.com/godbus/dbus/master/README.md
|
||||
raw.githubusercontent.com/gogo/protobuf/master/NOTICE
|
||||
raw.githubusercontent.com/gogo/protobuf/master/NOTICE.txt
|
||||
raw.githubusercontent.com/go-ini/ini/master/NOTICE
|
||||
raw.githubusercontent.com/go-ini/ini/master/NOTICE.txt
|
||||
raw.githubusercontent.com/go-ini/ini/master/README
|
||||
raw.githubusercontent.com/go-ini/ini/master/README.md
|
||||
raw.githubusercontent.com/gogo/protobuf/master/README.md
|
||||
raw.githubusercontent.com/golang/glog/master/NOTICE
|
||||
raw.githubusercontent.com/golang/glog/master/NOTICE.txt
|
||||
raw.githubusercontent.com/golang/glog/master/README
|
||||
@@ -146,14 +152,14 @@ raw.githubusercontent.com/gorilla/mux/master/NOTICE
|
||||
raw.githubusercontent.com/gorilla/mux/master/NOTICE.txt
|
||||
raw.githubusercontent.com/gorilla/mux/master/README
|
||||
raw.githubusercontent.com/gorilla/mux/master/README.md
|
||||
raw.githubusercontent.com/hashicorp/golang-lru/master/NOTICE
|
||||
raw.githubusercontent.com/hashicorp/golang-lru/master/NOTICE.txt
|
||||
raw.githubusercontent.com/hashicorp/golang-lru/master/README
|
||||
raw.githubusercontent.com/hashicorp/golang-lru/master/README.md
|
||||
raw.githubusercontent.com/hashicorp/go-msgpack/master/NOTICE
|
||||
raw.githubusercontent.com/hashicorp/go-msgpack/master/NOTICE.txt
|
||||
raw.githubusercontent.com/hashicorp/go-msgpack/master/README
|
||||
raw.githubusercontent.com/hashicorp/go-msgpack/master/README.md
|
||||
raw.githubusercontent.com/hashicorp/golang-lru/master/NOTICE
|
||||
raw.githubusercontent.com/hashicorp/golang-lru/master/NOTICE.txt
|
||||
raw.githubusercontent.com/hashicorp/golang-lru/master/README
|
||||
raw.githubusercontent.com/hashicorp/golang-lru/master/README.md
|
||||
raw.githubusercontent.com/hashicorp/raft/master/NOTICE
|
||||
raw.githubusercontent.com/hashicorp/raft/master/NOTICE.txt
|
||||
raw.githubusercontent.com/hashicorp/raft/master/README
|
||||
@@ -198,6 +204,13 @@ raw.githubusercontent.com/kr/pty/master/NOTICE
|
||||
raw.githubusercontent.com/kr/pty/master/NOTICE.txt
|
||||
raw.githubusercontent.com/kr/pty/master/README
|
||||
raw.githubusercontent.com/kr/pty/master/README.md
|
||||
raw.githubusercontent.com/matttproud/golang_protobuf_extensions/master/NOTICE.txt
|
||||
raw.githubusercontent.com/matttproud/golang_protobuf_extensions/master/README
|
||||
raw.githubusercontent.com/matttproud/golang_protobuf_extensions/master/README.md
|
||||
raw.githubusercontent.com/Microsoft/go-winio/master/NOTICE
|
||||
raw.githubusercontent.com/Microsoft/go-winio/master/NOTICE.txt
|
||||
raw.githubusercontent.com/Microsoft/go-winio/master/README
|
||||
raw.githubusercontent.com/Microsoft/go-winio/master/README.md
|
||||
raw.githubusercontent.com/miekg/dns/master/NOTICE
|
||||
raw.githubusercontent.com/miekg/dns/master/NOTICE.txt
|
||||
raw.githubusercontent.com/miekg/dns/master/README
|
||||
@@ -234,6 +247,13 @@ raw.githubusercontent.com/pmezard/go-difflib/master/NOTICE
|
||||
raw.githubusercontent.com/pmezard/go-difflib/master/NOTICE.txt
|
||||
raw.githubusercontent.com/pmezard/go-difflib/master/README
|
||||
raw.githubusercontent.com/pmezard/go-difflib/master/README.md
|
||||
raw.githubusercontent.com/prometheus/common/master/LICENSE
|
||||
raw.githubusercontent.com/prometheus/common/master/LICENSE.code
|
||||
raw.githubusercontent.com/prometheus/common/master/LICENSE.txt
|
||||
raw.githubusercontent.com/prometheus/common/master/LICENSE.md
|
||||
raw.githubusercontent.com/prometheus/common/master/NOTICE.txt
|
||||
raw.githubusercontent.com/prometheus/common/master/README
|
||||
raw.githubusercontent.com/prometheus/common/master/README.md
|
||||
raw.githubusercontent.com/rackspace/gophercloud/master/NOTICE
|
||||
raw.githubusercontent.com/rackspace/gophercloud/master/NOTICE.txt
|
||||
raw.githubusercontent.com/rackspace/gophercloud/master/README
|
||||
@@ -246,14 +266,13 @@ raw.githubusercontent.com/samuel/go-zookeeper/master/NOTICE
|
||||
raw.githubusercontent.com/samuel/go-zookeeper/master/NOTICE.txt
|
||||
raw.githubusercontent.com/samuel/go-zookeeper/master/README
|
||||
raw.githubusercontent.com/samuel/go-zookeeper/master/README.md
|
||||
raw.githubusercontent.com/scalingdata/gcfg/master/NOTICE
|
||||
raw.githubusercontent.com/scalingdata/gcfg/master/NOTICE.txt
|
||||
raw.githubusercontent.com/scalingdata/gcfg/master/README
|
||||
raw.githubusercontent.com/scalingdata/gcfg/master/README.md
|
||||
raw.githubusercontent.com/seccomp/libseccomp-golang/master/NOTICE
|
||||
raw.githubusercontent.com/seccomp/libseccomp-golang/master/NOTICE.txt
|
||||
raw.githubusercontent.com/seccomp/libseccomp-golang/master/README
|
||||
raw.githubusercontent.com/seccomp/libseccomp-golang/master/README.md
|
||||
raw.githubusercontent.com/shurcooL/sanitized_anchor_name/master/LICENSE.code
|
||||
raw.githubusercontent.com/shurcooL/sanitized_anchor_name/master/LICENSE.txt
|
||||
raw.githubusercontent.com/shurcooL/sanitized_anchor_name/master/LICENSE.md
|
||||
raw.githubusercontent.com/shurcooL/sanitized_anchor_name/master/NOTICE
|
||||
raw.githubusercontent.com/shurcooL/sanitized_anchor_name/master/NOTICE.txt
|
||||
raw.githubusercontent.com/shurcooL/sanitized_anchor_name/master/README
|
||||
@@ -274,13 +293,13 @@ raw.githubusercontent.com/spf13/pflag/master/NOTICE
|
||||
raw.githubusercontent.com/spf13/pflag/master/NOTICE.txt
|
||||
raw.githubusercontent.com/spf13/pflag/master/README
|
||||
raw.githubusercontent.com/spf13/pflag/master/README.md
|
||||
raw.githubusercontent.com/stretchr/objx/master/LICENSE
|
||||
raw.githubusercontent.com/stretchr/objx/master/LICENSE.code
|
||||
raw.githubusercontent.com/stretchr/objx/master/LICENSE.txt
|
||||
raw.githubusercontent.com/stretchr/objx/master/NOTICE
|
||||
raw.githubusercontent.com/stretchr/objx/master/NOTICE.txt
|
||||
raw.githubusercontent.com/stretchr/objx/master/README
|
||||
raw.githubusercontent.com/stretchr/objx/master/README.md
|
||||
raw.githubusercontent.com/stretchr/objx/master/LICENSE
|
||||
raw.githubusercontent.com/stretchr/objx/master/LICENSE.code
|
||||
raw.githubusercontent.com/stretchr/objx/master/LICENSE.txt
|
||||
raw.githubusercontent.com/stretchr/testify/master/NOTICE
|
||||
raw.githubusercontent.com/stretchr/testify/master/NOTICE.txt
|
||||
raw.githubusercontent.com/stretchr/testify/master/README
|
||||
@@ -304,6 +323,14 @@ raw.githubusercontent.com/xyproto/simpleredis/master/NOTICE
|
||||
raw.githubusercontent.com/xyproto/simpleredis/master/NOTICE.txt
|
||||
raw.githubusercontent.com/xyproto/simpleredis/master/README
|
||||
raw.githubusercontent.com/xyproto/simpleredis/master/README.md
|
||||
go4.org/errorutil/master/LICENSE
|
||||
go4.org/errorutil/master/LICENSE.code
|
||||
go4.org/errorutil/master/LICENSE.txt
|
||||
go4.org/errorutil/master/LICENSE.md
|
||||
go4.org/errorutil/master/NOTICE
|
||||
go4.org/errorutil/master/NOTICE.txt
|
||||
go4.org/errorutil/master/README
|
||||
go4.org/errorutil/master/README.md
|
||||
golang.org/x/crypto/master/NOTICE
|
||||
golang.org/x/crypto/master/NOTICE.txt
|
||||
golang.org/x/crypto/master/README
|
||||
@@ -324,10 +351,6 @@ golang.org/x/sys/master/NOTICE
|
||||
golang.org/x/sys/master/NOTICE.txt
|
||||
golang.org/x/sys/master/README
|
||||
golang.org/x/sys/master/README.md
|
||||
golang.org/x/tools/master/NOTICE
|
||||
golang.org/x/tools/master/NOTICE.txt
|
||||
golang.org/x/tools/master/README
|
||||
golang.org/x/tools/master/README.md
|
||||
google.golang.org/api/master/NOTICE
|
||||
google.golang.org/api/master/NOTICE.txt
|
||||
google.golang.org/api/master/README
|
||||
@@ -340,6 +363,10 @@ google.golang.org/grpc/master/NOTICE
|
||||
google.golang.org/grpc/master/NOTICE.txt
|
||||
google.golang.org/grpc/master/README
|
||||
google.golang.org/grpc/master/README.md
|
||||
gopkg.in/gcfg.v1/master/NOTICE
|
||||
gopkg.in/gcfg.v1/master/NOTICE.txt
|
||||
gopkg.in/gcfg.v1/master/README
|
||||
gopkg.in/gcfg.v1/master/README.md
|
||||
gopkg.in/natefinch/master/NOTICE
|
||||
gopkg.in/natefinch/master/NOTICE.txt
|
||||
gopkg.in/natefinch/master/README
|
||||
|
14
Godeps/Godeps.json
generated
14
Godeps/Godeps.json
generated
@@ -49,8 +49,8 @@
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/appc/spec/schema",
|
||||
"Comment": "v0.7.4-6-g5d54e27",
|
||||
"Rev": "5d54e27f1764a0309eafe12c9df7bac03f241646"
|
||||
"Comment": "v0.7.4-43-gd22f52b",
|
||||
"Rev": "d22f52bfeba06614d37c7aa1ad6fd76d8fdb2ba8"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/armon/go-metrics",
|
||||
@@ -140,10 +140,6 @@
|
||||
"Comment": "v1.1.0-65-gee4a088",
|
||||
"Rev": "ee4a0888a9abe7eefe5a0992ca4cb06864839873"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/camlistore/go4/errorutil",
|
||||
"Rev": "3b6feb5cf32f573fb124905de36a54c24ee14ac1"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/codegangsta/negroni",
|
||||
"Comment": "v0.1-62-g8d75e11",
|
||||
@@ -1040,6 +1036,10 @@
|
||||
"Comment": "v1.0-13-g5292687",
|
||||
"Rev": "5292687f5379e01054407da44d7c4590a61fd3de"
|
||||
},
|
||||
{
|
||||
"ImportPath": "go4.org/errorutil",
|
||||
"Rev": "03efcb870d84809319ea509714dd6d19a1498483"
|
||||
},
|
||||
{
|
||||
"ImportPath": "golang.org/x/crypto/bcrypt",
|
||||
"Rev": "c84e1f8e3a7e322d497cd16c0e8a13c7e127baf3"
|
||||
@@ -1139,7 +1139,7 @@
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/heapster/metrics/api/v1/types",
|
||||
"Comment": "v1.1.0-beta1",
|
||||
"Comment": "v1.1.0-beta1-15-gde510e4",
|
||||
"Rev": "de510e4bdcdea96722b5bde19ff0b7a142939485"
|
||||
},
|
||||
{
|
||||
|
1124
Godeps/LICENSES
generated
1124
Godeps/LICENSES
generated
File diff suppressed because it is too large
Load Diff
2
Godeps/_workspace/.gitignore
generated
vendored
2
Godeps/_workspace/.gitignore
generated
vendored
@@ -1,2 +0,0 @@
|
||||
/pkg
|
||||
/bin
|
@@ -1,5 +0,0 @@
|
||||
Common libraries shared by Prometheus Go components.
|
||||
Copyright 2015 The Prometheus Authors
|
||||
|
||||
This product includes software developed at
|
||||
SoundCloud Ltd. (http://soundcloud.com/).
|
5
Godeps/_workspace/src/github.com/coreos/pkg/NOTICE
generated
vendored
5
Godeps/_workspace/src/github.com/coreos/pkg/NOTICE
generated
vendored
@@ -1,5 +0,0 @@
|
||||
CoreOS Project
|
||||
Copyright 2014 CoreOS, Inc
|
||||
|
||||
This product includes software developed at CoreOS, Inc.
|
||||
(http://www.coreos.com/).
|
@@ -1,20 +0,0 @@
|
||||
Copyright (c) 2012 Daniel Theophanes
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
185
Godeps/_workspace/src/github.com/docker/distribution/vendor/github.com/docker/goamz/LICENSE
generated
vendored
185
Godeps/_workspace/src/github.com/docker/distribution/vendor/github.com/docker/goamz/LICENSE
generated
vendored
@@ -1,185 +0,0 @@
|
||||
This software is licensed under the LGPLv3, included below.
|
||||
|
||||
As a special exception to the GNU Lesser General Public License version 3
|
||||
("LGPL3"), the copyright holders of this Library give you permission to
|
||||
convey to a third party a Combined Work that links statically or dynamically
|
||||
to this Library without providing any Minimal Corresponding Source or
|
||||
Minimal Application Code as set out in 4d or providing the installation
|
||||
information set out in section 4e, provided that you comply with the other
|
||||
provisions of LGPL3 and provided that you meet, for the Application the
|
||||
terms and conditions of the license(s) which apply to the Application.
|
||||
|
||||
Except as stated in this special exception, the provisions of LGPL3 will
|
||||
continue to comply in full to this Library. If you modify this Library, you
|
||||
may apply this exception to your version of this Library, but you are not
|
||||
obliged to do so. If you do not wish to do so, delete this exception
|
||||
statement from your version. This exception does not (and cannot) modify any
|
||||
license terms which apply to the Application, with which you must still
|
||||
comply.
|
||||
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
@@ -1,29 +0,0 @@
|
||||
Copyright 2012 Richard Crowley. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY RICHARD CROWLEY ``AS IS'' AND ANY EXPRESS
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL RICHARD CROWLEY OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The views and conclusions contained in the software and documentation
|
||||
are those of the authors and should not be interpreted as representing
|
||||
official policies, either expressed or implied, of Richard Crowley.
|
@@ -1,14 +0,0 @@
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
Version 2, December 2004
|
||||
|
||||
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim or modified
|
||||
copies of this license document, and changing it is allowed as long
|
||||
as the name is changed.
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
||||
|
23
Godeps/_workspace/src/github.com/kr/pty/License
generated
vendored
23
Godeps/_workspace/src/github.com/kr/pty/License
generated
vendored
@@ -1,23 +0,0 @@
|
||||
Copyright (c) 2011 Keith Rarick
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated
|
||||
documentation files (the "Software"), to deal in the
|
||||
Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute,
|
||||
sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall
|
||||
be included in all copies or substantial portions of the
|
||||
Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
|
||||
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
||||
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
|
||||
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
31
Godeps/_workspace/src/gopkg.in/yaml.v2/LICENSE.libyaml
generated
vendored
31
Godeps/_workspace/src/gopkg.in/yaml.v2/LICENSE.libyaml
generated
vendored
@@ -1,31 +0,0 @@
|
||||
The following files were ported to Go from C files of libyaml, and thus
|
||||
are still covered by their original copyright and license:
|
||||
|
||||
apic.go
|
||||
emitterc.go
|
||||
parserc.go
|
||||
readerc.go
|
||||
scannerc.go
|
||||
writerc.go
|
||||
yamlh.go
|
||||
yamlprivateh.go
|
||||
|
||||
Copyright (c) 2006 Kirill Simonov
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
2
Makefile
2
Makefile
@@ -21,7 +21,6 @@
|
||||
# clean: Clean up.
|
||||
|
||||
OUT_DIR = _output
|
||||
GODEPS_PKG_DIR = Godeps/_workspace/pkg
|
||||
|
||||
KUBE_GOFLAGS = $(GOFLAGS)
|
||||
export KUBE_GOFLAGS
|
||||
@@ -111,7 +110,6 @@ test_e2e_node:
|
||||
clean:
|
||||
build/make-clean.sh
|
||||
rm -rf $(OUT_DIR)
|
||||
rm -rf $(GODEPS_PKG_DIR)
|
||||
.PHONY: clean
|
||||
|
||||
# Run 'go vet'.
|
||||
|
@@ -1,4 +1,5 @@
|
||||
# Kubernetes
|
||||
FIXME
|
||||
|
||||
[![GoReportCard Widget]][GoReportCard] [![GoDoc Widget]][GoDoc] [![Travis Widget]][Travis] [![Coverage Status Widget]][Coverage Status]
|
||||
|
||||
|
@@ -26,11 +26,8 @@ DOCKER_HOST=${DOCKER_HOST:-""}
|
||||
DOCKER_MACHINE_NAME=${DOCKER_MACHINE_NAME:-"kube-dev"}
|
||||
readonly DOCKER_MACHINE_DRIVER=${DOCKER_MACHINE_DRIVER:-"virtualbox --virtualbox-memory 4096 --virtualbox-cpu-count -1"}
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||
cd "${KUBE_ROOT}"
|
||||
|
||||
# This'll canonicalize the path
|
||||
KUBE_ROOT=$PWD
|
||||
# This will canonicalize the path
|
||||
KUBE_ROOT=$(cd $(dirname "${BASH_SOURCE}")/.. && pwd -P)
|
||||
|
||||
source hack/lib/init.sh
|
||||
|
||||
@@ -77,13 +74,10 @@ readonly DOCKER_MOUNT_ARGS_BASE=(
|
||||
--volume /etc/localtime:/etc/localtime:ro
|
||||
)
|
||||
|
||||
# We create a Docker data container to cache incremental build artifacts. We
|
||||
# need to cache both the go tree in _output and the go tree under Godeps.
|
||||
# We create a Docker data container to cache incremental build artifacts.
|
||||
readonly REMOTE_OUTPUT_GOPATH="${REMOTE_OUTPUT_SUBPATH}/go"
|
||||
readonly REMOTE_GODEP_GOPATH="/go/src/${KUBE_GO_PACKAGE}/Godeps/_workspace/pkg"
|
||||
readonly DOCKER_DATA_MOUNT_ARGS=(
|
||||
--volume "${REMOTE_OUTPUT_GOPATH}"
|
||||
--volume "${REMOTE_GODEP_GOPATH}"
|
||||
)
|
||||
|
||||
# This is where the final release artifacts are created locally
|
||||
@@ -465,7 +459,6 @@ function kube::build::source_targets() {
|
||||
docs
|
||||
examples
|
||||
federation
|
||||
Godeps/_workspace/src
|
||||
Godeps/Godeps.json
|
||||
hack
|
||||
LICENSE
|
||||
@@ -475,6 +468,7 @@ function kube::build::source_targets() {
|
||||
README.md
|
||||
test
|
||||
third_party
|
||||
vendor
|
||||
contrib/completions/bash/kubectl
|
||||
contrib/mesos
|
||||
.generated_docs
|
||||
@@ -547,6 +541,16 @@ function kube::build::clean_images() {
|
||||
}
|
||||
|
||||
function kube::build::ensure_data_container() {
|
||||
# This is temporary, while last remnants of _workspace are obliterated. If
|
||||
# the data container exists it might be from before the change from
|
||||
# Godeps/_workspace/ to vendor/, and thereby still have a Godeps/_workspace/
|
||||
# directory in it, which trips up godep (yay godep!). Once we are confident
|
||||
# that this has run ~everywhere we care about, we can remove this.
|
||||
# TODO(thockin): remove this after v1.3 is cut.
|
||||
if "${DOCKER[@]}" inspect "${KUBE_BUILD_DATA_CONTAINER_NAME}" \
|
||||
| grep -q "Godeps/_workspace/pkg"; then
|
||||
docker rm -f "${KUBE_BUILD_DATA_CONTAINER_NAME}"
|
||||
fi
|
||||
if ! "${DOCKER[@]}" inspect "${KUBE_BUILD_DATA_CONTAINER_NAME}" >/dev/null 2>&1; then
|
||||
kube::log::status "Creating data container"
|
||||
local -ra docker_cmd=(
|
||||
|
@@ -46,7 +46,7 @@ all: container
|
||||
|
||||
kube2sky: kube2sky.go
|
||||
# Only build kube2sky. This requires go and godep in PATH
|
||||
CGO_ENABLED=0 GOARCH=$(ARCH) GOARM=$(GOARM) godep go build -a -installsuffix cgo --ldflags '-w' ./kube2sky.go
|
||||
CGO_ENABLED=0 GOARCH=$(ARCH) GOARM=$(GOARM) go build -a -installsuffix cgo --ldflags '-w' ./kube2sky.go
|
||||
|
||||
container:
|
||||
# Copy the content in this dir to the temp dir
|
||||
@@ -80,7 +80,7 @@ clean:
|
||||
rm -f kube2sky
|
||||
|
||||
test: clean
|
||||
godep go test -v --vmodule=*=4
|
||||
go test -v --vmodule=*=4
|
||||
|
||||
|
||||
.PHONY: all kube2sky container push clean test
|
||||
|
@@ -26,9 +26,10 @@ import (
|
||||
"k8s.io/kubernetes/cmd/libs/go2idl/client-gen/generators"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
|
||||
"strings"
|
||||
|
||||
"github.com/golang/glog"
|
||||
flag "github.com/spf13/pflag"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -105,12 +106,12 @@ func main() {
|
||||
|
||||
if *test {
|
||||
arguments.InputDirs = append(dependencies, []string{
|
||||
"k8s.io/kubernetes/cmd/libs/go2idl/client-gen/testdata/apis/testgroup.k8s.io",
|
||||
"k8s.io/kubernetes/cmd/libs/go2idl/client-gen/test_apis/testgroup.k8s.io",
|
||||
}...)
|
||||
arguments.CustomArgs = clientgenargs.Args{
|
||||
GroupVersions: []unversioned.GroupVersion{{Group: "testgroup.k8s.io", Version: ""}},
|
||||
GroupVersionToInputPath: map[unversioned.GroupVersion]string{
|
||||
unversioned.GroupVersion{Group: "testgroup.k8s.io", Version: ""}: "k8s.io/kubernetes/cmd/libs/go2idl/client-gen/testdata/apis/testgroup.k8s.io",
|
||||
unversioned.GroupVersion{Group: "testgroup.k8s.io", Version: ""}: "k8s.io/kubernetes/cmd/libs/go2idl/client-gen/test_apis/testgroup.k8s.io",
|
||||
},
|
||||
ClientsetName: "test_internalclientset",
|
||||
ClientsetOutputPath: "k8s.io/kubernetes/cmd/libs/go2idl/client-gen/testoutput/clientset_generated/",
|
||||
|
4
cmd/libs/go2idl/client-gen/test_apis/README
Normal file
4
cmd/libs/go2idl/client-gen/test_apis/README
Normal file
@@ -0,0 +1,4 @@
|
||||
This dir can not be named "testdata" because of the way ugorji gnerates code.
|
||||
Specifically, it emits a .go file and then calls `go run` on it. Because
|
||||
"testdata" is a special name to Go, it decides NOT to find the vendor dir, and
|
||||
therefore fails to compile. Just name it something else.
|
@@ -23,8 +23,8 @@ import (
|
||||
|
||||
"github.com/golang/glog"
|
||||
|
||||
"k8s.io/kubernetes/cmd/libs/go2idl/client-gen/testdata/apis/testgroup.k8s.io"
|
||||
"k8s.io/kubernetes/cmd/libs/go2idl/client-gen/testdata/apis/testgroup.k8s.io/v1"
|
||||
"k8s.io/kubernetes/cmd/libs/go2idl/client-gen/test_apis/testgroup.k8s.io"
|
||||
"k8s.io/kubernetes/cmd/libs/go2idl/client-gen/test_apis/testgroup.k8s.io/v1"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/meta"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
@@ -34,7 +34,7 @@ import (
|
||||
"k8s.io/kubernetes/pkg/util/sets"
|
||||
)
|
||||
|
||||
const importPrefix = "k8s.io/kubernetes/cmd/libs/go2idl/client-gen/testdata/apis/testgroup.k8s.io"
|
||||
const importPrefix = "k8s.io/kubernetes/cmd/libs/go2idl/client-gen/test_apis/testgroup.k8s.io"
|
||||
|
||||
var accessor = meta.NewAccessor()
|
||||
|
@@ -17,7 +17,7 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
testgroup_k8s_io "k8s.io/kubernetes/cmd/libs/go2idl/client-gen/testdata/apis/testgroup.k8s.io"
|
||||
testgroup_k8s_io "k8s.io/kubernetes/cmd/libs/go2idl/client-gen/test_apis/testgroup.k8s.io"
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
|
||||
core "k8s.io/kubernetes/pkg/client/testing/core"
|
||||
|
@@ -21,8 +21,8 @@ import (
|
||||
"net/url"
|
||||
"testing"
|
||||
|
||||
testgroup "k8s.io/kubernetes/cmd/libs/go2idl/client-gen/testdata/apis/testgroup.k8s.io"
|
||||
_ "k8s.io/kubernetes/cmd/libs/go2idl/client-gen/testdata/apis/testgroup.k8s.io/install"
|
||||
testgroup "k8s.io/kubernetes/cmd/libs/go2idl/client-gen/test_apis/testgroup.k8s.io"
|
||||
_ "k8s.io/kubernetes/cmd/libs/go2idl/client-gen/test_apis/testgroup.k8s.io/install"
|
||||
. "k8s.io/kubernetes/cmd/libs/go2idl/client-gen/testoutput/clientset_generated/test_internalclientset/typed/testgroup.k8s.io/unversioned"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
|
@@ -17,7 +17,7 @@ limitations under the License.
|
||||
package unversioned
|
||||
|
||||
import (
|
||||
testgroup_k8s_io "k8s.io/kubernetes/cmd/libs/go2idl/client-gen/testdata/apis/testgroup.k8s.io"
|
||||
testgroup_k8s_io "k8s.io/kubernetes/cmd/libs/go2idl/client-gen/test_apis/testgroup.k8s.io"
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
@@ -29,7 +29,7 @@ import (
|
||||
func construct(t *testing.T, files map[string]string) *generator.Context {
|
||||
b := parser.New()
|
||||
for name, src := range files {
|
||||
if err := b.AddFile(name, []byte(src)); err != nil {
|
||||
if err := b.AddFile("/tmp/"+name, name, []byte(src)); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
@@ -54,7 +54,7 @@ func New() *Generator {
|
||||
OutputBase: sourceTree,
|
||||
GoHeaderFilePath: filepath.Join(sourceTree, "k8s.io/kubernetes/hack/boilerplate/boilerplate.go.txt"),
|
||||
}
|
||||
defaultProtoImport := filepath.Join(sourceTree, "k8s.io", "kubernetes", "Godeps", "_workspace", "src", "github.com", "gogo", "protobuf", "protobuf")
|
||||
defaultProtoImport := filepath.Join(sourceTree, "k8s.io", "kubernetes", "vendor", "github.com", "gogo", "protobuf", "protobuf")
|
||||
return &Generator{
|
||||
Common: common,
|
||||
OutputBase: sourceTree,
|
||||
|
@@ -43,6 +43,8 @@ type Builder struct {
|
||||
fset *token.FileSet
|
||||
// map of package id to list of parsed files
|
||||
parsed map[string][]parsedFile
|
||||
// map of package id to absolute path (to prevent overlap)
|
||||
absPaths map[string]string
|
||||
|
||||
// Set by makePackages, used by importer() and friends.
|
||||
pkgs map[string]*tc.Package
|
||||
@@ -81,11 +83,15 @@ func New() *Builder {
|
||||
fmt.Printf("Warning: $GOROOT not set, and unable to run `which go` to find it: %v\n", err)
|
||||
}
|
||||
}
|
||||
// Force this to off, since we don't properly parse CGo. All symbols must
|
||||
// have non-CGo equivalents.
|
||||
c.CgoEnabled = false
|
||||
return &Builder{
|
||||
context: &c,
|
||||
buildInfo: map[string]*build.Package{},
|
||||
fset: token.NewFileSet(),
|
||||
parsed: map[string][]parsedFile{},
|
||||
absPaths: map[string]string{},
|
||||
userRequested: map[string]bool{},
|
||||
endLineToCommentGroup: map[fileLine]*ast.CommentGroup{},
|
||||
importGraph: map[string]map[string]struct{}{},
|
||||
@@ -101,8 +107,18 @@ func (b *Builder) AddBuildTags(tags ...string) {
|
||||
// e.g. test files and files for other platforms-- there is quite a bit of
|
||||
// logic of that nature in the build package.
|
||||
func (b *Builder) buildPackage(pkgPath string) (*build.Package, error) {
|
||||
// This is a bit of a hack. The srcDir argument to Import() should
|
||||
// properly be the dir of the file which depends on the package to be
|
||||
// imported, so that vendoring can work properly. We assume that there is
|
||||
// only one level of vendoring, and that the CWD is inside the GOPATH, so
|
||||
// this should be safe.
|
||||
cwd, err := os.Getwd()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to get current directory: %v", err)
|
||||
}
|
||||
|
||||
// First, find it, so we know what path to use.
|
||||
pkg, err := b.context.Import(pkgPath, ".", build.FindOnly)
|
||||
pkg, err := b.context.Import(pkgPath, cwd, build.FindOnly)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to *find* %q: %v", pkgPath, err)
|
||||
}
|
||||
@@ -112,7 +128,7 @@ func (b *Builder) buildPackage(pkgPath string) (*build.Package, error) {
|
||||
if pkg, ok := b.buildInfo[pkgPath]; ok {
|
||||
return pkg, nil
|
||||
}
|
||||
pkg, err = b.context.Import(pkgPath, ".", build.ImportComment)
|
||||
pkg, err = b.context.Import(pkgPath, cwd, build.ImportComment)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to import %q: %v", pkgPath, err)
|
||||
}
|
||||
@@ -127,21 +143,30 @@ func (b *Builder) buildPackage(pkgPath string) (*build.Package, error) {
|
||||
return pkg, nil
|
||||
}
|
||||
|
||||
// AddFile adds a file to the set. The name must be of the form canonical/pkg/path/file.go.
|
||||
func (b *Builder) AddFile(name string, src []byte) error {
|
||||
return b.addFile(name, src, true)
|
||||
// AddFile adds a file to the set. The pkg must be of the form
|
||||
// "canonical/pkg/path" and the path must be the absolute path to the file.
|
||||
func (b *Builder) AddFile(pkg string, path string, src []byte) error {
|
||||
return b.addFile(pkg, path, src, true)
|
||||
}
|
||||
|
||||
// addFile adds a file to the set. The name must be of the form
|
||||
// canonical/pkg/path/file.go. A flag indicates whether this file was
|
||||
// user-requested or just from following the import graph.
|
||||
func (b *Builder) addFile(name string, src []byte, userRequested bool) error {
|
||||
p, err := parser.ParseFile(b.fset, name, src, parser.DeclarationErrors|parser.ParseComments)
|
||||
// addFile adds a file to the set. The pkg must be of the form
|
||||
// "canonical/pkg/path" and the path must be the absolute path to the file. A
|
||||
// flag indicates whether this file was user-requested or just from following
|
||||
// the import graph.
|
||||
func (b *Builder) addFile(pkg string, path string, src []byte, userRequested bool) error {
|
||||
p, err := parser.ParseFile(b.fset, path, src, parser.DeclarationErrors|parser.ParseComments)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
pkg := filepath.Dir(name)
|
||||
b.parsed[pkg] = append(b.parsed[pkg], parsedFile{name, p})
|
||||
dirPath := filepath.Dir(path)
|
||||
if prev, found := b.absPaths[pkg]; found {
|
||||
if dirPath != prev {
|
||||
return fmt.Errorf("package %q (%s) previously resolved to %s", pkg, dirPath, prev)
|
||||
}
|
||||
} else {
|
||||
b.absPaths[pkg] = dirPath
|
||||
}
|
||||
b.parsed[pkg] = append(b.parsed[pkg], parsedFile{path, p})
|
||||
b.userRequested[pkg] = userRequested
|
||||
for _, c := range p.Comments {
|
||||
position := b.fset.Position(c.End())
|
||||
@@ -171,8 +196,18 @@ func (b *Builder) AddDir(dir string) error {
|
||||
// subdirectories; it returns an error only if the path couldn't be resolved;
|
||||
// any directories recursed into without go source are ignored.
|
||||
func (b *Builder) AddDirRecursive(dir string) error {
|
||||
// This is a bit of a hack. The srcDir argument to Import() should
|
||||
// properly be the dir of the file which depends on the package to be
|
||||
// imported, so that vendoring can work properly. We assume that there is
|
||||
// only one level of vendoring, and that the CWD is inside the GOPATH, so
|
||||
// this should be safe.
|
||||
cwd, err := os.Getwd()
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to get current directory: %v", err)
|
||||
}
|
||||
|
||||
// First, find it, so we know what path to use.
|
||||
pkg, err := b.context.Import(dir, ".", build.FindOnly)
|
||||
pkg, err := b.context.Import(dir, cwd, build.FindOnly)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to *find* %q: %v", dir, err)
|
||||
}
|
||||
@@ -203,7 +238,6 @@ func (b *Builder) addDir(dir string, userRequested bool) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
dir = pkg.Dir
|
||||
// Check in case this package was added (maybe dir was not canonical)
|
||||
if _, alreadyAdded := b.parsed[dir]; alreadyAdded {
|
||||
return nil
|
||||
@@ -214,14 +248,13 @@ func (b *Builder) addDir(dir string, userRequested bool) error {
|
||||
continue
|
||||
}
|
||||
absPath := filepath.Join(pkg.Dir, n)
|
||||
pkgPath := filepath.Join(pkg.ImportPath, n)
|
||||
data, err := ioutil.ReadFile(absPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("while loading %q: %v", absPath, err)
|
||||
}
|
||||
err = b.addFile(pkgPath, data, userRequested)
|
||||
err = b.addFile(dir, absPath, data, userRequested)
|
||||
if err != nil {
|
||||
return fmt.Errorf("while parsing %q: %v", pkgPath, err)
|
||||
return fmt.Errorf("while parsing %q: %v", absPath, err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
@@ -18,6 +18,7 @@ package parser_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"testing"
|
||||
"text/template"
|
||||
@@ -30,7 +31,7 @@ import (
|
||||
func construct(t *testing.T, files map[string]string, testNamer namer.Namer) (*parser.Builder, types.Universe, []*types.Type) {
|
||||
b := parser.New()
|
||||
for name, src := range files {
|
||||
if err := b.AddFile(name, []byte(src)); err != nil {
|
||||
if err := b.AddFile(filepath.Dir(name), name, []byte(src)); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
@@ -89,7 +89,8 @@ gen-conversion script.
|
||||
|
||||
3. Generate protobuf objects:
|
||||
|
||||
1. Add your group to `cmd/libs/go2idl/go-to-protobuf/protobuf/cmd.go` to `New()` in the `Packages` field
|
||||
1. Add your group to `cmd/libs/go2idl/go-to-protobuf/protobuf/cmd.go` to
|
||||
`New()` in the `Packages` field
|
||||
2. Run hack/update-generated-protobuf.sh
|
||||
|
||||
### Client (optional):
|
||||
|
@@ -193,7 +193,7 @@ godep v53 (linux/amd64/go1.5.3)
|
||||
|
||||
### Using godep
|
||||
|
||||
Here's a quick walkthrough of one way to use godeps to add or update a Kubernetes dependency into Godeps/\_workspace. For more details, please see the instructions in [godep's documentation](https://github.com/tools/godep).
|
||||
Here's a quick walkthrough of one way to use godeps to add or update a Kubernetes dependency into `vendor/`. For more details, please see the instructions in [godep's documentation](https://github.com/tools/godep).
|
||||
|
||||
1) Devote a directory to this endeavor:
|
||||
|
||||
|
@@ -82,12 +82,12 @@ See [setup_host.sh](../../test/e2e_node/environment/setup_host.sh)
|
||||
* **Requires password-less ssh and sudo access**
|
||||
* Make sure this works - e.g. `ssh <hostname> -- sudo echo "ok"`
|
||||
* If ssh flags are required (e.g. `-i`), they can be used and passed to the tests with `--ssh-options`
|
||||
* `godep go run test/e2e_node/runner/run_e2e.go --logtostderr --hosts <comma separated hosts>`
|
||||
* `go run test/e2e_node/runner/run_e2e.go --logtostderr --hosts <comma separated hosts>`
|
||||
* **Must be run from kubernetes root**
|
||||
* requires (go get): `github.com/tools/godep`, `github.com/onsi/gomega`, `github.com/onsi/ginkgo/ginkgo`
|
||||
|
||||
3. Alternatively, manually build and copy `e2e_node_test.tar.gz` to a remote host
|
||||
* Build the tar.gz `godep go run test/e2e_node/runner/run_e2e.go --logtostderr --build-only`
|
||||
* Build the tar.gz `go run test/e2e_node/runner/run_e2e.go --logtostderr --build-only`
|
||||
* requires (go get): `github.com/tools/godep`, `github.com/onsi/gomega`, `github.com/onsi/ginkgo/ginkgo`
|
||||
* Copy `e2e_node_test.tar.gz` to the remote host
|
||||
* Extract the archive on the remote host `tar -xzvf e2e_node_test.tar.gz`
|
||||
|
@@ -107,7 +107,7 @@ $ go install golang.org/x/tools/cmd/stress
|
||||
Then build your test binary
|
||||
|
||||
```
|
||||
$ godep go test -c -race
|
||||
$ go test -c -race
|
||||
```
|
||||
|
||||
Then run it under stress
|
||||
|
@@ -84,10 +84,10 @@ hack/test-go.sh # Run all unit tests.
|
||||
cd kubernetes
|
||||
|
||||
# Run all tests under pkg (requires client to be in $GOPATH/src/k8s.io)
|
||||
godep go test ./pkg/...
|
||||
go test ./pkg/...
|
||||
|
||||
# Run all tests in the pkg/api (but not subpackages)
|
||||
godep go test ./pkg/api
|
||||
go test ./pkg/api
|
||||
```
|
||||
|
||||
### Stress running unit tests
|
||||
@@ -135,7 +135,7 @@ To run benchmark tests, you'll typically use something like:
|
||||
|
||||
```sh
|
||||
cd kubernetes
|
||||
godep go test ./pkg/apiserver -benchmem -run=XXX -bench=BenchmarkWatch
|
||||
go test ./pkg/apiserver -benchmem -run=XXX -bench=BenchmarkWatch
|
||||
```
|
||||
|
||||
This will do the following:
|
||||
|
@@ -20,7 +20,7 @@ import (
|
||||
"fmt"
|
||||
"net"
|
||||
|
||||
"k8s.io/kubernetes/cmd/libs/go2idl/client-gen/testdata/apis/testgroup.k8s.io/v1"
|
||||
"k8s.io/kubernetes/cmd/libs/go2idl/client-gen/test_apis/testgroup.k8s.io/v1"
|
||||
testgroupetcd "k8s.io/kubernetes/examples/apiserver/rest"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/rest"
|
||||
@@ -30,7 +30,7 @@ import (
|
||||
"k8s.io/kubernetes/pkg/storage/storagebackend"
|
||||
|
||||
// Install the testgroup API
|
||||
_ "k8s.io/kubernetes/cmd/libs/go2idl/client-gen/testdata/apis/testgroup.k8s.io/install"
|
||||
_ "k8s.io/kubernetes/cmd/libs/go2idl/client-gen/test_apis/testgroup.k8s.io/install"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@@ -24,7 +24,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"k8s.io/kubernetes/cmd/libs/go2idl/client-gen/testdata/apis/testgroup.k8s.io/v1"
|
||||
"k8s.io/kubernetes/cmd/libs/go2idl/client-gen/test_apis/testgroup.k8s.io/v1"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
|
@@ -17,7 +17,7 @@ limitations under the License.
|
||||
package rest
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/cmd/libs/go2idl/client-gen/testdata/apis/testgroup.k8s.io"
|
||||
"k8s.io/kubernetes/cmd/libs/go2idl/client-gen/test_apis/testgroup.k8s.io"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
|
@@ -25,7 +25,7 @@ keys:
|
||||
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout $(KEY) -out $(CERT) -subj "/CN=nginxsvc/O=nginxsvc"
|
||||
|
||||
secret:
|
||||
godep go run make_secret.go -crt $(CERT) -key $(KEY) > $(SECRET)
|
||||
go run make_secret.go -crt $(CERT) -key $(KEY) > $(SECRET)
|
||||
|
||||
container:
|
||||
docker build -t $(PREFIX):$(TAG) .
|
||||
|
@@ -1,4 +0,0 @@
|
||||
These should be called only by a script (or a user) who knows that the binaries are built and correct. Normal users should just have the versions in ../ which should just always do a build.
|
||||
|
||||
|
||||
[]()
|
@@ -1,42 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2015 The Kubernetes Authors All rights reserved.
|
||||
#
|
||||
# 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.
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
kube::golang::setup_env
|
||||
|
||||
clientgen=$(kube::util::find-binary "client-gen")
|
||||
conversiongen=$(kube::util::find-binary "conversion-gen")
|
||||
deepcopygen=$(kube::util::find-binary "deepcopy-gen")
|
||||
setgen=$(kube::util::find-binary "set-gen")
|
||||
|
||||
# Please do not add any logic to this shell script. Add logic to the go code
|
||||
# that generates the set-gen program.
|
||||
#
|
||||
# This can be called with one flag, --verify-only, so it works for both the
|
||||
# update- and verify- scripts.
|
||||
${clientgen} "$@"
|
||||
${clientgen} -t "$@"
|
||||
${conversiongen} "$@"
|
||||
${deepcopygen} "$@"
|
||||
${setgen} "$@"
|
||||
|
||||
# You may add additional calls of code generators like set-gen above.
|
@@ -1,26 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2015 The Kubernetes Authors All rights reserved.
|
||||
#
|
||||
# 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.
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
kube::golang::setup_env
|
||||
|
||||
$(kube::util::find-binary "import-boss") "$@"
|
@@ -1,73 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2014 The Kubernetes Authors All rights reserved.
|
||||
#
|
||||
# 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.
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
kube::golang::setup_env
|
||||
|
||||
kube::util::ensure-temp-dir
|
||||
|
||||
kube::util::gen-docs "${KUBE_TEMP}"
|
||||
|
||||
# remove all of the old docs
|
||||
while read file; do
|
||||
rm "${KUBE_ROOT}/${file}" 2>/dev/null || true
|
||||
done <"${KUBE_ROOT}/.generated_docs"
|
||||
|
||||
# the shopt is so that we get .generated_docs from the glob.
|
||||
shopt -s dotglob
|
||||
cp -af "${KUBE_TEMP}"/* "${KUBE_ROOT}"
|
||||
shopt -u dotglob
|
||||
|
||||
kube::util::gen-analytics "${KUBE_ROOT}"
|
||||
|
||||
mungedocs=$(kube::util::find-binary "mungedocs")
|
||||
"${mungedocs}" "--upstream=${KUBE_GIT_UPSTREAM}" "--root-dir=${KUBE_ROOT}/docs/" && ret=0 || ret=$?
|
||||
if [[ $ret -eq 1 ]]; then
|
||||
echo "${KUBE_ROOT}/docs/ requires manual changes. See preceding errors."
|
||||
exit 1
|
||||
elif [[ $ret -gt 1 ]]; then
|
||||
echo "Error running mungedocs."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
"${mungedocs}" "--upstream=${KUBE_GIT_UPSTREAM}" "--root-dir=${KUBE_ROOT}/examples/" && ret=0 || ret=$?
|
||||
if [[ $ret -eq 1 ]]; then
|
||||
echo "${KUBE_ROOT}/examples/ requires manual changes. See preceding errors."
|
||||
exit 1
|
||||
elif [[ $ret -gt 1 ]]; then
|
||||
echo "Error running mungedocs."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
"${mungedocs}" "--upstream=${KUBE_GIT_UPSTREAM}" \
|
||||
"--skip-munges=unversioned-warning,analytics" \
|
||||
"--norecurse" \
|
||||
"--root-dir=${KUBE_ROOT}/" && ret=0 || ret=$?
|
||||
if [[ $ret -eq 1 ]]; then
|
||||
echo "${KUBE_ROOT}/ requires manual changes. See preceding errors."
|
||||
exit 1
|
||||
elif [[ $ret -gt 1 ]]; then
|
||||
echo "Error running mungedocs."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ex: ts=2 sw=2 et filetype=sh
|
@@ -1,101 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2015 The Kubernetes Authors All rights reserved.
|
||||
#
|
||||
# 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.
|
||||
|
||||
# Script to fetch latest swagger spec.
|
||||
# Puts the updated spec at swagger-spec/
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
echo "Note: This assumes that types_swagger_doc_generated.go has been updated for all API group versions. Please run hack/update-generated-swagger-docs.sh to ensure that."
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||
SWAGGER_ROOT_DIR="${KUBE_ROOT}/api/swagger-spec"
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
function cleanup()
|
||||
{
|
||||
[[ -n ${APISERVER_PID-} ]] && kill ${APISERVER_PID} 1>&2 2>/dev/null
|
||||
|
||||
kube::etcd::cleanup
|
||||
|
||||
kube::log::status "Clean up complete"
|
||||
}
|
||||
|
||||
trap cleanup EXIT SIGINT
|
||||
|
||||
kube::golang::setup_env
|
||||
|
||||
apiserver=$(kube::util::find-binary "kube-apiserver")
|
||||
|
||||
TMP_DIR=$(mktemp -d /tmp/update-swagger-spec.XXXX)
|
||||
ETCD_HOST=${ETCD_HOST:-127.0.0.1}
|
||||
ETCD_PORT=${ETCD_PORT:-4001}
|
||||
API_PORT=${API_PORT:-8050}
|
||||
API_HOST=${API_HOST:-127.0.0.1}
|
||||
KUBELET_PORT=${KUBELET_PORT:-10250}
|
||||
|
||||
kube::etcd::start
|
||||
|
||||
# Start kube-apiserver
|
||||
kube::log::status "Starting kube-apiserver"
|
||||
"${KUBE_OUTPUT_HOSTBIN}/kube-apiserver" \
|
||||
--insecure-bind-address="127.0.0.1" \
|
||||
--bind-address="127.0.0.1" \
|
||||
--insecure-port="${API_PORT}" \
|
||||
--etcd-servers="http://${ETCD_HOST}:${ETCD_PORT}" \
|
||||
--advertise-address="10.10.10.10" \
|
||||
--cert-dir="${TMP_DIR}/certs" \
|
||||
--service-cluster-ip-range="10.0.0.0/24" >/tmp/swagger-api-server.log 2>&1 &
|
||||
APISERVER_PID=$!
|
||||
|
||||
kube::util::wait_for_url "http://127.0.0.1:${API_PORT}/healthz" "apiserver: "
|
||||
|
||||
SWAGGER_API_PATH="http://127.0.0.1:${API_PORT}/swaggerapi/"
|
||||
DEFAULT_GROUP_VERSIONS="v1 autoscaling/v1 batch/v1 extensions/v1beta1 apps/v1alpha1"
|
||||
VERSIONS=${VERSIONS:-$DEFAULT_GROUP_VERSIONS}
|
||||
|
||||
kube::log::status "Updating " ${SWAGGER_ROOT_DIR}
|
||||
|
||||
for ver in ${VERSIONS}; do
|
||||
# fetch the swagger spec for each group version.
|
||||
if [[ ${ver} == "v1" ]]; then
|
||||
SUBPATH="api"
|
||||
else
|
||||
SUBPATH="apis"
|
||||
fi
|
||||
SUBPATH="${SUBPATH}/${ver}"
|
||||
SWAGGER_JSON_NAME="$(kube::util::gv-to-swagger-name ${ver}).json"
|
||||
curl -w "\n" -fs "${SWAGGER_API_PATH}${SUBPATH}" > "${SWAGGER_ROOT_DIR}/${SWAGGER_JSON_NAME}"
|
||||
|
||||
# fetch the swagger spec for the discovery mechanism at group level.
|
||||
if [[ ${ver} == "v1" ]]; then
|
||||
continue
|
||||
fi
|
||||
SUBPATH="apis/"${ver%/*}
|
||||
SWAGGER_JSON_NAME="${ver%/*}.json"
|
||||
curl -w "\n" -fs "${SWAGGER_API_PATH}${SUBPATH}" > "${SWAGGER_ROOT_DIR}/${SWAGGER_JSON_NAME}"
|
||||
done
|
||||
|
||||
# fetch swagger specs for other discovery mechanism.
|
||||
curl -w "\n" -fs "${SWAGGER_API_PATH}" > "${SWAGGER_ROOT_DIR}/resourceListing.json"
|
||||
curl -w "\n" -fs "${SWAGGER_API_PATH}version" > "${SWAGGER_ROOT_DIR}/version.json"
|
||||
curl -w "\n" -fs "${SWAGGER_API_PATH}api" > "${SWAGGER_ROOT_DIR}/api.json"
|
||||
curl -w "\n" -fs "${SWAGGER_API_PATH}apis" > "${SWAGGER_ROOT_DIR}/apis.json"
|
||||
kube::log::status "SUCCESS"
|
||||
|
||||
# ex: ts=2 sw=2 et filetype=sh
|
@@ -1,86 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2014 The Kubernetes Authors All rights reserved.
|
||||
#
|
||||
# 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.
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
kube::golang::setup_env
|
||||
|
||||
# Find binary
|
||||
genswaggertypedocs=$(kube::util::find-binary "genswaggertypedocs")
|
||||
|
||||
gen_swagger_result=0
|
||||
result=0
|
||||
|
||||
find_files() {
|
||||
find . -not \( \
|
||||
\( \
|
||||
-wholename './output' \
|
||||
-o -wholename './_output' \
|
||||
-o -wholename './_gopath' \
|
||||
-o -wholename './release' \
|
||||
-o -wholename './target' \
|
||||
-o -wholename '*/third_party/*' \
|
||||
-o -wholename '*/Godeps/*' \
|
||||
\) -prune \
|
||||
\) \
|
||||
\( -wholename '*pkg/api/v*/types.go' \
|
||||
-o -wholename '*pkg/apis/*/v*/types.go' \
|
||||
-o -wholename '*pkg/api/unversioned/types.go' \
|
||||
\)
|
||||
}
|
||||
|
||||
if [[ $# -eq 0 ]]; then
|
||||
versioned_api_files=$(find_files | egrep "pkg/.[^/]*/((v.[^/]*)|unversioned)/types\.go")
|
||||
else
|
||||
versioned_api_files="${*}"
|
||||
fi
|
||||
|
||||
for file in $versioned_api_files; do
|
||||
$genswaggertypedocs -v -s "${file}" -f - || gen_swagger_result=$?
|
||||
if [[ "${gen_swagger_result}" -ne "0" ]]; then
|
||||
echo "API file: ${file} is missing: ${gen_swagger_result} descriptions"
|
||||
result=1
|
||||
fi
|
||||
if grep json: "${file}" | grep -v // | grep description: ; then
|
||||
echo "API file: ${file} should not contain descriptions in struct tags"
|
||||
result=1
|
||||
fi
|
||||
if grep json: "${file}" | grep -Ee ",[[:space:]]+omitempty|omitempty[[:space:]]+" ; then
|
||||
echo "API file: ${file} should not contain leading or trailing spaces for omitempty directive"
|
||||
result=1
|
||||
fi
|
||||
done
|
||||
|
||||
internal_types_files="${KUBE_ROOT}/pkg/api/types.go ${KUBE_ROOT}/pkg/apis/extensions/types.go"
|
||||
for internal_types_file in $internal_types_files; do
|
||||
if [[ ! -e $internal_types_file ]]; then
|
||||
echo "Internal types file ${internal_types_file} does not exist"
|
||||
result=1
|
||||
continue
|
||||
fi
|
||||
|
||||
if grep json: "${internal_types_file}" | grep -v // | grep description: ; then
|
||||
echo "Internal API types should not contain descriptions"
|
||||
result=1
|
||||
fi
|
||||
done
|
||||
|
||||
exit ${result}
|
@@ -1,35 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||
#
|
||||
# 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.
|
||||
|
||||
# Verify that E2E's use Describe wrappers, so that we can auto tag and provide
|
||||
# other wrapper functionality for the entire suite.
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||
cd "${KUBE_ROOT}"
|
||||
|
||||
findDescViolations() {
|
||||
find ./test/e2e/ -name '*.go' | xargs cat | grep "\sDescribe("
|
||||
}
|
||||
|
||||
# There should be only one call to describe.
|
||||
if [ $(findDescViolations | wc -l) != 1 ]; then
|
||||
echo "The following lines use Describe instead of KubeDescribe."
|
||||
echo "Describe() is a reserved term which only should called via the KubeDescribe wrapper function."
|
||||
findDescViolations
|
||||
fi
|
@@ -1,82 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2014 The Kubernetes Authors All rights reserved.
|
||||
#
|
||||
# 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.
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
kube::golang::setup_env
|
||||
|
||||
# Find binary
|
||||
gendocs=$(kube::util::find-binary "gendocs")
|
||||
genkubedocs=$(kube::util::find-binary "genkubedocs")
|
||||
genman=$(kube::util::find-binary "genman")
|
||||
genyaml=$(kube::util::find-binary "genyaml")
|
||||
genbashcomp=$(kube::util::find-binary "genbashcomp")
|
||||
mungedocs=$(kube::util::find-binary "mungedocs")
|
||||
|
||||
DOCROOT="${KUBE_ROOT}/docs/"
|
||||
EXAMPLEROOT="${KUBE_ROOT}/examples/"
|
||||
|
||||
# mungedocs --verify can (and should) be run on the real docs, otherwise their
|
||||
# links will be distorted. --verify means that it will not make changes.
|
||||
# --verbose gives us output we can use for a diff.
|
||||
"${mungedocs}" "--verify=true" "--verbose=true" "--upstream=${KUBE_GIT_UPSTREAM}" "--root-dir=${DOCROOT}" && ret=0 || ret=$?
|
||||
if [[ $ret -eq 1 ]]; then
|
||||
echo "${DOCROOT} is out of date. Please run hack/update-generated-docs.sh"
|
||||
exit 1
|
||||
fi
|
||||
if [[ $ret -gt 1 ]]; then
|
||||
echo "Error running mungedocs"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
"${mungedocs}" "--verify=true" "--verbose=true" "--upstream=${KUBE_GIT_UPSTREAM}" "--root-dir=${EXAMPLEROOT}" && ret=0 || ret=$?
|
||||
if [[ $ret -eq 1 ]]; then
|
||||
echo "${EXAMPLEROOT} is out of date. Please run hack/update-generated-docs.sh"
|
||||
exit 1
|
||||
fi
|
||||
if [[ $ret -gt 1 ]]; then
|
||||
echo "Error running mungedocs"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
kube::util::ensure-temp-dir
|
||||
|
||||
kube::util::gen-docs "${KUBE_TEMP}"
|
||||
diff -Naup "${KUBE_TEMP}/.generated_docs" "${KUBE_ROOT}/.generated_docs" || ret=1 || true
|
||||
while read file; do
|
||||
diff -Naup "${KUBE_TEMP}/${file}" "${KUBE_ROOT}/${file}" || ret=1 || true
|
||||
done <"${KUBE_TEMP}/.generated_docs"
|
||||
|
||||
needsanalytics=($(kube::util::gen-analytics "${KUBE_ROOT}" 1))
|
||||
if [[ ${#needsanalytics[@]} -ne 0 ]]; then
|
||||
echo -e "Some md files are missing ga-beacon analytics link:"
|
||||
printf '%s\n' "${needsanalytics[@]}"
|
||||
ret=1
|
||||
fi
|
||||
if [[ $ret -eq 0 ]]
|
||||
then
|
||||
echo "Generated docs are up to date."
|
||||
else
|
||||
echo "Generated docs are out of date. Please run hack/update-generated-docs.sh"
|
||||
exit 1
|
||||
fi
|
||||
# ex: ts=2 sw=2 et filetype=sh
|
@@ -1,59 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2015 The Kubernetes Authors All rights reserved.
|
||||
#
|
||||
# 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.
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
APIROOTS=${APIROOTS:-pkg/api pkg/apis pkg/runtime pkg/util/intstr pkg/watch}
|
||||
_tmp="${KUBE_ROOT}/_tmp"
|
||||
|
||||
cleanup() {
|
||||
rm -rf "${_tmp}"
|
||||
}
|
||||
|
||||
trap "cleanup" EXIT SIGINT
|
||||
|
||||
cleanup
|
||||
for APIROOT in ${APIROOTS}; do
|
||||
mkdir -p "${_tmp}/${APIROOT%/*}"
|
||||
cp -a "${KUBE_ROOT}/${APIROOT}" "${_tmp}/${APIROOT}"
|
||||
done
|
||||
|
||||
# If not running as root, we need to use sudo to restore the original generated
|
||||
# protobuf files.
|
||||
SUDO=""
|
||||
if [[ "$(id -u)" != '0' ]]; then
|
||||
SUDO="sudo"
|
||||
fi
|
||||
|
||||
"${KUBE_ROOT}/hack/update-generated-protobuf.sh"
|
||||
for APIROOT in ${APIROOTS}; do
|
||||
TMP_APIROOT="${_tmp}/${APIROOT}"
|
||||
echo "diffing ${APIROOT} against freshly generated protobuf"
|
||||
ret=0
|
||||
diff -Naupr -I 'Auto generated by' "${KUBE_ROOT}/${APIROOT}" "${TMP_APIROOT}" || ret=$?
|
||||
${SUDO} cp -a "${TMP_APIROOT}" "${KUBE_ROOT}/${APIROOT%/*}"
|
||||
if [[ $ret -eq 0 ]]; then
|
||||
echo "${APIROOT} up to date."
|
||||
else
|
||||
echo "${APIROOT} is out of date. Please run hack/update-generated-protobuf.sh"
|
||||
exit 1
|
||||
fi
|
||||
done
|
@@ -1,58 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2014 The Kubernetes Authors All rights reserved.
|
||||
#
|
||||
# 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.
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
kube::golang::setup_env
|
||||
|
||||
# Find binary
|
||||
genswaggertypedocs=$(kube::util::find-binary "genswaggertypedocs")
|
||||
|
||||
if [[ ! -x "$genswaggertypedocs" ]]; then
|
||||
{
|
||||
echo "It looks as if you don't have a compiled genswaggertypedocs binary"
|
||||
echo
|
||||
echo "If you are running from a clone of the git repo, please run"
|
||||
echo "'./hack/build-go.sh cmd/genswaggertypedocs'."
|
||||
} >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DIFFROOT="${KUBE_ROOT}/pkg"
|
||||
TMP_DIFFROOT="${KUBE_ROOT}/_tmp/pkg"
|
||||
_tmp="${KUBE_ROOT}/_tmp"
|
||||
|
||||
mkdir -p "${_tmp}"
|
||||
cp -a "${DIFFROOT}" "${TMP_DIFFROOT}"
|
||||
|
||||
"${KUBE_ROOT}/hack/update-generated-swagger-docs.sh"
|
||||
echo "diffing ${DIFFROOT} against freshly generated swagger type documentation"
|
||||
ret=0
|
||||
diff -Naupr -I 'Auto generated by' "${DIFFROOT}" "${TMP_DIFFROOT}" || ret=$?
|
||||
cp -a "${TMP_DIFFROOT}" "${KUBE_ROOT}/"
|
||||
rm -rf "${_tmp}"
|
||||
if [[ $ret -eq 0 ]]
|
||||
then
|
||||
echo "${DIFFROOT} up to date."
|
||||
else
|
||||
echo "${DIFFROOT} is out of date. Please run hack/update-generated-swagger-docs.sh"
|
||||
exit 1
|
||||
fi
|
@@ -1,58 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2014 The Kubernetes Authors All rights reserved.
|
||||
#
|
||||
# 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.
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
kube::golang::setup_env
|
||||
linkcheck=$(kube::util::find-binary "linkcheck")
|
||||
|
||||
kube::util::ensure-temp-dir
|
||||
OUTPUT="${KUBE_TEMP}"/linkcheck-output
|
||||
cleanup() {
|
||||
rm -rf "${OUTPUT}"
|
||||
}
|
||||
trap "cleanup" EXIT SIGINT
|
||||
mkdir -p "$OUTPUT"
|
||||
|
||||
APIROOT="${KUBE_ROOT}/pkg/api/"
|
||||
APISROOT="${KUBE_ROOT}/pkg/apis/"
|
||||
DOCROOT="${KUBE_ROOT}/docs/"
|
||||
ROOTS=($APIROOT $APISROOT $DOCROOT)
|
||||
found_invalid=false
|
||||
for root in "${ROOTS[@]}"; do
|
||||
"${linkcheck}" "--root-dir=${root}" 2> >(tee -a "${OUTPUT}/error" >&2) && ret=0 || ret=$?
|
||||
if [[ $ret -eq 1 ]]; then
|
||||
echo "Failed: found invalid links in ${root}."
|
||||
found_invalid=true
|
||||
fi
|
||||
if [[ $ret -gt 1 ]]; then
|
||||
echo "Error running linkcheck"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ${found_invalid} = true ]; then
|
||||
echo "Summary of invalid links:"
|
||||
cat ${OUTPUT}/error
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ex: ts=2 sw=2 et filetype=sh
|
@@ -1,49 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2015 The Kubernetes Authors All rights reserved.
|
||||
#
|
||||
# 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.
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
kube::golang::setup_env
|
||||
|
||||
apiserver=$(kube::util::find-binary "kube-apiserver")
|
||||
|
||||
SPECROOT="${KUBE_ROOT}/api/swagger-spec"
|
||||
TMP_SPECROOT="${KUBE_ROOT}/_tmp/swagger-spec"
|
||||
_tmp="${KUBE_ROOT}/_tmp"
|
||||
|
||||
mkdir -p "${_tmp}"
|
||||
cp -a "${SPECROOT}" "${TMP_SPECROOT}"
|
||||
|
||||
"${KUBE_ROOT}/hack/update-swagger-spec.sh"
|
||||
echo "diffing ${SPECROOT} against freshly generated swagger spec"
|
||||
ret=0
|
||||
diff -Naupr -I 'Auto generated by' "${SPECROOT}" "${TMP_SPECROOT}" || ret=$?
|
||||
cp -a ${TMP_SPECROOT} "${KUBE_ROOT}/api"
|
||||
rm -rf "${_tmp}"
|
||||
if [[ $ret -eq 0 ]]
|
||||
then
|
||||
echo "${SPECROOT} up to date."
|
||||
else
|
||||
echo "${SPECROOT} is out of date. Please run hack/update-swagger-spec.sh"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ex: ts=2 sw=2 et filetype=sh
|
@@ -1,47 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2014 The Kubernetes Authors All rights reserved.
|
||||
#
|
||||
# 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.
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
kube::golang::setup_env
|
||||
|
||||
# add other BADSYMBOLS here.
|
||||
BADSYMBOLS=(
|
||||
"httptest"
|
||||
"testify"
|
||||
"testing[.]"
|
||||
)
|
||||
|
||||
# b/c hyperkube binds everything simply check that for bad symbols
|
||||
SYMBOLS="$(nm ${KUBE_OUTPUT_HOSTBIN}/hyperkube)"
|
||||
|
||||
RESULT=0
|
||||
for BADSYMBOL in "${BADSYMBOLS[@]}"; do
|
||||
if FOUND=$(echo "$SYMBOLS" | grep "$BADSYMBOL"); then
|
||||
echo "Found bad symbol '${BADSYMBOL}':"
|
||||
echo "$FOUND"
|
||||
RESULT=1
|
||||
fi
|
||||
done
|
||||
|
||||
exit $RESULT
|
||||
|
||||
# ex: ts=2 sw=2 et filetype=sh
|
@@ -105,7 +105,7 @@ def file_passes(filename, refs, regexs):
|
||||
def file_extension(filename):
|
||||
return os.path.splitext(filename)[1].split(".")[-1].lower()
|
||||
|
||||
skipped_dirs = ['Godeps', 'third_party', '_gopath', '_output', '.git', 'cluster/env.sh', 'vendor']
|
||||
skipped_dirs = ['vendor', 'third_party', '_gopath', '_output', '.git', 'cluster/env.sh', 'vendor']
|
||||
def normalize_files(files):
|
||||
newfiles = []
|
||||
for pathname in files:
|
||||
|
@@ -18,21 +18,18 @@ set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
GINKGO_PARALLEL=${GINKGO_PARALLEL:-n} # set to 'y' to run tests in parallel
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||
|
||||
source "${KUBE_ROOT}/cluster/common.sh"
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
# Ginkgo will build the e2e tests, so we need to make sure that the environment
|
||||
# is set up correctly (including Godeps, etc).
|
||||
kube::golang::setup_env
|
||||
# Find the ginkgo binary build as part of the release.
|
||||
ginkgo=$(kube::util::find-binary "ginkgo")
|
||||
e2e_test=$(kube::util::find-binary "e2e.test")
|
||||
|
||||
# --- Setup some env vars.
|
||||
|
||||
GINKGO_PARALLEL=${GINKGO_PARALLEL:-n} # set to 'y' to run tests in parallel
|
||||
|
||||
: ${KUBECTL:="${KUBE_ROOT}/cluster/kubectl.sh"}
|
||||
: ${KUBE_CONFIG_FILE:="config-test.sh"}
|
||||
|
||||
|
@@ -50,9 +50,10 @@ export KUBE_INTEGRATION_TEST_MAX_CONCURRENCY=4
|
||||
export LOG_LEVEL=4
|
||||
|
||||
cd /go/src/k8s.io/kubernetes
|
||||
rm -rf Godeps/_workspace # Temporary until _workspace is fully obliterated
|
||||
|
||||
./hack/build-go.sh
|
||||
godep go install ./...
|
||||
go install ./cmd/...
|
||||
./hack/install-etcd.sh
|
||||
|
||||
./hack/verify-all.sh -v
|
||||
|
@@ -113,7 +113,7 @@ kube::golang::test_targets() {
|
||||
cmd/genswaggertypedocs
|
||||
cmd/linkcheck
|
||||
examples/k8petstore/web-server/src
|
||||
github.com/onsi/ginkgo/ginkgo
|
||||
vendor/github.com/onsi/ginkgo/ginkgo
|
||||
test/e2e/e2e.test
|
||||
test/e2e_node/e2e_node.test
|
||||
)
|
||||
@@ -253,28 +253,14 @@ kube::golang::create_gopath_tree() {
|
||||
ln -s "${KUBE_ROOT}" "${go_pkg_dir}"
|
||||
}
|
||||
|
||||
# kube::golang::setup_env will check that the `go` commands is available in
|
||||
# ${PATH}. If not running on Travis, it will also check that the Go version is
|
||||
# good enough for the Kubernetes build.
|
||||
#
|
||||
# Input Vars:
|
||||
# KUBE_EXTRA_GOPATH - If set, this is included in created GOPATH
|
||||
# KUBE_NO_GODEPS - If set, we don't add 'Godeps/_workspace' to GOPATH
|
||||
#
|
||||
# Output Vars:
|
||||
# export GOPATH - A modified GOPATH to our created tree along with extra
|
||||
# stuff.
|
||||
# export GOBIN - This is actively unset if already set as we want binaries
|
||||
# placed in a predictable place.
|
||||
kube::golang::setup_env() {
|
||||
kube::golang::create_gopath_tree
|
||||
|
||||
# Ensure the go tool exists and is a viable version.
|
||||
kube::golang::verify_go_version() {
|
||||
if [[ -z "$(which go)" ]]; then
|
||||
kube::log::usage_from_stdin <<EOF
|
||||
Can't find 'go' in PATH, please fix and retry.
|
||||
See http://golang.org/doc/install for installation instructions.
|
||||
EOF
|
||||
exit 2
|
||||
return 2
|
||||
fi
|
||||
|
||||
# Travis continuous build uses a head go release that doesn't report
|
||||
@@ -283,32 +269,54 @@ EOF
|
||||
if [[ "${TRAVIS:-}" != "true" ]]; then
|
||||
local go_version
|
||||
go_version=($(go version))
|
||||
if [[ "${go_version[2]}" < "go1.4" ]]; then
|
||||
if [[ "${go_version[2]}" < "go1.6" ]]; then
|
||||
kube::log::usage_from_stdin <<EOF
|
||||
Detected go version: ${go_version[*]}.
|
||||
Kubernetes requires go version 1.4 or greater.
|
||||
Please install Go version 1.4 or later.
|
||||
Kubernetes requires go version 1.6 or greater.
|
||||
Please install Go version 1.6 or later.
|
||||
EOF
|
||||
exit 2
|
||||
return 2
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
GOPATH=${KUBE_GOPATH}
|
||||
# kube::golang::setup_env will check that the `go` commands is available in
|
||||
# ${PATH}. If not running on Travis, it will also check that the Go version is
|
||||
# good enough for the Kubernetes build.
|
||||
#
|
||||
# Inputs:
|
||||
# KUBE_EXTRA_GOPATH - If set, this is included in created GOPATH
|
||||
#
|
||||
# Outputs:
|
||||
# env-var GOPATH points to our local output dir
|
||||
# env-var GOBIN is unset (we want binaries in a predictable place)
|
||||
# env-var GO15VENDOREXPERIMENT=1
|
||||
# current directory is within GOPATH
|
||||
kube::golang::setup_env() {
|
||||
kube::golang::verify_go_version
|
||||
|
||||
kube::golang::create_gopath_tree
|
||||
|
||||
export GOPATH=${KUBE_GOPATH}
|
||||
|
||||
# Append KUBE_EXTRA_GOPATH to the GOPATH if it is defined.
|
||||
if [[ -n ${KUBE_EXTRA_GOPATH:-} ]]; then
|
||||
GOPATH="${GOPATH}:${KUBE_EXTRA_GOPATH}"
|
||||
fi
|
||||
|
||||
# Append the tree maintained by `godep` to the GOPATH unless KUBE_NO_GODEPS
|
||||
# is defined.
|
||||
if [[ -z ${KUBE_NO_GODEPS:-} ]]; then
|
||||
GOPATH="${GOPATH}:${KUBE_ROOT}/Godeps/_workspace"
|
||||
fi
|
||||
export GOPATH
|
||||
# Change directories so that we are within the GOPATH. Some tools get really
|
||||
# upset if this is not true. We use a whole fake GOPATH here to collect the
|
||||
# resultant binaries. Go will not let us use GOBIN with `go install` and
|
||||
# cross-compiling, and `go install -o <file>` only works for a single pkg.
|
||||
local subdir
|
||||
subdir=$(kube::realpath . | sed "s|$KUBE_ROOT||")
|
||||
cd "${KUBE_GOPATH}/src/${KUBE_GO_PACKAGE}/${subdir}"
|
||||
|
||||
# Unset GOBIN in case it already exists in the current session.
|
||||
unset GOBIN
|
||||
|
||||
# This seems to matter to some tools (godep, ugorji, ginkgo...)
|
||||
export GO15VENDOREXPERIMENT=1
|
||||
}
|
||||
|
||||
# This will take binaries from $GOPATH/bin and copy them to the appropriate
|
||||
@@ -334,21 +342,13 @@ kube::golang::place_bins() {
|
||||
platform_src=""
|
||||
fi
|
||||
|
||||
local gopaths=("${KUBE_GOPATH}")
|
||||
# If targets were built inside Godeps, then we need to sync from there too.
|
||||
if [[ -z ${KUBE_NO_GODEPS:-} ]]; then
|
||||
gopaths+=("${KUBE_ROOT}/Godeps/_workspace")
|
||||
fi
|
||||
local gopath
|
||||
for gopath in "${gopaths[@]}"; do
|
||||
local full_binpath_src="${gopath}/bin${platform_src}"
|
||||
local full_binpath_src="${KUBE_GOPATH}/bin${platform_src}"
|
||||
if [[ -d "${full_binpath_src}" ]]; then
|
||||
mkdir -p "${KUBE_OUTPUT_BINPATH}/${platform}"
|
||||
find "${full_binpath_src}" -maxdepth 1 -type f -exec \
|
||||
rsync -pt {} "${KUBE_OUTPUT_BINPATH}/${platform}" \;
|
||||
fi
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
kube::golang::fallback_if_stdlib_not_installable() {
|
||||
@@ -446,16 +446,12 @@ kube::golang::build_binaries_for_platform() {
|
||||
for test in "${tests[@]:+${tests[@]}}"; do
|
||||
local outfile=$(kube::golang::output_filename_for_binary "${test}" \
|
||||
"${platform}")
|
||||
# Go 1.4 added -o to control where the binary is saved, but Go 1.3 doesn't
|
||||
# have this flag. Whenever we deprecate go 1.3, update to use -o instead of
|
||||
# changing into the output directory.
|
||||
mkdir -p "$(dirname ${outfile})"
|
||||
pushd "$(dirname ${outfile})" >/dev/null
|
||||
go test -c \
|
||||
"${goflags[@]:+${goflags[@]}}" \
|
||||
-ldflags "${goldflags}" \
|
||||
-o "${outfile}" \
|
||||
"$(dirname ${test})"
|
||||
popd >/dev/null
|
||||
done
|
||||
}
|
||||
|
||||
|
@@ -19,12 +19,7 @@ set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
# The root of the build/dist directory
|
||||
KUBE_ROOT=$(
|
||||
unset CDPATH
|
||||
kube_root=$(dirname "${BASH_SOURCE}")/../..
|
||||
cd "${kube_root}"
|
||||
pwd
|
||||
)
|
||||
KUBE_ROOT=$(cd $(dirname "${BASH_SOURCE}")/../.. && pwd -P)
|
||||
|
||||
KUBE_OUTPUT_SUBPATH="${KUBE_OUTPUT_SUBPATH:-_output/local}"
|
||||
KUBE_OUTPUT="${KUBE_ROOT}/${KUBE_OUTPUT_SUBPATH}"
|
||||
@@ -44,15 +39,83 @@ KUBE_GIT_UPSTREAM="${KUBE_GIT_UPSTREAM:-upstream}"
|
||||
|
||||
KUBE_OUTPUT_HOSTBIN="${KUBE_OUTPUT_BINPATH}/$(kube::util::host_platform)"
|
||||
|
||||
# emulates "readlink -f" which is not available on BSD (OS X).
|
||||
function readlinkdashf {
|
||||
path=$1
|
||||
# Follow links until there are no more links to follow.
|
||||
while readlink "$path"; do
|
||||
path="$(readlink $path)"
|
||||
done
|
||||
# Convert to canonical path.
|
||||
path=$(cd "$(dirname "${path}")" && pwd -P)
|
||||
echo "$path"
|
||||
# This emulates "readlink -f" which is not available on MacOS X.
|
||||
# Test:
|
||||
# T=/tmp/$$.$RANDOM
|
||||
# mkdir $T
|
||||
# touch $T/file
|
||||
# mkdir $T/dir
|
||||
# ln -s $T/file $T/linkfile
|
||||
# ln -s $T/dir $T/linkdir
|
||||
# function testone() {
|
||||
# X=$(readlink -f $1 2>&1)
|
||||
# Y=$(kube::readlinkdashf $1 2>&1)
|
||||
# if [ "$X" != "$Y" ]; then
|
||||
# echo readlinkdashf $1: expected "$X", got "$Y"
|
||||
# fi
|
||||
# }
|
||||
# testone /
|
||||
# testone /tmp
|
||||
# testone $T
|
||||
# testone $T/file
|
||||
# testone $T/dir
|
||||
# testone $T/linkfile
|
||||
# testone $T/linkdir
|
||||
# testone $T/nonexistant
|
||||
# testone $T/linkdir/file
|
||||
# testone $T/linkdir/dir
|
||||
# testone $T/linkdir/linkfile
|
||||
# testone $T/linkdir/linkdir
|
||||
function kube::readlinkdashf {
|
||||
# run in a subshell for simpler 'cd'
|
||||
(
|
||||
if [[ -d "$1" ]]; then # This also catch symlinks to dirs.
|
||||
cd "$1"
|
||||
pwd -P
|
||||
else
|
||||
cd $(dirname "$1")
|
||||
local f
|
||||
f=$(basename "$1")
|
||||
if [[ -L "$f" ]]; then
|
||||
readlink "$f"
|
||||
else
|
||||
echo "$(pwd -P)/${f}"
|
||||
fi
|
||||
fi
|
||||
)
|
||||
}
|
||||
|
||||
# This emulates "realpath" which is not available on MacOS X
|
||||
# Test:
|
||||
# T=/tmp/$$.$RANDOM
|
||||
# mkdir $T
|
||||
# touch $T/file
|
||||
# mkdir $T/dir
|
||||
# ln -s $T/file $T/linkfile
|
||||
# ln -s $T/dir $T/linkdir
|
||||
# function testone() {
|
||||
# X=$(realpath $1 2>&1)
|
||||
# Y=$(kube::realpath $1 2>&1)
|
||||
# if [ "$X" != "$Y" ]; then
|
||||
# echo realpath $1: expected "$X", got "$Y"
|
||||
# fi
|
||||
# }
|
||||
# testone /
|
||||
# testone /tmp
|
||||
# testone $T
|
||||
# testone $T/file
|
||||
# testone $T/dir
|
||||
# testone $T/linkfile
|
||||
# testone $T/linkdir
|
||||
# testone $T/nonexistant
|
||||
# testone $T/linkdir/file
|
||||
# testone $T/linkdir/dir
|
||||
# testone $T/linkdir/linkfile
|
||||
# testone $T/linkdir/linkdir
|
||||
kube::realpath() {
|
||||
if [[ ! -e "$1" ]]; then
|
||||
echo "$1: No such file or directory" >&2
|
||||
return 1
|
||||
fi
|
||||
kube::readlinkdashf "$1"
|
||||
}
|
||||
|
@@ -18,12 +18,6 @@ kube::util::sortable_date() {
|
||||
date "+%Y%m%d-%H%M%S"
|
||||
}
|
||||
|
||||
# this mimics the behavior of linux realpath which is not shipped by default with
|
||||
# mac OS X
|
||||
kube::util::realpath() {
|
||||
[[ $1 = /* ]] && echo "$1" | sed 's/\/$//' || echo "$PWD/${1#./}" | sed 's/\/$//'
|
||||
}
|
||||
|
||||
kube::util::wait_for_url() {
|
||||
local url=$1
|
||||
local prefix=${2:-}
|
||||
@@ -246,10 +240,10 @@ kube::util::gen-analytics() {
|
||||
else
|
||||
dir="${path}"
|
||||
fi
|
||||
# We don't touch files in Godeps|third_party|_gopath, and the kubectl
|
||||
# docs are autogenerated by gendocs.
|
||||
# We don't touch files in special dirs, and the kubectl docs are
|
||||
# autogenerated by gendocs.
|
||||
mdfiles=($( find "${dir}" -name "*.md" -type f \
|
||||
-not -path "${path}/Godeps/*" \
|
||||
-not -path "${path}/vendor/*" \
|
||||
-not -path "${path}/third_party/*" \
|
||||
-not -path "${path}/_gopath/*" \
|
||||
-not -path "${path}/_output/*" \
|
||||
|
@@ -107,18 +107,11 @@ kube::version::load_version_vars() {
|
||||
source "${version_file}"
|
||||
}
|
||||
|
||||
# golang 1.5+ wants `-X key=val`, but golang 1.4- REQUIRES `-X key val`
|
||||
kube::version::ldflag() {
|
||||
local key=${1}
|
||||
local val=${2}
|
||||
|
||||
GO_VERSION=($(go version))
|
||||
|
||||
if [[ -n $(echo "${GO_VERSION[2]}" | grep -E 'go1.1|go1.2|go1.3|go1.4') ]]; then
|
||||
echo "-X ${KUBE_GO_PACKAGE}/pkg/version.${key} ${val}"
|
||||
else
|
||||
echo "-X ${KUBE_GO_PACKAGE}/pkg/version.${key}=${val}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Prints the value that needs to be passed to the -ldflags parameter of go build
|
||||
|
@@ -31,7 +31,6 @@ kube::test::find_dirs() {
|
||||
-path './_artifacts/*' \
|
||||
-o -path './_output/*' \
|
||||
-o -path './_gopath/*' \
|
||||
-o -path './Godeps/*' \
|
||||
-o -path './contrib/podex/*' \
|
||||
-o -path './output/*' \
|
||||
-o -path './release/*' \
|
||||
@@ -40,12 +39,13 @@ kube::test::find_dirs() {
|
||||
-o -path './test/e2e_node/*' \
|
||||
-o -path './test/integration/*' \
|
||||
-o -path './test/component/scheduler/perf/*' \
|
||||
-o -path './third_party/*'\
|
||||
-o -path './vendor/*'\
|
||||
\) -prune \
|
||||
\) -name '*_test.go' -print0 | xargs -0n1 dirname | sed 's|^\./||' | sort -u
|
||||
)
|
||||
}
|
||||
|
||||
# -covermode=atomic becomes default with -race in Go >=1.3
|
||||
KUBE_TIMEOUT=${KUBE_TIMEOUT:--timeout 120s}
|
||||
KUBE_COVER=${KUBE_COVER:-n} # set to 'y' to enable coverage collection
|
||||
KUBE_COVERMODE=${KUBE_COVERMODE:-atomic}
|
||||
|
@@ -1,30 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2014 The Kubernetes Authors All rights reserved.
|
||||
#
|
||||
# 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.
|
||||
|
||||
# This script installs std -race on Travis (see https://code.google.com/p/go/issues/detail?id=6479)
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
if [[ "${TRAVIS}" == "true" ]]; then
|
||||
GO_VERSION=($(go version))
|
||||
|
||||
if [[ ${GO_VERSION[2]} < "go1.3" ]]; then
|
||||
echo "Installing the -race compatible version of the std go library"
|
||||
go install -a -race std
|
||||
fi
|
||||
fi
|
@@ -34,7 +34,7 @@ generated_files=($(
|
||||
-o -wholename './release' \
|
||||
-o -wholename './target' \
|
||||
-o -wholename '*/third_party/*' \
|
||||
-o -wholename '*/Godeps/*' \
|
||||
-o -wholename '*/vendor/*' \
|
||||
-o -wholename '*/codecgen-*-1234.generated.go' \
|
||||
\) -prune \
|
||||
\) -name '*.generated.go' | sort -r))
|
||||
@@ -117,7 +117,7 @@ fi
|
||||
|
||||
echo "Building codecgen"
|
||||
CODECGEN="${PWD}/codecgen_binary"
|
||||
godep go build -o "${CODECGEN}" github.com/ugorji/go/codec/codecgen
|
||||
go build -o "${CODECGEN}" ./vendor/github.com/ugorji/go/codec/codecgen
|
||||
|
||||
# Running codecgen fails if some of the files doesn't compile.
|
||||
# Thus (since all the files are completely auto-generated and
|
||||
|
@@ -23,9 +23,28 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
kube::golang::setup_env
|
||||
|
||||
"${KUBE_ROOT}/hack/build-go.sh" cmd/libs/go2idl/client-gen
|
||||
"${KUBE_ROOT}/hack/build-go.sh" cmd/libs/go2idl/conversion-gen
|
||||
"${KUBE_ROOT}/hack/build-go.sh" cmd/libs/go2idl/deepcopy-gen
|
||||
"${KUBE_ROOT}/hack/build-go.sh" cmd/libs/go2idl/set-gen
|
||||
BUILD_TARGETS=(
|
||||
cmd/libs/go2idl/client-gen
|
||||
cmd/libs/go2idl/conversion-gen
|
||||
cmd/libs/go2idl/deepcopy-gen
|
||||
cmd/libs/go2idl/set-gen
|
||||
)
|
||||
"${KUBE_ROOT}/hack/build-go.sh" ${BUILD_TARGETS[*]}
|
||||
|
||||
"${KUBE_ROOT}/hack/after-build/run-codegen.sh" "$@"
|
||||
clientgen=$(kube::util::find-binary "client-gen")
|
||||
conversiongen=$(kube::util::find-binary "conversion-gen")
|
||||
deepcopygen=$(kube::util::find-binary "deepcopy-gen")
|
||||
setgen=$(kube::util::find-binary "set-gen")
|
||||
|
||||
# Please do not add any logic to this shell script. Add logic to the go code
|
||||
# that generates the set-gen program.
|
||||
#
|
||||
# This can be called with one flag, --verify-only, so it works for both the
|
||||
# update- and verify- scripts.
|
||||
${clientgen} "$@"
|
||||
${clientgen} -t "$@"
|
||||
${conversiongen} "$@"
|
||||
${deepcopygen} "$@"
|
||||
${setgen} "$@"
|
||||
|
||||
# You may add additional calls of code generators like set-gen above.
|
||||
|
@@ -23,8 +23,59 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
kube::golang::setup_env
|
||||
|
||||
"${KUBE_ROOT}/hack/build-go.sh" cmd/gendocs cmd/genkubedocs cmd/genman cmd/genyaml cmd/genbashcomp cmd/mungedocs
|
||||
"${KUBE_ROOT}/hack/build-go.sh" \
|
||||
cmd/gendocs \
|
||||
cmd/genkubedocs \
|
||||
cmd/genman \
|
||||
cmd/genyaml \
|
||||
cmd/genbashcomp \
|
||||
cmd/mungedocs
|
||||
|
||||
"${KUBE_ROOT}/hack/after-build/update-generated-docs.sh" "$@"
|
||||
kube::util::ensure-temp-dir
|
||||
|
||||
kube::util::gen-docs "${KUBE_TEMP}"
|
||||
|
||||
# remove all of the old docs
|
||||
while read file; do
|
||||
rm "${KUBE_ROOT}/${file}" 2>/dev/null || true
|
||||
done <"${KUBE_ROOT}/.generated_docs"
|
||||
|
||||
# the shopt is so that we get .generated_docs from the glob.
|
||||
shopt -s dotglob
|
||||
cp -af "${KUBE_TEMP}"/* "${KUBE_ROOT}"
|
||||
shopt -u dotglob
|
||||
|
||||
kube::util::gen-analytics "${KUBE_ROOT}"
|
||||
|
||||
mungedocs=$(kube::util::find-binary "mungedocs")
|
||||
"${mungedocs}" "--upstream=${KUBE_GIT_UPSTREAM}" "--root-dir=${KUBE_ROOT}/docs/" && ret=0 || ret=$?
|
||||
if [[ $ret -eq 1 ]]; then
|
||||
echo "${KUBE_ROOT}/docs/ requires manual changes. See preceding errors."
|
||||
exit 1
|
||||
elif [[ $ret -gt 1 ]]; then
|
||||
echo "Error running mungedocs."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
"${mungedocs}" "--upstream=${KUBE_GIT_UPSTREAM}" "--root-dir=${KUBE_ROOT}/examples/" && ret=0 || ret=$?
|
||||
if [[ $ret -eq 1 ]]; then
|
||||
echo "${KUBE_ROOT}/examples/ requires manual changes. See preceding errors."
|
||||
exit 1
|
||||
elif [[ $ret -gt 1 ]]; then
|
||||
echo "Error running mungedocs."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
"${mungedocs}" "--upstream=${KUBE_GIT_UPSTREAM}" \
|
||||
"--skip-munges=unversioned-warning,analytics" \
|
||||
"--norecurse" \
|
||||
"--root-dir=${KUBE_ROOT}/" && ret=0 || ret=$?
|
||||
if [[ $ret -eq 1 ]]; then
|
||||
echo "${KUBE_ROOT}/ requires manual changes. See preceding errors."
|
||||
exit 1
|
||||
elif [[ $ret -gt 1 ]]; then
|
||||
echo "Error running mungedocs."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ex: ts=2 sw=2 et filetype=sh
|
||||
|
@@ -18,7 +18,7 @@ set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
kube::golang::setup_env
|
||||
@@ -42,5 +42,5 @@ gotoprotobuf=$(kube::util::find-binary "go-to-protobuf")
|
||||
# satisfies import of github.com/gogo/protobuf/gogoproto/gogo.proto and the core Google protobuf types
|
||||
PATH="${KUBE_ROOT}/_output/local/go/bin:${PATH}" \
|
||||
"${gotoprotobuf}" \
|
||||
--proto-import="${KUBE_ROOT}/Godeps/_workspace/src" \
|
||||
--proto-import="${KUBE_ROOT}/vendor" \
|
||||
--proto-import="${KUBE_ROOT}/third_party/protobuf"
|
@@ -37,13 +37,7 @@ function prereqs() {
|
||||
KUBE_BUILD_CONTAINER_NAME="kube-build-${KUBE_ROOT_HASH}"
|
||||
KUBE_BUILD_DATA_CONTAINER_NAME="kube-build-data-${KUBE_ROOT_HASH}"
|
||||
DOCKER_MOUNT_ARGS=(
|
||||
--volume "${REPO_DIR:-${KUBE_ROOT}}/cluster:/go/src/${KUBE_GO_PACKAGE}/cluster"
|
||||
--volume "${REPO_DIR:-${KUBE_ROOT}}/cmd:/go/src/${KUBE_GO_PACKAGE}/cmd"
|
||||
--volume "${REPO_DIR:-${KUBE_ROOT}}/Godeps/_workspace/src:/go/src/${KUBE_GO_PACKAGE}/Godeps/_workspace/src"
|
||||
--volume "${REPO_DIR:-${KUBE_ROOT}}/hack:/go/src/${KUBE_GO_PACKAGE}/hack"
|
||||
--volume "${REPO_DIR:-${KUBE_ROOT}}/pkg:/go/src/${KUBE_GO_PACKAGE}/pkg"
|
||||
--volume "${REPO_DIR:-${KUBE_ROOT}}/federation:/go/src/${KUBE_GO_PACKAGE}/federation"
|
||||
--volume "${REPO_DIR:-${KUBE_ROOT}}/third_party:/go/src/${KUBE_GO_PACKAGE}/third_party"
|
||||
--volume "${REPO_DIR:-${KUBE_ROOT}}:/go/src/${KUBE_GO_PACKAGE}"
|
||||
--volume /etc/localtime:/etc/localtime:ro
|
||||
--volumes-from "${KUBE_BUILD_DATA_CONTAINER_NAME}"
|
||||
)
|
||||
@@ -55,6 +49,6 @@ mkdir -p "${LOCAL_OUTPUT_BUILD_CONTEXT}"
|
||||
cp "${KUBE_ROOT}/cmd/libs/go2idl/go-to-protobuf/build-image/Dockerfile" "${LOCAL_OUTPUT_BUILD_CONTEXT}/Dockerfile"
|
||||
kube::build::update_dockerfile
|
||||
kube::build::docker_build "${KUBE_BUILD_IMAGE}" "${LOCAL_OUTPUT_BUILD_CONTEXT}" 'false'
|
||||
kube::build::run_build_command hack/after-build/update-generated-protobuf.sh "$@"
|
||||
kube::build::run_build_command hack/update-generated-protobuf-dockerized.sh "$@"
|
||||
|
||||
# ex: ts=2 sw=2 et filetype=sh
|
||||
|
@@ -46,8 +46,9 @@ function generate_version() {
|
||||
// AUTO-GENERATED FUNCTIONS START HERE
|
||||
EOF
|
||||
|
||||
GOPATH=$(godep path):$GOPATH go run cmd/genswaggertypedocs/swagger_type_docs.go -s \
|
||||
"pkg/$(kube::util::group-version-to-pkg-path "${group_version}")/types.go" -f - \
|
||||
go run cmd/genswaggertypedocs/swagger_type_docs.go -s \
|
||||
"pkg/$(kube::util::group-version-to-pkg-path "${group_version}")/types.go" \
|
||||
-f - \
|
||||
>> "$TMPFILE"
|
||||
|
||||
echo "// AUTO-GENERATED FUNCTIONS END HERE" >> "$TMPFILE"
|
||||
|
@@ -30,6 +30,9 @@ set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
export LANG=C
|
||||
export LC_ALL=C
|
||||
|
||||
###############################################################################
|
||||
# Manage the state of LICENSE/COPYRIGHT files
|
||||
# Default operation is to check to see if a file is in the state file.
|
||||
@@ -56,7 +59,7 @@ file_state () {
|
||||
|
||||
# Get return code from grep itself
|
||||
# Redirect stderr so that a missing state file returns 1 quietly
|
||||
LANG=C egrep -wq "^${file}$" ${GODEPS_STATE} 2>/dev/null
|
||||
egrep -wq "^${file}$" ${GODEPS_STATE} 2>/dev/null
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
@@ -68,12 +71,11 @@ file_state () {
|
||||
process_content () {
|
||||
local package=$1
|
||||
local type=$2
|
||||
local f
|
||||
|
||||
local package_root
|
||||
local ensure_pattern
|
||||
local package_root_url
|
||||
local dir_root
|
||||
local godeps_root
|
||||
local find_maxdepth
|
||||
local find_names
|
||||
local -a local_files=()
|
||||
@@ -111,50 +113,47 @@ process_content () {
|
||||
package_root_url="${package_root/github.com/raw.githubusercontent.com}"
|
||||
|
||||
# Find LOCAL files first - only root and package level
|
||||
local_files=($(
|
||||
for dir_root in ${package} ${package_root}; do
|
||||
for godeps_root in ${GODEPS_SRC} ${GODEPS_AUX}; do
|
||||
[[ -d ${godeps_root}/${dir_root} ]] || continue
|
||||
[[ -d ${DEPS_DIR}/${dir_root} ]] || continue
|
||||
|
||||
# One (set) of these is fine
|
||||
local_files+=($(find ${godeps_root}/${dir_root} \
|
||||
find ${DEPS_DIR}/${dir_root} \
|
||||
-xdev -follow -maxdepth ${find_maxdepth} \
|
||||
-type f "${find_names[@]}"))
|
||||
done
|
||||
done
|
||||
# Uniquely sort the array
|
||||
IFS=$'\n' local_files=($(LC_ALL=C sort -u <<<"${local_files[*]-}"))
|
||||
unset IFS
|
||||
-type f "${find_names[@]}"
|
||||
done | sort -u))
|
||||
|
||||
local index
|
||||
local f
|
||||
index="${package}-${type}"
|
||||
FILE_CONTENT[${index}]=""
|
||||
for f in ${local_files[@]-}; do
|
||||
# Find some copyright info in any file and break
|
||||
egrep -wq "${ensure_pattern}" ${f} && \
|
||||
FILE_CONTENT[${package}-${type}]="$(cat ${f})" && break
|
||||
if egrep -wq "${ensure_pattern}" "${f}"; then
|
||||
FILE_CONTENT[${index}]=$(cat "${f}")
|
||||
break
|
||||
fi
|
||||
done
|
||||
# When nothing is set at the package level, try package_root
|
||||
: ${FILE_CONTENT[${package}-${type}]:="${FILE_CONTENT[${package_root}-${type}]-}"}
|
||||
|
||||
if [[ -z "${FILE_CONTENT[${package}-${type}]-}" ]]; then
|
||||
if [[ -z "${FILE_CONTENT[${index}]-}" ]]; then
|
||||
# When nothing is set at the package level, try package_root
|
||||
FILE_CONTENT[${index}]="${FILE_CONTENT[${package_root}-${type}]-}"
|
||||
fi
|
||||
|
||||
if [[ -z "${FILE_CONTENT[${index}]-}" ]]; then
|
||||
# Last ditch attempt - see if we can get it from version control
|
||||
for f in ${remote_files[@]}; do
|
||||
file_state "${package_root_url}/master/${f}" && continue
|
||||
if ! FILE_CONTENT[${package}-${type}]="$(\
|
||||
if ! FILE_CONTENT[${index}]="$(\
|
||||
curl --fail --retry 10 -s \
|
||||
https://${package_root_url}/master/${f})" || \
|
||||
! $(echo "${FILE_CONTENT[${package}-${type}]-}" |\
|
||||
! $(echo "${FILE_CONTENT[${index}]-}" |\
|
||||
egrep -qw "${ensure_pattern}") ||
|
||||
[[ "${FILE_CONTENT[${package}-${type}]-}" =~ \<\ *html ]] ; then
|
||||
[[ "${FILE_CONTENT[${index}]-}" =~ \<\ *html ]] ; then
|
||||
|
||||
((CREATE_MISSING)) || file_state -a "${package_root_url}/master/${f}"
|
||||
continue
|
||||
fi
|
||||
|
||||
if [[ -n "${FILE_CONTENT[${package}-${type}]-}" ]]; then
|
||||
if ((CREATE_MISSING)); then
|
||||
mkdir -p ${GODEPS_AUX}/${package_root}
|
||||
echo "${FILE_CONTENT[${package}-${type}]}" \
|
||||
> ${GODEPS_AUX}/${package_root}/${f}
|
||||
fi
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
@@ -163,8 +162,11 @@ process_content () {
|
||||
#############################################################################
|
||||
# MAIN
|
||||
#############################################################################
|
||||
KUBE_ROOT="${KUBE_ROOT:-$(cd "$(dirname "${BASH_SOURCE}")/.." && pwd -P)}"
|
||||
cd "${KUBE_ROOT}"
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
LICENSE_ROOT="${LICENSE_ROOT:-${KUBE_ROOT}}"
|
||||
cd "${LICENSE_ROOT}"
|
||||
|
||||
# If CREATE_MISSING=1, the state file is ignored
|
||||
CREATE_MISSING=0
|
||||
@@ -177,8 +179,7 @@ fi
|
||||
GODEPS_STATE="Godeps/.license_file_state"
|
||||
|
||||
GODEPS_LICENSE_FILE=${1:-"Godeps/LICENSES"}
|
||||
GODEPS_SRC="Godeps/_workspace/src"
|
||||
GODEPS_AUX="Godeps/_workspace_aux/src"
|
||||
DEPS_DIR="vendor"
|
||||
declare -Ag FILE_CONTENT
|
||||
|
||||
|
||||
@@ -187,20 +188,20 @@ declare -Ag FILE_CONTENT
|
||||
echo "================================================================================"
|
||||
echo "= Kubernetes licensed under: ="
|
||||
echo
|
||||
cat ${KUBE_ROOT}/LICENSE
|
||||
cat ${LICENSE_ROOT}/LICENSE
|
||||
) > ${GODEPS_LICENSE_FILE}
|
||||
|
||||
# Loop through every package in Godeps.json
|
||||
for PACKAGE in $(cat Godeps/Godeps.json | \
|
||||
jq -r ".Deps[].ImportPath" | LC_ALL=C sort -f); do
|
||||
|
||||
jq -r ".Deps[].ImportPath" | \
|
||||
sort -f); do
|
||||
process_content ${PACKAGE} LICENSE
|
||||
process_content ${PACKAGE} COPYRIGHT
|
||||
|
||||
# display content
|
||||
echo
|
||||
echo "================================================================================"
|
||||
echo "= ${GODEPS_SRC}/${PACKAGE} licensed under: ="
|
||||
echo "= ${DEPS_DIR}/${PACKAGE} licensed under: ="
|
||||
echo
|
||||
|
||||
if [[ -z "${FILE_CONTENT[${PACKAGE}-LICENSE]-}" &&
|
||||
|
@@ -21,13 +21,9 @@ set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
GO_VERSION=($(go version))
|
||||
|
||||
if [[ -n $(echo "${GO_VERSION[2]}" | grep -E 'go1.1|go1.2|go1.3') ]]; then
|
||||
echo "Unsupported go version '${GO_VERSION}', skipping gofmt."
|
||||
exit 0
|
||||
fi
|
||||
kube::golang::verify_go_version
|
||||
|
||||
cd "${KUBE_ROOT}"
|
||||
|
||||
@@ -40,7 +36,7 @@ find_files() {
|
||||
-o -wholename './release' \
|
||||
-o -wholename './target' \
|
||||
-o -wholename '*/third_party/*' \
|
||||
-o -wholename '*/Godeps/*' \
|
||||
-o -wholename '*/vendor/*' \
|
||||
\) -prune \
|
||||
\) -name '*.go'
|
||||
}
|
||||
|
@@ -21,13 +21,89 @@ set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
cat << __EOF__
|
||||
Note: This assumes that the 'types_swagger_doc_generated.go' file has been
|
||||
updated for all API group versions. If you are unsure, please run
|
||||
hack/update-generated-swagger-docs.sh first.
|
||||
__EOF__
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||
SWAGGER_ROOT_DIR="${KUBE_ROOT}/api/swagger-spec"
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
kube::golang::setup_env
|
||||
|
||||
"${KUBE_ROOT}/hack/build-go.sh" cmd/kube-apiserver
|
||||
|
||||
"${KUBE_ROOT}/hack/after-build/update-swagger-spec.sh" "$@"
|
||||
function cleanup()
|
||||
{
|
||||
[[ -n ${APISERVER_PID-} ]] && kill ${APISERVER_PID} 1>&2 2>/dev/null
|
||||
|
||||
kube::etcd::cleanup
|
||||
|
||||
kube::log::status "Clean up complete"
|
||||
}
|
||||
|
||||
trap cleanup EXIT SIGINT
|
||||
|
||||
kube::golang::setup_env
|
||||
|
||||
apiserver=$(kube::util::find-binary "kube-apiserver")
|
||||
|
||||
TMP_DIR=$(mktemp -d /tmp/update-swagger-spec.XXXX)
|
||||
ETCD_HOST=${ETCD_HOST:-127.0.0.1}
|
||||
ETCD_PORT=${ETCD_PORT:-4001}
|
||||
API_PORT=${API_PORT:-8050}
|
||||
API_HOST=${API_HOST:-127.0.0.1}
|
||||
KUBELET_PORT=${KUBELET_PORT:-10250}
|
||||
|
||||
kube::etcd::start
|
||||
|
||||
# Start kube-apiserver
|
||||
kube::log::status "Starting kube-apiserver"
|
||||
"${KUBE_OUTPUT_HOSTBIN}/kube-apiserver" \
|
||||
--insecure-bind-address="127.0.0.1" \
|
||||
--bind-address="127.0.0.1" \
|
||||
--insecure-port="${API_PORT}" \
|
||||
--etcd-servers="http://${ETCD_HOST}:${ETCD_PORT}" \
|
||||
--advertise-address="10.10.10.10" \
|
||||
--cert-dir="${TMP_DIR}/certs" \
|
||||
--service-cluster-ip-range="10.0.0.0/24" >/tmp/swagger-api-server.log 2>&1 &
|
||||
APISERVER_PID=$!
|
||||
|
||||
kube::util::wait_for_url "http://127.0.0.1:${API_PORT}/healthz" "apiserver: "
|
||||
|
||||
SWAGGER_API_PATH="http://127.0.0.1:${API_PORT}/swaggerapi/"
|
||||
DEFAULT_GROUP_VERSIONS="v1 autoscaling/v1 batch/v1 extensions/v1beta1 apps/v1alpha1"
|
||||
VERSIONS=${VERSIONS:-$DEFAULT_GROUP_VERSIONS}
|
||||
|
||||
kube::log::status "Updating " ${SWAGGER_ROOT_DIR}
|
||||
|
||||
for ver in ${VERSIONS}; do
|
||||
# fetch the swagger spec for each group version.
|
||||
if [[ ${ver} == "v1" ]]; then
|
||||
SUBPATH="api"
|
||||
else
|
||||
SUBPATH="apis"
|
||||
fi
|
||||
SUBPATH="${SUBPATH}/${ver}"
|
||||
SWAGGER_JSON_NAME="$(kube::util::gv-to-swagger-name ${ver}).json"
|
||||
curl -w "\n" -fs "${SWAGGER_API_PATH}${SUBPATH}" > "${SWAGGER_ROOT_DIR}/${SWAGGER_JSON_NAME}"
|
||||
|
||||
# fetch the swagger spec for the discovery mechanism at group level.
|
||||
if [[ ${ver} == "v1" ]]; then
|
||||
continue
|
||||
fi
|
||||
SUBPATH="apis/"${ver%/*}
|
||||
SWAGGER_JSON_NAME="${ver%/*}.json"
|
||||
curl -w "\n" -fs "${SWAGGER_API_PATH}${SUBPATH}" > "${SWAGGER_ROOT_DIR}/${SWAGGER_JSON_NAME}"
|
||||
done
|
||||
|
||||
# fetch swagger specs for other discovery mechanism.
|
||||
curl -w "\n" -fs "${SWAGGER_API_PATH}" > "${SWAGGER_ROOT_DIR}/resourceListing.json"
|
||||
curl -w "\n" -fs "${SWAGGER_API_PATH}version" > "${SWAGGER_ROOT_DIR}/version.json"
|
||||
curl -w "\n" -fs "${SWAGGER_API_PATH}api" > "${SWAGGER_ROOT_DIR}/api.json"
|
||||
curl -w "\n" -fs "${SWAGGER_API_PATH}apis" > "${SWAGGER_ROOT_DIR}/apis.json"
|
||||
kube::log::status "SUCCESS"
|
||||
|
||||
# ex: ts=2 sw=2 et filetype=sh
|
||||
|
@@ -31,7 +31,7 @@ generated_files=($(
|
||||
-o -wholename './release' \
|
||||
-o -wholename './target' \
|
||||
-o -wholename '*/third_party/*' \
|
||||
-o -wholename '*/Godeps/*' \
|
||||
-o -wholename '*/vendor/*' \
|
||||
\) -prune \
|
||||
\) -name '*.generated.go'))
|
||||
|
||||
|
@@ -18,16 +18,9 @@ set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
kube::golang::setup_env
|
||||
|
||||
"${KUBE_ROOT}/hack/build-go.sh" cmd/libs/go2idl/client-gen
|
||||
"${KUBE_ROOT}/hack/build-go.sh" cmd/libs/go2idl/conversion-gen
|
||||
"${KUBE_ROOT}/hack/build-go.sh" cmd/libs/go2idl/deepcopy-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/update-codegen.sh" --verify-only
|
||||
|
@@ -22,8 +22,67 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
kube::golang::setup_env
|
||||
|
||||
"${KUBE_ROOT}/hack/build-go.sh" cmd/genswaggertypedocs
|
||||
|
||||
"${KUBE_ROOT}/hack/after-build/verify-description.sh" "$@"
|
||||
# Find binary
|
||||
genswaggertypedocs=$(kube::util::find-binary "genswaggertypedocs")
|
||||
|
||||
# ex: ts=2 sw=2 et filetype=sh
|
||||
gen_swagger_result=0
|
||||
result=0
|
||||
|
||||
find_files() {
|
||||
find . -not \( \
|
||||
\( \
|
||||
-wholename './output' \
|
||||
-o -wholename './_output' \
|
||||
-o -wholename './_gopath' \
|
||||
-o -wholename './release' \
|
||||
-o -wholename './target' \
|
||||
-o -wholename '*/third_party/*' \
|
||||
-o -wholename '*/vendor/*' \
|
||||
\) -prune \
|
||||
\) \
|
||||
\( -wholename '*pkg/api/v*/types.go' \
|
||||
-o -wholename '*pkg/apis/*/v*/types.go' \
|
||||
-o -wholename '*pkg/api/unversioned/types.go' \
|
||||
\)
|
||||
}
|
||||
|
||||
if [[ $# -eq 0 ]]; then
|
||||
versioned_api_files=$(find_files | egrep "pkg/.[^/]*/((v.[^/]*)|unversioned)/types\.go")
|
||||
else
|
||||
versioned_api_files="${*}"
|
||||
fi
|
||||
|
||||
for file in $versioned_api_files; do
|
||||
$genswaggertypedocs -v -s "${file}" -f - || gen_swagger_result=$?
|
||||
if [[ "${gen_swagger_result}" -ne "0" ]]; then
|
||||
echo "API file: ${file} is missing: ${gen_swagger_result} descriptions"
|
||||
result=1
|
||||
fi
|
||||
if grep json: "${file}" | grep -v // | grep description: ; then
|
||||
echo "API file: ${file} should not contain descriptions in struct tags"
|
||||
result=1
|
||||
fi
|
||||
if grep json: "${file}" | grep -Ee ",[[:space:]]+omitempty|omitempty[[:space:]]+" ; then
|
||||
echo "API file: ${file} should not contain leading or trailing spaces for omitempty directive"
|
||||
result=1
|
||||
fi
|
||||
done
|
||||
|
||||
internal_types_files="${KUBE_ROOT}/pkg/api/types.go ${KUBE_ROOT}/pkg/apis/extensions/types.go"
|
||||
for internal_types_file in $internal_types_files; do
|
||||
if [[ ! -e $internal_types_file ]]; then
|
||||
echo "Internal types file ${internal_types_file} does not exist"
|
||||
result=1
|
||||
continue
|
||||
fi
|
||||
|
||||
if grep json: "${internal_types_file}" | grep -v // | grep description: ; then
|
||||
echo "Internal API types should not contain descriptions"
|
||||
result=1
|
||||
fi
|
||||
done
|
||||
|
||||
exit ${result}
|
||||
|
@@ -53,8 +53,8 @@ def get_all_files(rootdir):
|
||||
all_files = []
|
||||
for root, dirs, files in os.walk(rootdir):
|
||||
# don't visit certain dirs
|
||||
if 'Godeps' in dirs:
|
||||
dirs.remove('Godeps')
|
||||
if 'vendor' in dirs:
|
||||
dirs.remove('vendor')
|
||||
if '_gopath' in dirs:
|
||||
dirs.remove('_gopath')
|
||||
if 'third_party' in dirs:
|
||||
|
@@ -23,8 +23,68 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
kube::golang::setup_env
|
||||
|
||||
"${KUBE_ROOT}/hack/build-go.sh" cmd/gendocs cmd/genkubedocs cmd/genman cmd/genyaml cmd/genbashcomp cmd/mungedocs
|
||||
"${KUBE_ROOT}/hack/build-go.sh" \
|
||||
cmd/gendocs \
|
||||
cmd/genkubedocs \
|
||||
cmd/genman \
|
||||
cmd/genyaml \
|
||||
cmd/genbashcomp \
|
||||
cmd/mungedocs
|
||||
|
||||
"${KUBE_ROOT}/hack/after-build/verify-generated-docs.sh" "$@"
|
||||
# Find binary
|
||||
gendocs=$(kube::util::find-binary "gendocs")
|
||||
genkubedocs=$(kube::util::find-binary "genkubedocs")
|
||||
genman=$(kube::util::find-binary "genman")
|
||||
genyaml=$(kube::util::find-binary "genyaml")
|
||||
genbashcomp=$(kube::util::find-binary "genbashcomp")
|
||||
mungedocs=$(kube::util::find-binary "mungedocs")
|
||||
|
||||
DOCROOT="${KUBE_ROOT}/docs/"
|
||||
EXAMPLEROOT="${KUBE_ROOT}/examples/"
|
||||
|
||||
# mungedocs --verify can (and should) be run on the real docs, otherwise their
|
||||
# links will be distorted. --verify means that it will not make changes.
|
||||
# --verbose gives us output we can use for a diff.
|
||||
"${mungedocs}" "--verify=true" "--verbose=true" "--upstream=${KUBE_GIT_UPSTREAM}" "--root-dir=${DOCROOT}" && ret=0 || ret=$?
|
||||
if [[ $ret -eq 1 ]]; then
|
||||
echo "${DOCROOT} is out of date. Please run hack/update-generated-docs.sh"
|
||||
exit 1
|
||||
fi
|
||||
if [[ $ret -gt 1 ]]; then
|
||||
echo "Error running mungedocs"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
"${mungedocs}" "--verify=true" "--verbose=true" "--upstream=${KUBE_GIT_UPSTREAM}" "--root-dir=${EXAMPLEROOT}" && ret=0 || ret=$?
|
||||
if [[ $ret -eq 1 ]]; then
|
||||
echo "${EXAMPLEROOT} is out of date. Please run hack/update-generated-docs.sh"
|
||||
exit 1
|
||||
fi
|
||||
if [[ $ret -gt 1 ]]; then
|
||||
echo "Error running mungedocs"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
kube::util::ensure-temp-dir
|
||||
|
||||
kube::util::gen-docs "${KUBE_TEMP}"
|
||||
diff -Naup "${KUBE_TEMP}/.generated_docs" "${KUBE_ROOT}/.generated_docs" || ret=1 || true
|
||||
while read file; do
|
||||
diff -Naup "${KUBE_TEMP}/${file}" "${KUBE_ROOT}/${file}" || ret=1 || true
|
||||
done <"${KUBE_TEMP}/.generated_docs"
|
||||
|
||||
needsanalytics=($(kube::util::gen-analytics "${KUBE_ROOT}" 1))
|
||||
if [[ ${#needsanalytics[@]} -ne 0 ]]; then
|
||||
echo -e "Some md files are missing ga-beacon analytics link:"
|
||||
printf '%s\n' "${needsanalytics[@]}"
|
||||
ret=1
|
||||
fi
|
||||
if [[ $ret -eq 0 ]]
|
||||
then
|
||||
echo "Generated docs are up to date."
|
||||
else
|
||||
echo "Generated docs are out of date. Please run hack/update-generated-docs.sh"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ex: ts=2 sw=2 et filetype=sh
|
||||
|
@@ -23,6 +23,39 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
kube::golang::setup_env
|
||||
|
||||
"${KUBE_ROOT}/hack/after-build/verify-generated-protobuf.sh" "$@"
|
||||
APIROOTS=${APIROOTS:-pkg/api pkg/apis pkg/runtime pkg/util/intstr pkg/watch}
|
||||
_tmp="${KUBE_ROOT}/_tmp"
|
||||
|
||||
# ex: ts=2 sw=2 et filetype=sh
|
||||
cleanup() {
|
||||
rm -rf "${_tmp}"
|
||||
}
|
||||
|
||||
trap "cleanup" EXIT SIGINT
|
||||
|
||||
cleanup
|
||||
for APIROOT in ${APIROOTS}; do
|
||||
mkdir -p "${_tmp}/${APIROOT%/*}"
|
||||
cp -a "${KUBE_ROOT}/${APIROOT}" "${_tmp}/${APIROOT}"
|
||||
done
|
||||
|
||||
# If not running as root, we need to use sudo to restore the original generated
|
||||
# protobuf files.
|
||||
SUDO=""
|
||||
if [[ "$(id -u)" != '0' ]]; then
|
||||
SUDO="sudo"
|
||||
fi
|
||||
|
||||
"${KUBE_ROOT}/hack/update-generated-protobuf.sh"
|
||||
for APIROOT in ${APIROOTS}; do
|
||||
TMP_APIROOT="${_tmp}/${APIROOT}"
|
||||
echo "diffing ${APIROOT} against freshly generated protobuf"
|
||||
ret=0
|
||||
diff -Naupr -I 'Auto generated by' "${KUBE_ROOT}/${APIROOT}" "${TMP_APIROOT}" || ret=$?
|
||||
${SUDO} cp -a "${TMP_APIROOT}" "${KUBE_ROOT}/${APIROOT%/*}"
|
||||
if [[ $ret -eq 0 ]]; then
|
||||
echo "${APIROOT} up to date."
|
||||
else
|
||||
echo "${APIROOT} is out of date. Please run hack/update-generated-protobuf.sh"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
@@ -25,4 +25,36 @@ kube::golang::setup_env
|
||||
|
||||
"${KUBE_ROOT}/hack/build-go.sh" cmd/genswaggertypedocs
|
||||
|
||||
"${KUBE_ROOT}/hack/after-build/verify-generated-swagger-docs.sh" "$@"
|
||||
# Find binary
|
||||
genswaggertypedocs=$(kube::util::find-binary "genswaggertypedocs")
|
||||
|
||||
if [[ ! -x "$genswaggertypedocs" ]]; then
|
||||
{
|
||||
echo "It looks as if you don't have a compiled genswaggertypedocs binary"
|
||||
echo
|
||||
echo "If you are running from a clone of the git repo, please run"
|
||||
echo "'./hack/build-go.sh cmd/genswaggertypedocs'."
|
||||
} >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DIFFROOT="${KUBE_ROOT}/pkg"
|
||||
TMP_DIFFROOT="${KUBE_ROOT}/_tmp/pkg"
|
||||
_tmp="${KUBE_ROOT}/_tmp"
|
||||
|
||||
mkdir -p "${_tmp}"
|
||||
cp -a "${DIFFROOT}" "${TMP_DIFFROOT}"
|
||||
|
||||
"${KUBE_ROOT}/hack/update-generated-swagger-docs.sh"
|
||||
echo "diffing ${DIFFROOT} against freshly generated swagger type documentation"
|
||||
ret=0
|
||||
diff -Naupr -I 'Auto generated by' "${DIFFROOT}" "${TMP_DIFFROOT}" || ret=$?
|
||||
cp -a "${TMP_DIFFROOT}" "${KUBE_ROOT}/"
|
||||
rm -rf "${_tmp}"
|
||||
if [[ $ret -eq 0 ]]
|
||||
then
|
||||
echo "${DIFFROOT} up to date."
|
||||
else
|
||||
echo "${DIFFROOT} is out of date. Please run hack/update-generated-swagger-docs.sh"
|
||||
exit 1
|
||||
fi
|
||||
|
@@ -18,7 +18,7 @@ set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
KUBE_ROOT="$(cd "$(dirname "${BASH_SOURCE}")/.." && pwd -P)"
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
readonly branch=${1:-${KUBE_VERIFY_GIT_BRANCH:-master}}
|
||||
@@ -28,8 +28,10 @@ if ! [[ ${KUBE_FORCE_VERIFY_CHECKS:-} =~ ^[yY]$ ]] && \
|
||||
fi
|
||||
|
||||
# create a nice clean place to put our new godeps
|
||||
# must be in the user dir (e.g. KUBE_ROOT) in order for the docker volume mount to work with docker-machine on macs
|
||||
_tmpdir="$(mktemp -d "${KUBE_ROOT}/kube-godep-licenses.XXXXXX")"
|
||||
# must be in the user dir (e.g. KUBE_ROOT) in order for the docker volume mount
|
||||
# to work with docker-machine on macs
|
||||
mkdir -p "${KUBE_ROOT}/_tmp"
|
||||
_tmpdir="$(mktemp -d "${KUBE_ROOT}/_tmp/kube-godep-licenses.XXXXXX")"
|
||||
echo "Created workspace: ${_tmpdir}"
|
||||
function cleanup {
|
||||
echo "Removing workspace: ${_tmpdir}"
|
||||
@@ -37,11 +39,12 @@ function cleanup {
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
cp -r "${KUBE_ROOT}/LICENSE" "${_tmpdir}/"
|
||||
cp -r "${KUBE_ROOT}/Godeps" "${_tmpdir}/Godeps"
|
||||
ln -s "${KUBE_ROOT}/LICENSE" "${_tmpdir}"
|
||||
ln -s "${KUBE_ROOT}/vendor" "${_tmpdir}"
|
||||
|
||||
# Update Godep Licenses
|
||||
KUBE_ROOT="${_tmpdir}" "${KUBE_ROOT}/hack/update-godep-licenses.sh"
|
||||
LICENSE_ROOT="${_tmpdir}" "${KUBE_ROOT}/hack/update-godep-licenses.sh"
|
||||
|
||||
# Compare Godep Licenses
|
||||
if ! _out="$(diff -Naupr ${KUBE_ROOT}/Godeps/LICENSES ${_tmpdir}/Godeps/LICENSES)"; then
|
||||
|
@@ -19,7 +19,7 @@ set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
# As of go 1.6, the vendor experiment is enabled by default.
|
||||
export GO15VENDOREXPERIMENT=0
|
||||
export GO15VENDOREXPERIMENT=1
|
||||
|
||||
#### HACK ####
|
||||
# Sometimes godep just can't handle things. This lets use manually put
|
||||
@@ -48,7 +48,7 @@ if ! [[ ${KUBE_FORCE_VERIFY_CHECKS:-} =~ ^[yY]$ ]] && \
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# create a nice clean place to put our new godeps
|
||||
# Create a nice clean place to put our new godeps
|
||||
_tmpdir="$(mktemp -d -t gopath.XXXXXX)"
|
||||
function cleanup {
|
||||
echo "Removing ${_tmpdir}"
|
||||
@@ -56,39 +56,41 @@ function cleanup {
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
# build the godep tool
|
||||
export GOPATH="${_tmpdir}"
|
||||
go get -u github.com/tools/godep 2>/dev/null
|
||||
GODEP="${_tmpdir}/bin/godep"
|
||||
pushd "${GOPATH}/src/github.com/tools/godep" > /dev/null
|
||||
git checkout v53
|
||||
"${GODEP}" go install
|
||||
popd > /dev/null
|
||||
|
||||
# fill out that nice clean place with the kube godeps
|
||||
echo "Starting to download all kubernetes godeps. This takes a while"
|
||||
|
||||
"${GODEP}" restore
|
||||
echo "Download finished"
|
||||
|
||||
# copy the contents of your kube directory into the nice clean place
|
||||
# Copy the contents of the kube directory into the nice clean place
|
||||
_kubetmp="${_tmpdir}/src/k8s.io"
|
||||
mkdir -p "${_kubetmp}"
|
||||
# should create ${_kubectmp}/kubernetes
|
||||
git archive --format=tar --prefix=kubernetes/ $(git write-tree) | (cd "${_kubetmp}" && tar xf -)
|
||||
_kubetmp="${_kubetmp}/kubernetes"
|
||||
|
||||
# destroy godeps in our COPY of the kube tree
|
||||
pushd "${_kubetmp}" > /dev/null
|
||||
rm -rf ./Godeps
|
||||
# Do all our work in the new GOPATH
|
||||
export GOPATH="${_tmpdir}"
|
||||
cd "${_kubetmp}"
|
||||
|
||||
# for some reason the kube tree needs to be a git repo for the godep tool to run. Doesn't make sense
|
||||
git init > /dev/null 2>&1
|
||||
|
||||
# recreate the Godeps using the nice clean set we just downloaded
|
||||
"${GODEP}" save ./...
|
||||
# Build the godep tool
|
||||
go get -u github.com/tools/godep 2>/dev/null
|
||||
GODEP="${GOPATH}/bin/godep"
|
||||
pushd "${GOPATH}/src/github.com/tools/godep" > /dev/null
|
||||
git checkout v53
|
||||
"${GODEP}" go install
|
||||
popd > /dev/null
|
||||
|
||||
# Fill out that nice clean place with the kube godeps
|
||||
echo "Starting to download all kubernetes godeps. This takes a while"
|
||||
"${GODEP}" restore
|
||||
echo "Download finished"
|
||||
|
||||
# Destroy deps in the copy of the kube tree
|
||||
rm -rf ./Godeps ./vendor
|
||||
|
||||
# For some reason the kube tree needs to be a git repo for the godep tool to
|
||||
# run. Doesn't make sense.
|
||||
git init > /dev/null 2>&1
|
||||
|
||||
# Recreate the Godeps using the nice clean set we just downloaded
|
||||
"${GODEP}" save ./...
|
||||
|
||||
# Test for diffs
|
||||
if ! _out="$(diff -Naupr --ignore-matching-lines='^\s*\"GoVersion\":' --ignore-matching-lines='^\s*\"Comment\":' ${KUBE_ROOT}/Godeps/Godeps.json ${_kubetmp}/Godeps/Godeps.json)"; then
|
||||
echo "Your Godeps.json is different:"
|
||||
echo "${_out}"
|
||||
|
@@ -21,13 +21,9 @@ set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
GO_VERSION=($(go version))
|
||||
|
||||
if [[ -z $(echo "${GO_VERSION[2]}" | grep -E 'go1.4|go1.6') ]]; then
|
||||
echo "Unsupported go version '${GO_VERSION[2]}', skipping gofmt."
|
||||
exit 1
|
||||
fi
|
||||
kube::golang::verify_go_version
|
||||
|
||||
cd "${KUBE_ROOT}"
|
||||
|
||||
@@ -40,7 +36,7 @@ find_files() {
|
||||
-o -wholename './release' \
|
||||
-o -wholename './target' \
|
||||
-o -wholename '*/third_party/*' \
|
||||
-o -wholename '*/Godeps/*' \
|
||||
-o -wholename '*/vendor/*' \
|
||||
\) -prune \
|
||||
\) -name '*.go'
|
||||
}
|
||||
|
@@ -39,7 +39,7 @@ done
|
||||
|
||||
if [[ ${#targets[@]} -eq 0 ]]; then
|
||||
# Do not run on third_party directories.
|
||||
targets=$(go list ./... | grep -v "third_party")
|
||||
targets=$(go list ./... | egrep -v "/(third_party|vendor)/")
|
||||
fi
|
||||
|
||||
# Do this in parallel; results in 5-10x speedup.
|
||||
@@ -58,7 +58,7 @@ for i in $targets
|
||||
#
|
||||
# The intended result is that each incantation of this line returns
|
||||
# either 0 (pass) or 1 (fail).
|
||||
godep go vet "${goflags[@]:+${goflags[@]}}" "$i" 2>&1 \
|
||||
go vet "${goflags[@]:+${goflags[@]}}" "$i" 2>&1 \
|
||||
| grep -v -E "exit status|GO15VENDOREXPERIMENT=" \
|
||||
|| fail=${PIPESTATUS[0]}
|
||||
exit $fail
|
||||
|
@@ -18,8 +18,6 @@ set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
@@ -27,4 +25,4 @@ kube::golang::setup_env
|
||||
|
||||
"${KUBE_ROOT}/hack/build-go.sh" cmd/libs/go2idl/import-boss
|
||||
|
||||
"${KUBE_ROOT}/hack/after-build/run-import-boss.sh" --verify-only
|
||||
$(kube::util::find-binary "import-boss") --verify-only
|
||||
|
@@ -25,6 +25,37 @@ kube::golang::setup_env
|
||||
|
||||
"${KUBE_ROOT}/hack/build-go.sh" cmd/linkcheck
|
||||
|
||||
"${KUBE_ROOT}/hack/after-build/verify-linkcheck.sh" "$@"
|
||||
linkcheck=$(kube::util::find-binary "linkcheck")
|
||||
|
||||
kube::util::ensure-temp-dir
|
||||
OUTPUT="${KUBE_TEMP}"/linkcheck-output
|
||||
cleanup() {
|
||||
rm -rf "${OUTPUT}"
|
||||
}
|
||||
trap "cleanup" EXIT SIGINT
|
||||
mkdir -p "$OUTPUT"
|
||||
|
||||
APIROOT="${KUBE_ROOT}/pkg/api/"
|
||||
APISROOT="${KUBE_ROOT}/pkg/apis/"
|
||||
DOCROOT="${KUBE_ROOT}/docs/"
|
||||
ROOTS=($APIROOT $APISROOT $DOCROOT)
|
||||
found_invalid=false
|
||||
for root in "${ROOTS[@]}"; do
|
||||
"${linkcheck}" "--root-dir=${root}" 2> >(tee -a "${OUTPUT}/error" >&2) && ret=0 || ret=$?
|
||||
if [[ $ret -eq 1 ]]; then
|
||||
echo "Failed: found invalid links in ${root}."
|
||||
found_invalid=true
|
||||
fi
|
||||
if [[ $ret -gt 1 ]]; then
|
||||
echo "Error running linkcheck"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ${found_invalid} = true ]; then
|
||||
echo "Summary of invalid links:"
|
||||
cat ${OUTPUT}/error
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ex: ts=2 sw=2 et filetype=sh
|
||||
|
@@ -25,6 +25,27 @@ kube::golang::setup_env
|
||||
|
||||
"${KUBE_ROOT}/hack/build-go.sh" cmd/kube-apiserver
|
||||
|
||||
"${KUBE_ROOT}/hack/after-build/verify-swagger-spec.sh" "$@"
|
||||
apiserver=$(kube::util::find-binary "kube-apiserver")
|
||||
|
||||
SPECROOT="${KUBE_ROOT}/api/swagger-spec"
|
||||
TMP_SPECROOT="${KUBE_ROOT}/_tmp/swagger-spec"
|
||||
_tmp="${KUBE_ROOT}/_tmp"
|
||||
|
||||
mkdir -p "${_tmp}"
|
||||
cp -a "${SPECROOT}" "${TMP_SPECROOT}"
|
||||
|
||||
"${KUBE_ROOT}/hack/update-swagger-spec.sh"
|
||||
echo "diffing ${SPECROOT} against freshly generated swagger spec"
|
||||
ret=0
|
||||
diff -Naupr -I 'Auto generated by' "${SPECROOT}" "${TMP_SPECROOT}" || ret=$?
|
||||
cp -a ${TMP_SPECROOT} "${KUBE_ROOT}/api"
|
||||
rm -rf "${_tmp}"
|
||||
if [[ $ret -eq 0 ]]
|
||||
then
|
||||
echo "${SPECROOT} up to date."
|
||||
else
|
||||
echo "${SPECROOT} is out of date. Please run hack/update-swagger-spec.sh"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ex: ts=2 sw=2 et filetype=sh
|
||||
|
@@ -25,6 +25,25 @@ kube::golang::setup_env
|
||||
|
||||
"${KUBE_ROOT}/hack/build-go.sh" cmd/hyperkube
|
||||
|
||||
"${KUBE_ROOT}/hack/after-build/verify-symbols.sh"
|
||||
# add other BADSYMBOLS here.
|
||||
BADSYMBOLS=(
|
||||
"httptest"
|
||||
"testify"
|
||||
"testing[.]"
|
||||
)
|
||||
|
||||
# b/c hyperkube binds everything simply check that for bad symbols
|
||||
SYMBOLS="$(nm ${KUBE_OUTPUT_HOSTBIN}/hyperkube)"
|
||||
|
||||
RESULT=0
|
||||
for BADSYMBOL in "${BADSYMBOLS[@]}"; do
|
||||
if FOUND=$(echo "$SYMBOLS" | grep "$BADSYMBOL"); then
|
||||
echo "Found bad symbol '${BADSYMBOL}':"
|
||||
echo "$FOUND"
|
||||
RESULT=1
|
||||
fi
|
||||
done
|
||||
|
||||
exit $RESULT
|
||||
|
||||
# ex: ts=2 sw=2 et filetype=sh
|
||||
|
@@ -42,7 +42,7 @@ fi
|
||||
|
||||
echo -ne "Checking for files that need gofmt... "
|
||||
files_need_gofmt=()
|
||||
files=($(git diff --cached --name-only --diff-filter ACM | grep "\.go" | grep -v -e "third_party" -e "Godeps"))
|
||||
files=($(git diff --cached --name-only --diff-filter ACM | grep "\.go" | grep -v -e "^third_party" -e "^vendor"))
|
||||
for file in "${files[@]}"; do
|
||||
# Check for files that fail gofmt.
|
||||
diff="$(git show ":${file}" | gofmt -s -d 2>&1)"
|
||||
@@ -103,7 +103,7 @@ files_need_description=()
|
||||
# Check API schema definitions for field descriptions
|
||||
for file in $(git diff --cached --name-only --diff-filter ACM | egrep "pkg/api/v.[^/]*/types\.go" | grep -v "third_party"); do
|
||||
# Check for files with fields without description tags
|
||||
descriptionless=$(hack/after-build/verify-description.sh "${file}" > /dev/null; echo $?)
|
||||
descriptionless=$(hack/verify-description.sh "${file}" > /dev/null; echo $?)
|
||||
if [[ "$descriptionless" -ne "0" ]]; then
|
||||
files_need_description+=("${file}")
|
||||
fi
|
||||
@@ -123,7 +123,7 @@ fi
|
||||
echo "${reset}"
|
||||
|
||||
echo -ne "Checking for docs that need updating... "
|
||||
if ! hack/after-build/verify-generated-docs.sh > /dev/null; then
|
||||
if ! hack/verify-generated-docs.sh > /dev/null; then
|
||||
echo "${red}ERROR!"
|
||||
echo "Some docs are out of sync between CLI and markdown."
|
||||
echo "To regenerate docs, run:"
|
||||
@@ -135,7 +135,7 @@ fi
|
||||
echo "${reset}"
|
||||
|
||||
echo -ne "Checking for swagger type documentation that need updating... "
|
||||
if ! hack/after-build/verify-generated-swagger-docs.sh > /dev/null; then
|
||||
if ! hack/verify-generated-swagger-docs.sh > /dev/null; then
|
||||
echo "${red}ERROR!"
|
||||
echo "Swagger type documentation needs to be updated."
|
||||
echo "To regenerate the spec, run:"
|
||||
@@ -147,7 +147,7 @@ fi
|
||||
echo "${reset}"
|
||||
|
||||
echo -ne "Checking for swagger spec that need updating... "
|
||||
if ! hack/after-build/verify-swagger-spec.sh > /dev/null; then
|
||||
if ! hack/verify-swagger-spec.sh > /dev/null; then
|
||||
echo "${red}ERROR!"
|
||||
echo "Swagger spec needs to be updated."
|
||||
echo "To regenerate the spec, run:"
|
||||
|
@@ -1739,10 +1739,7 @@ func appendAllLabels(showLabels bool, itemLabels map[string]string) string {
|
||||
func appendLabelTabs(columnLabels []string) string {
|
||||
var buffer bytes.Buffer
|
||||
|
||||
for i := range columnLabels {
|
||||
// NB: This odd dance is to make the loop both compatible with go 1.3 and
|
||||
// pass `gofmt -s`
|
||||
_ = i
|
||||
for range columnLabels {
|
||||
buffer.WriteString("\t")
|
||||
}
|
||||
buffer.WriteString("\n")
|
||||
|
@@ -29,6 +29,7 @@ import (
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/golang/glog"
|
||||
@@ -70,7 +71,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/securitycontext"
|
||||
"k8s.io/kubernetes/pkg/types"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
"k8s.io/kubernetes/pkg/util/atomic"
|
||||
"k8s.io/kubernetes/pkg/util/bandwidth"
|
||||
utilerrors "k8s.io/kubernetes/pkg/util/errors"
|
||||
utilexec "k8s.io/kubernetes/pkg/util/exec"
|
||||
|
@@ -18,6 +18,7 @@ package pleg
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/golang/glog"
|
||||
@@ -25,7 +26,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/kubelet/metrics"
|
||||
"k8s.io/kubernetes/pkg/types"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
"k8s.io/kubernetes/pkg/util/atomic"
|
||||
"k8s.io/kubernetes/pkg/util/sets"
|
||||
"k8s.io/kubernetes/pkg/util/wait"
|
||||
)
|
||||
|
@@ -1,42 +0,0 @@
|
||||
/*
|
||||
Copyright 2015 The Kubernetes Authors All rights reserved.
|
||||
|
||||
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 atomic
|
||||
|
||||
import (
|
||||
"sync"
|
||||
)
|
||||
|
||||
// TODO(ArtfulCoder)
|
||||
// sync/atomic/Value was added in golang 1.4
|
||||
// Once support is dropped for go 1.3, this type must be deprecated in favor of sync/atomic/Value.
|
||||
// The functions are named Load/Store to match sync/atomic/Value function names.
|
||||
type Value struct {
|
||||
value interface{}
|
||||
valueMutex sync.RWMutex
|
||||
}
|
||||
|
||||
func (at *Value) Store(val interface{}) {
|
||||
at.valueMutex.Lock()
|
||||
defer at.valueMutex.Unlock()
|
||||
at.value = val
|
||||
}
|
||||
|
||||
func (at *Value) Load() interface{} {
|
||||
at.valueMutex.RLock()
|
||||
defer at.valueMutex.RUnlock()
|
||||
return at.value
|
||||
}
|
@@ -1,52 +0,0 @@
|
||||
/*
|
||||
Copyright 2014 The Kubernetes Authors All rights reserved.
|
||||
|
||||
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 atomic
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"k8s.io/kubernetes/pkg/util/wait"
|
||||
)
|
||||
|
||||
func ExpectValue(t *testing.T, atomicValue *Value, expectedValue interface{}) {
|
||||
actualValue := atomicValue.Load()
|
||||
if actualValue != expectedValue {
|
||||
t.Errorf("Expected to find %v, found %v", expectedValue, actualValue)
|
||||
}
|
||||
ch := make(chan interface{})
|
||||
go func() {
|
||||
ch <- atomicValue.Load()
|
||||
}()
|
||||
select {
|
||||
case actualValue = <-ch:
|
||||
if actualValue != expectedValue {
|
||||
t.Errorf("Expected to find %v, found %v", expectedValue, actualValue)
|
||||
return
|
||||
}
|
||||
case <-time.After(wait.ForeverTestTimeout):
|
||||
t.Error("Value could not be read")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func TestAtomicValue(t *testing.T) {
|
||||
atomicValue := &Value{}
|
||||
ExpectValue(t, atomicValue, nil)
|
||||
atomicValue.Store(10)
|
||||
ExpectValue(t, atomicValue, 10)
|
||||
}
|
@@ -22,8 +22,7 @@ import (
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
//IoUtil is a util for common IO operations
|
||||
//it also backports certain operations from golang 1.5
|
||||
// IoUtil is a mockable util for common IO operations
|
||||
type IoUtil interface {
|
||||
ReadDir(dirname string) ([]os.FileInfo, error)
|
||||
Lstat(name string) (os.FileInfo, error)
|
||||
|
@@ -34,7 +34,7 @@ if [ "$INSTALL_GODEP" = true ] ; then
|
||||
go get -u github.com/onsi/gomega
|
||||
fi
|
||||
|
||||
godep go build test/e2e_node/environment/conformance.go
|
||||
godep go run test/e2e_node/runner/run_e2e.go --logtostderr --vmodule=*=2 --ssh-env="gce" \
|
||||
go build test/e2e_node/environment/conformance.go
|
||||
go run test/e2e_node/runner/run_e2e.go --logtostderr --vmodule=*=2 --ssh-env="gce" \
|
||||
--zone="$GCE_ZONE" --project="$GCE_PROJECT" \
|
||||
--hosts="$GCE_HOSTS" --images="$GCE_IMAGES" --cleanup="$CLEANUP"
|
||||
|
@@ -15,9 +15,9 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
// To run the e2e tests against one or more hosts on gce:
|
||||
// $ godep go run run_e2e.go --logtostderr --v 2 --ssh-env gce --hosts <comma separated hosts>
|
||||
// $ go run run_e2e.go --logtostderr --v 2 --ssh-env gce --hosts <comma separated hosts>
|
||||
// To run the e2e tests against one or more images on gce and provision them:
|
||||
// $ godep go run run_e2e.go --logtostderr --v 2 --project <project> --zone <zone> --ssh-env gce --images <comma separated images>
|
||||
// $ go run run_e2e.go --logtostderr --v 2 --project <project> --zone <zone> --ssh-env gce --images <comma separated images>
|
||||
package main
|
||||
|
||||
import (
|
||||
|
@@ -19,7 +19,7 @@ TAG = 1.0
|
||||
PREFIX = gcr.io/google_containers/clusterapi-tester
|
||||
|
||||
main: main.go
|
||||
CGO_ENABLED=0 GOOS=linux godep go build -a -installsuffix cgo -ldflags '-w' -o main ./main.go
|
||||
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' -o main ./main.go
|
||||
|
||||
container: main
|
||||
docker build -t $(PREFIX):$(TAG) .
|
||||
|
@@ -19,7 +19,7 @@ TAG = 0.0
|
||||
PREFIX = gcr.io/google_containers/n-way-http
|
||||
|
||||
server: server.go
|
||||
CGO_ENABLED=0 GOOS=linux godep go build -a -installsuffix cgo -ldflags '-w' -o server ./server.go
|
||||
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' -o server ./server.go
|
||||
|
||||
container: server
|
||||
docker build -t $(PREFIX):$(TAG) .
|
||||
|
@@ -18,7 +18,7 @@ PREFIX = gcr.io/google_containers
|
||||
all: push
|
||||
|
||||
webserver: webserver.go
|
||||
CGO_ENABLED=0 GOOS=linux godep go build -a -installsuffix cgo -ldflags '-w' ./webserver.go
|
||||
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' ./webserver.go
|
||||
|
||||
container: image
|
||||
|
||||
|
@@ -18,8 +18,8 @@ PREFIX = gcr.io/google_containers
|
||||
all: clean consumer
|
||||
|
||||
consumer:
|
||||
CGO_ENABLED=0 godep go build -a -installsuffix cgo --ldflags '-w' -o consume-cpu/consume-cpu ./consume-cpu/consume_cpu.go
|
||||
CGO_ENABLED=0 godep go build -a -installsuffix cgo --ldflags '-w' -o consumer .
|
||||
CGO_ENABLED=0 go build -a -installsuffix cgo --ldflags '-w' -o consume-cpu/consume-cpu ./consume-cpu/consume_cpu.go
|
||||
CGO_ENABLED=0 go build -a -installsuffix cgo --ldflags '-w' -o consumer .
|
||||
|
||||
container: image
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user