Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api: OpenAPI support #577

Merged
merged 6 commits into from
May 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ script:
# For now though we just run all tests in pkg.
# And we can not use ** because goveralls uses filepath.Match
# to match ignore files and it does not support it.
- goveralls -service=travis-ci -v -package ./pkg/... -ignore "pkg/client/*/*.go,pkg/client/*/*/*.go,pkg/client/*/*/*/*.go,pkg/client/*/*/*/*/*.go,pkg/client/*/*/*/*/*/*.go,pkg/client/*/*/*/*/*/*/*.go,pkg/apis/tensorflow/*/zz_generated.*.go"
- goveralls -service=travis-ci -v -package ./pkg/... -ignore "pkg/client/*/*.go,pkg/client/*/*/*.go,pkg/client/*/*/*/*.go,pkg/client/*/*/*/*/*.go,pkg/client/*/*/*/*/*/*.go,pkg/client/*/*/*/*/*/*/*.go,pkg/apis/tensorflow/*/zz_generated.*.go,pkg/apis/tensorflow/*/*_generated.go"

notifications:
webhooks: https://www.travisbuddy.com/
Expand Down
10 changes: 5 additions & 5 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ required = [
"k8s.io/code-generator/cmd/lister-gen",
"k8s.io/code-generator/cmd/deepcopy-gen",
"k8s.io/code-generator/cmd/defaulter-gen",
"k8s.io/code-generator/cmd/openapi-gen",

# needed by generated clientsets, but not an explicit dep in client-gen itself
"k8s.io/apimachinery/pkg/apimachinery/registered",
Expand All @@ -19,17 +20,21 @@ required = [
name = "k8s.io/client-go"
version = "~6.0.0"

[[constraint]]
name = "k8s.io/kube-openapi"
branch = "release-1.9"

[[constraint]]
name = "k8s.io/kubernetes"
version = "~v1.9.0"

[[constraint]]
branch = "release-1.9"
name = "k8s.io/api"
branch = "release-1.9"

[[constraint]]
branch = "release-1.9"
name = "k8s.io/apimachinery"
branch = "release-1.9"

[[constraint]]
name = "k8s.io/code-generator"
Expand Down
4 changes: 4 additions & 0 deletions hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ ${GOPATH}/bin/defaulter-gen --input-dirs github.com/kubeflow/tf-operator/pkg/ap
echo "Generating defaulters for v1alpha2"
${GOPATH}/bin/defaulter-gen --input-dirs github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1alpha2 -O zz_generated.defaults --go-header-file hack/boilerplate/boilerplate.go.txt "$@"
cd - > /dev/null

echo "Generating OpenAPI specification for v1alpha2"
${GOPATH}/bin/openapi-gen --input-dirs github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1alpha2,k8s.io/api/core/v1 --output-package github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1alpha2 --go-header-file hack/boilerplate/boilerplate.go.txt "$@"
cd - > /dev/null
1 change: 1 addition & 0 deletions linter_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"pkg/apis/tensorflow/validation/validation_test.go",
"pkg/apis/tensorflow/v1alpha2/zz_generated.deepcopy.go",
"pkg/apis/tensorflow/v1alpha2/zz_generated.defaults.go",
"pkg/apis/tensorflow/v1alpha2/openapi_generated.go",
"pkg/controller.v2/controller_utils.go"
],
"Deadline": "300s",
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/tensorflow/v1alpha2/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

// +k8s:deepcopy-gen=package,register
// +k8s:defaulter-gen=TypeMeta
// +k8s:openapi-gen=true

// Package v1alpha2 is the v1alpha2 version of the API.
// +groupName=kubeflow.org
Expand Down
Loading