Skip to content

Commit

Permalink
Removed third party.
Browse files Browse the repository at this point in the history
  • Loading branch information
vr4manta committed Feb 16, 2024
1 parent 18cdfab commit ed7cc85
Show file tree
Hide file tree
Showing 498 changed files with 26 additions and 270,928 deletions.
53 changes: 1 addition & 52 deletions Makefile
Expand Up @@ -21,29 +21,9 @@ endif
#
# Directories.
#
CLUSTER_API_DIR := third_party/cluster-api
EXP_DIR := ${CLUSTER_API_DIR}/exp
TOOLS_DIR=$(abspath ./tools)
BIN_DIR=bin
TOOLS_BIN_DIR := $(TOOLS_DIR)/$(BIN_DIR)
GO_INSTALL := ./scripts/go_install.sh

# Helper function to get dependency version from go.mod
get_go_version = $(shell go list -m $1 | awk '{print $$2}')

#
# Binaries.
#
# Note: Need to use abspath so we can invoke these from subdirectories
CONTROLLER_GEN_VER := v0.12.0
CONTROLLER_GEN_BIN := controller-gen
CONTROLLER_GEN := $(abspath $(TOOLS_BIN_DIR)/$(CONTROLLER_GEN_BIN)-$(CONTROLLER_GEN_VER))
CONTROLLER_GEN_PKG := sigs.k8s.io/controller-tools/cmd/controller-gen

YQ_VER := v4.35.2
YQ_BIN := yq
YQ := $(abspath $(TOOLS_BIN_DIR)/$(YQ_BIN)-$(YQ_VER))
YQ_PKG := github.com/mikefarah/yq/v4

.PHONY: all
all: check build test
Expand Down Expand Up @@ -100,7 +80,7 @@ machine-healthcheck:
$(DOCKER_CMD) ./hack/go-build.sh machine-healthcheck

.PHONY: vsphere
vsphere: generate-third-party-deepcopy
vsphere:
$(DOCKER_CMD) ./hack/go-build.sh vsphere

.PHONY: machineset
Expand Down Expand Up @@ -155,15 +135,6 @@ goimports: ## Go fmt your code
vet: ## Apply go vet to all go files
$(DOCKER_CMD) hack/go-vet.sh ./pkg/... ./cmd/...

.PHONY: generate-third-party-deepcopy
generate-third-party-deepcopy: $(CONTROLLER_GEN)
$(MAKE) clean-generated-yaml SRC_DIRS="${CLUSTER_API_DIR}/crd"
$(CONTROLLER_GEN) object paths="./third_party/cluster-api/..."
$(CONTROLLER_GEN) \
paths=./$(CLUSTER_API_DIR)/... \
crd:crdVersions=v1 \
output:crd:dir=./${CLUSTER_API_DIR}/crd

.PHONY: crds-sync
crds-sync: ## Sync crds in install with the ones in the vendored oc/api
$(DOCKER_CMD) hack/crds-sync.sh .
Expand Down Expand Up @@ -191,28 +162,6 @@ clean-bin: ## Remove all generated binaries
rm -rf $(BIN_DIR)
rm -rf $(TOOLS_BIN_DIR)

.PHONY: clean-generated-yaml
clean-generated-yaml: ## Remove files generated by conversion-gen from the mentioned dirs. Example SRC_DIRS="./api/v1alpha4"
(IFS=','; for i in $(SRC_DIRS); do find $$i -type f -name '*.yaml' -exec rm -f {} \;; done)

## --------------------------------------
## Hack / Tools
## --------------------------------------

##@ hack/tools:

.PHONY: $(CONTROLLER_GEN_BIN)
$(CONTROLLER_GEN_BIN): $(CONTROLLER_GEN) ## Build a local copy of controller-gen.

.PHONY: $(YQ_BIN)
$(YQ_BIN): $(YQ) ## Build a local copy of yq

$(CONTROLLER_GEN): # Build controller-gen from tools folder.
GOBIN=$(TOOLS_BIN_DIR) GOFLAGS= $(GO_INSTALL) $(CONTROLLER_GEN_PKG) $(CONTROLLER_GEN_BIN) $(CONTROLLER_GEN_VER)

$(YQ):
GOBIN=$(TOOLS_BIN_DIR) GOFLAGS= $(GO_INSTALL) $(YQ_PKG) $(YQ_BIN) ${YQ_VER}

define ensure-home
@ export HOME=$${HOME:=/tmp/kubebuilder-testing}; \
if [ $${HOME} == "/" ]; then \
Expand Down
2 changes: 1 addition & 1 deletion cmd/vsphere/main.go
Expand Up @@ -20,10 +20,10 @@ import (
"github.com/openshift/machine-api-operator/pkg/metrics"
"github.com/openshift/machine-api-operator/pkg/util"
"github.com/openshift/machine-api-operator/pkg/version"
ipamv1beta1 "github.com/openshift/machine-api-operator/third_party/cluster-api/exp/ipam/api/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/klog/v2"
"k8s.io/klog/v2/textlogger"
ipamv1beta1 "sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/client/config"
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Expand Up @@ -27,6 +27,7 @@ require (
k8s.io/klog/v2 v2.110.1
k8s.io/kubectl v0.29.0
k8s.io/utils v0.0.0-20240102154912-e7106e64919e
sigs.k8s.io/cluster-api v1.6.1
sigs.k8s.io/controller-runtime v0.17.0
sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20240116121732-6747c42ce339
sigs.k8s.io/yaml v1.4.0
Expand All @@ -35,7 +36,6 @@ require (
require (
github.com/golangci/golangci-lint v1.52.2
golang.org/x/time v0.3.0
sigs.k8s.io/cluster-api v1.6.1
sigs.k8s.io/kube-storage-version-migrator v0.0.6-0.20230721195810-5c8923c5ff96
)

Expand Down Expand Up @@ -99,7 +99,6 @@ require (
github.com/go-toolsmith/strparse v1.1.0 // indirect
github.com/go-toolsmith/typep v1.1.0 // indirect
github.com/go-xmlfmt/xmlfmt v1.1.2 // indirect
github.com/gobuffalo/flect v1.0.2 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/gofrs/flock v0.8.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Expand Up @@ -208,8 +208,6 @@ github.com/go-toolsmith/typep v1.1.0 h1:fIRYDyF+JywLfqzyhdiHzRop/GQDxxNhLGQ6gFUN
github.com/go-toolsmith/typep v1.1.0/go.mod h1:fVIw+7zjdsMxDA3ITWnH1yOiw1rnTQKCsF/sk2H/qig=
github.com/go-xmlfmt/xmlfmt v1.1.2 h1:Nea7b4icn8s57fTx1M5AI4qQT5HEM3rVUO8MuE6g80U=
github.com/go-xmlfmt/xmlfmt v1.1.2/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM=
github.com/gobuffalo/flect v1.0.2 h1:eqjPGSo2WmjgY2XlpGwo2NXgL3RucAKo4k4qQMNA5sA=
github.com/gobuffalo/flect v1.0.2/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs=
github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw=
Expand Down
15 changes: 1 addition & 14 deletions hack/crds-sync.sh
Expand Up @@ -2,26 +2,13 @@

set -euo pipefail

REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/..

YQ_BIN=yq
YQ_PATH=tools/bin/${YQ_BIN}

cd "${REPO_ROOT}" && make ${YQ_BIN} >/dev/null

# map names of CRD files between the vendored openshift/api repository and the ./install directory
CRDS_MAPPING=( "vendor/github.com/openshift/api/machine/v1beta1/0000_10_machine.crd.yaml:0000_30_machine-api-operator_02_machine.crd.yaml"
"vendor/github.com/openshift/api/machine/v1beta1/0000_10_machineset.crd.yaml:0000_30_machine-api-operator_03_machineset.crd.yaml"
"vendor/github.com/openshift/api/machine/v1beta1/0000_10_machinehealthcheck.yaml:0000_30_machine-api-operator_07_machinehealthcheck.crd.yaml"
"third_party/cluster-api/crd/ipam.cluster.x-k8s.io_ipaddressclaims.yaml:0000_30_machine-api-operator_03_ipaddressclaims.crd.yaml"
"third_party/cluster-api/crd/ipam.cluster.x-k8s.io_ipaddresses.yaml:0000_30_machine-api-operator_03_ipaddresses.crd.yaml")
"vendor/github.com/openshift/api/machine/v1beta1/0000_10_machinehealthcheck.yaml:0000_30_machine-api-operator_07_machinehealthcheck.crd.yaml")

for crd in "${CRDS_MAPPING[@]}" ; do
SRC="${crd%%:*}"
DES="${crd##*:}"
cp "$SRC" "install/$DES"
# Inject needed annotation if not found
${YQ_PATH} -i -N '.metadata.annotations."exclude.release.openshift.io/internal-openshift-hosted" |= "true"' "install/$DES"
${YQ_PATH} -i -N '.metadata.annotations."include.release.openshift.io/self-managed-high-availability" |= "true"' "install/$DES"
${YQ_PATH} -i -N '.metadata.annotations."include.release.openshift.io/single-node-developer" |= "true"' "install/$DES"
done
212 changes: 0 additions & 212 deletions install/0000_30_machine-api-operator_03_ipaddressclaims.crd.yaml

This file was deleted.

0 comments on commit ed7cc85

Please sign in to comment.