forked from stolostron/multicloud-operators-foundation
-
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.
- Loading branch information
Showing
5 changed files
with
171 additions
and
0 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,64 @@ | ||
#!/bin/bash | ||
|
||
# licensed Materials - Property of IBM | ||
# 5737-E67 | ||
# (C) Copyright IBM Corporation 2016, 2019 All Rights Reserved | ||
# US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. | ||
# | ||
# 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 | ||
|
||
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,50 @@ | ||
#!/bin/bash | ||
|
||
# licensed Materials - Property of IBM | ||
# 5737-E67 | ||
# (C) Copyright IBM Corporation 2016, 2019 All Rights Reserved | ||
# US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. | ||
# | ||
# 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 | ||
|
||
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}"/third_party/protobuf \ | ||
--proto-import="${REPO_ROOT}"/vendor \ | ||
--packages="${SC_PKG}/pkg/proxyserver/apis/v1beta1" |