Skip to content

Commit

Permalink
UPSTREAM: <carry>: add OCP manifests generation tool and target
Browse files Browse the repository at this point in the history
  • Loading branch information
damdo committed Nov 23, 2023
1 parent 689b4ff commit f4b9d4a
Show file tree
Hide file tree
Showing 4,322 changed files with 1,442,550 additions and 163 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Makefile
# We need the following yaml files while building clusterctl in the container
!cmd/clusterctl/config/manifest/clusterctl-api.yaml
!cmd/clusterctl/client/cluster/assets/cert-manager-test-resources.yaml
!openshift/manifests/*.yaml

# ignores changes to test-only code to avoid extra rebuilds
test/e2e/**
Expand Down
1 change: 1 addition & 0 deletions openshift/Dockerfile.openshift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ FROM registry.ci.openshift.org/ocp/4.15:base
LABEL description="Cluster API Controller Manager"

COPY --from=builder /build/cluster-api-controller-manager /bin/cluster-api-controller-manager
COPY --from=builder /build/openshift/manifests /manifests

ENTRYPOINT [ "/bin/cluster-api-controller-manager" ]

Expand Down
22 changes: 16 additions & 6 deletions openshift/Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
BIN_DIR := bin
TOOLS_DIR := hack/tools
TOOLS_BIN_DIR := $(TOOLS_DIR)/$(BIN_DIR)
KUSTOMIZE := ../$(TOOLS_BIN_DIR)/kustomize
TOOLS_DIR := tools

$(RELEASE_DIR):
mkdir -p $(RELEASE_DIR)/

$(KUSTOMIZE): # Download kustomize using hack script into tools folder.
../hack/ensure-kustomize.sh
KUSTOMIZE := tools/bin/kustomize
MANIFESTS_GEN := go run ./vendor/github.com/openshift/cluster-capi-operator/manifests-gen/

$(KUSTOMIZE):
./tools/ensure-kustomize.sh

.PHONY: check-env
check-env:
ifndef PROVIDER_VERSION
$(error PROVIDER_VERSION is undefined)
endif

.PHONY: ocp-manifests
ocp-manifests: $(RELEASE_DIR) $(KUSTOMIZE) ## Builds openshift specific manifests
ocp-manifests: $(RELEASE_DIR) $(KUSTOMIZE) check-env ## Builds openshift specific manifests
# Build core-components.
$(KUSTOMIZE) build ../config/default > core-components.yaml
# Generate provider manifests.
# TODO: load the provider-version dynamically at rebase time when this is invoked by the Rebase Bot during one of its lifecycle hooks.
cd tools && $(MANIFESTS_GEN) --provider-name "cluster-api" --provider-type "CoreProvider" --provider-version "${PROVIDER_VERSION}" --base-path "../../" --manifests-path "../manifests"
1,397 changes: 1,240 additions & 157 deletions openshift/core-components.yaml

Large diffs are not rendered by default.

11,753 changes: 11,753 additions & 0 deletions openshift/manifests/0000_30_cluster-api_04_cm.core-cluster-api.yaml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions openshift/tools/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bin
bin/*
54 changes: 54 additions & 0 deletions openshift/tools/ensure-kustomize.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/usr/bin/env bash

# Copyright 2019 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.

set -o errexit
set -o nounset
set -o pipefail

ROOT=$(dirname "$0")
BIN_ROOT="${ROOT}/bin"

kustomize_version=3.9.1

goarch=amd64
goos="unknown"
if [[ "${OSTYPE}" == "linux"* ]]; then
goos="linux"
elif [[ "${OSTYPE}" == "darwin"* ]]; then
goos="darwin"
fi

if [[ "$goos" == "unknown" ]]; then
echo "OS '$OSTYPE' not supported. Aborting." >&2
exit 1
fi

# Ensure the kustomize tool exists and is a viable version, or installs it
verify_kustomize_version() {
if ! [ -x "$(command -v "${BIN_ROOT}/kustomize")" ]; then
echo "fetching kustomize@${kustomize_version}"
if ! [ -d "${BIN_ROOT}" ]; then
mkdir -p "${BIN_ROOT}"
fi
archive_name="kustomize-v${kustomize_version}.tar.gz"
curl -sLo "${BIN_ROOT}/${archive_name}" https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv${kustomize_version}/kustomize_v${kustomize_version}_${goos}_${goarch}.tar.gz
tar -zvxf "${BIN_ROOT}/${archive_name}" -C "${BIN_ROOT}/"
chmod +x "${BIN_ROOT}/kustomize"
rm "${BIN_ROOT}/${archive_name}"
fi
}

verify_kustomize_version
98 changes: 98 additions & 0 deletions openshift/tools/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
module tools

go 1.18

replace github.com/openshift/cluster-capi-operator/manifests-gen => github.com/openshift-cloud-team/cluster-capi-operator/manifests-gen v0.0.0-20230919120444-eb51396602e7

require github.com/openshift/cluster-capi-operator/manifests-gen v0.0.0-00010101000000-000000000000

require (
github.com/MakeNowJust/heredoc v1.0.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/coredns/caddy v1.1.1 // indirect
github.com/coredns/corefile-migration v1.0.20 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect
github.com/drone/envsubst/v2 v2.0.0-20210730161058-179042472c46 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-errors/errors v1.0.1 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/gobuffalo/flect v1.0.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic v0.6.9 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/go-github/v48 v48.2.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/jetstack/cert-manager v1.5.5 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/spf13/afero v1.9.3 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.15.0 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/xlab/treeprint v1.1.0 // indirect
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
golang.org/x/crypto v0.3.0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/oauth2 v0.6.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/term v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/time v0.3.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/api v0.26.5 // indirect
k8s.io/apiextensions-apiserver v0.26.5 // indirect
k8s.io/apimachinery v0.26.5 // indirect
k8s.io/client-go v0.26.5 // indirect
k8s.io/cluster-bootstrap v0.25.3 // indirect
k8s.io/component-base v0.26.5 // indirect
k8s.io/klog/v2 v2.80.1 // indirect
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
sigs.k8s.io/cluster-api v1.4.2 // indirect
sigs.k8s.io/controller-runtime v0.14.6 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/kustomize/api v0.12.1 // indirect
sigs.k8s.io/kustomize/kyaml v0.13.9 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

0 comments on commit f4b9d4a

Please sign in to comment.