-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #217 from ldpliu/add-hack-dir
add hack dir
- Loading branch information
Showing
7 changed files
with
923 additions
and
42 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
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 @@ | ||
// Copyright (c) 2020 Red Hat, Inc. |
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,48 @@ | ||
#!/bin/bash | ||
|
||
# Copyright (c) 2020 Red Hat, Inc. | ||
|
||
|
||
# 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 | ||
|
||
realpath() { | ||
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}" | ||
} | ||
|
||
REPO_ROOT=$(realpath "$(dirname "${BASH_SOURCE[0]}")"/..) | ||
BINDIR="${REPO_ROOT}"/_output | ||
SC_PKG='github.com/open-cluster-management/multicloud-operators-foundation' | ||
|
||
# Generate defaults | ||
"${BINDIR}"/defaulter-gen "$@" \ | ||
--v 1 --logtostderr \ | ||
--go-header-file "${REPO_ROOT}"/hack/custom-boilerplate.go.txt \ | ||
--input-dirs "${SC_PKG}/pkg/proxyserver/apis/v1beta1" \ | ||
--extra-peer-dirs "${SC_PKG}/pkg/proxyserver/apis/v1beta1" \ | ||
--output-file-base "zz_generated.defaults" | ||
# Generate deep copies | ||
"${BINDIR}"/deepcopy-gen "$@" \ | ||
--v 1 --logtostderr\ | ||
--go-header-file "${REPO_ROOT}"/hack/custom-boilerplate.go.txt \ | ||
--input-dirs "${SC_PKG}/pkg/proxyserver/apis/v1beta1" \ | ||
--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 "${REPO_ROOT}"/hack/custom-boilerplate.go.txt \ | ||
--input-dirs "${SC_PKG}/pkg/proxyserver/apis/v1beta1" \ | ||
--output-file-base zz_generated.conversion | ||
|
||
# generate openapi for servicecatalog and settings group | ||
"${BINDIR}"/openapi-gen "$@" \ | ||
--v 1 --logtostderr \ | ||
--go-header-file "${REPO_ROOT}"/hack/custom-boilerplate.go.txt \ | ||
--input-dirs "${SC_PKG}/pkg/proxyserver/apis/v1beta1,k8s.io/apimachinery/pkg/apis/meta/v1" \ | ||
--output-package "${SC_PKG}/pkg/proxyserver/apis/openapi" \ | ||
--report-filename ".api_violation.report" |
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,34 @@ | ||
#!/bin/bash | ||
|
||
# Copyright (c) 2020 Red Hat, Inc. | ||
|
||
|
||
# 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 | ||
|
||
realpath() { | ||
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}" | ||
} | ||
|
||
REPO_ROOT=$(realpath "$(dirname "${BASH_SOURCE[0]}")"/..) | ||
BINDIR="${REPO_ROOT}"/_output | ||
SC_PKG='github.com/open-cluster-management/multicloud-operators-foundation' | ||
|
||
if [[ "$(protoc --version)" != "libprotoc 3.0."* ]]; then | ||
echo "Generating protobuf requires protoc 3.0.x. Please download and | ||
install the platform appropriate Protobuf package for your OS: | ||
https://github.com/google/protobuf/releases" | ||
exit 1 | ||
fi | ||
|
||
PATH="$PATH:$BINDIR" go-to-protobuf \ | ||
--output-base="${GOPATH}/src" \ | ||
--apimachinery-packages='-k8s.io/apimachinery/pkg/util/intstr,-k8s.io/apimachinery/pkg/api/resource,-k8s.io/apimachinery/pkg/runtime/schema,-k8s.io/apimachinery/pkg/runtime,-k8s.io/apimachinery/pkg/apis/meta/v1,-k8s.io/apimachinery/pkg/apis/meta/v1beta1,-k8s.io/api/core/v1,-k8s.io/api/rbac/v1,-k8s.io/api/certificates/v1beta1' \ | ||
--go-header-file="${REPO_ROOT}"/hack/custom-boilerplate.go.txt \ | ||
--proto-import="${REPO_ROOT}"/vendor \ | ||
--proto-import="${REPO_ROOT}"/third_party/protobuf \ | ||
--packages="${SC_PKG}/pkg/proxyserver/apis/v1beta1" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.