forked from kubernetes-retired/service-catalog
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move apiserver generation to script and verify (kubernetes-retired#1662)
- Loading branch information
1 parent
385f0da
commit 93319f6
Showing
2 changed files
with
65 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2018 The Kubernetes Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# The only argument this script should ever be called with is '--verify-only' | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
set -o xtrace | ||
|
||
REPO_ROOT=$(realpath $(dirname "${BASH_SOURCE}")/..) | ||
BINDIR=${REPO_ROOT}/bin | ||
SC_PKG='github.com/kubernetes-incubator/service-catalog' | ||
|
||
# Generate defaults | ||
${BINDIR}/defaulter-gen "$@" \ | ||
--v 1 --logtostderr \ | ||
--go-header-file "vendor/github.com/kubernetes/repo-infra/verify/boilerplate/boilerplate.go.txt" \ | ||
--input-dirs "${SC_PKG}/pkg/apis/servicecatalog" \ | ||
--input-dirs "${SC_PKG}/pkg/apis/servicecatalog/v1beta1" \ | ||
--extra-peer-dirs "${SC_PKG}/pkg/apis/servicecatalog" \ | ||
--extra-peer-dirs "${SC_PKG}/pkg/apis/servicecatalog/v1beta1" \ | ||
--output-file-base "zz_generated.defaults" | ||
# Generate deep copies | ||
${BINDIR}/deepcopy-gen "$@" \ | ||
--v 1 --logtostderr \ | ||
--go-header-file "vendor/github.com/kubernetes/repo-infra/verify/boilerplate/boilerplate.go.txt" \ | ||
--input-dirs "${SC_PKG}/pkg/apis/servicecatalog" \ | ||
--input-dirs "${SC_PKG}/pkg/apis/servicecatalog/v1beta1" \ | ||
--bounding-dirs "github.com/kubernetes-incubator/service-catalog" \ | ||
--output-file-base zz_generated.deepcopy | ||
# Generate conversions | ||
${BINDIR}/conversion-gen "$@" \ | ||
--v 1 --logtostderr \ | ||
--extra-peer-dirs k8s.io/api/core/v1,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/conversion,k8s.io/apimachinery/pkg/runtime \ | ||
--go-header-file "vendor/github.com/kubernetes/repo-infra/verify/boilerplate/boilerplate.go.txt" \ | ||
--input-dirs "${SC_PKG}/pkg/apis/servicecatalog" \ | ||
--input-dirs "${SC_PKG}/pkg/apis/servicecatalog/v1beta1" \ | ||
--output-file-base zz_generated.conversion | ||
# generate openapi | ||
${BINDIR}/openapi-gen "$@" \ | ||
--v 1 --logtostderr \ | ||
--go-header-file "vendor/github.com/kubernetes/repo-infra/verify/boilerplate/boilerplate.go.txt" \ | ||
--input-dirs "${SC_PKG}/pkg/apis/servicecatalog/v1beta1,k8s.io/api/core/v1,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/version,k8s.io/apimachinery/pkg/runtime" \ | ||
--output-package "${SC_PKG}/pkg/openapi" |