Skip to content
29 changes: 24 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ GIT_BRANCH:=$(shell git symbolic-ref --short HEAD 2>&1 | grep -v fatal)
#define the GO_BUILD_ARGS if you need to pass additional arguments to the go build
GO_BUILD_ARGS?=

## Location to install dependencies to
LOCALBIN ?= $(shell pwd)/bin
$(LOCALBIN):
mkdir -p $(LOCALBIN)

## Tool Versions
CONTROLLER_TOOLS_VERSION ?= v0.9.2

## Tool Binaries
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen

# Reset branch name if this a Travis CI environment
ifneq ($(strip $(TRAVIS_BRANCH)),)
GIT_BRANCH:=${TRAVIS_BRANCH}
Expand Down Expand Up @@ -35,7 +46,7 @@ endif

.PHONY: print-global-variables

# Build the controler executable for use in docker image build
# Build the controller executable for use in docker image build
mcad-controller: init generate-code
ifeq ($(strip $(GO_BUILD_ARGS)),)
$(info Compiling controller)
Expand Down Expand Up @@ -67,6 +78,15 @@ verify-tag-name: print-global-variables
# Check for invalid tag name
t=${TAG} && [ $${#t} -le 128 ] || { echo "Target name $$t has 128 or more chars"; false; }

.PHONY: controller-gen
controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary.
$(CONTROLLER_GEN): $(LOCALBIN)
test -s $(LOCALBIN)/controller-gen || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION)

.PHONY: manifests
manifests: controller-gen ## Generate CustomResourceDefinition objects.
$(CONTROLLER_GEN) crd:allowDangerousTypes=true paths="./pkg/apis/..." output:crd:artifacts:config=config/crd/bases

generate-code: pkg/apis/controller/v1beta1/zz_generated.deepcopy.go

pkg/apis/controller/v1beta1/zz_generated.deepcopy.go: ${BIN_DIR}/deepcopy-gen
Expand Down Expand Up @@ -141,18 +161,17 @@ clean:
#CRD file maintenance rules
DEPLOYMENT_CRD_DIR=deployment/mcad-controller/crds
CRD_BASE_DIR=config/crd/bases
MCAD_CRDS= ${DEPLOYMENT_CRD_DIR}/ibm.com_quotasubtree-v1.yaml \
MCAD_CRDS= ${DEPLOYMENT_CRD_DIR}/ibm.com_quotasubtrees.yaml \
${DEPLOYMENT_CRD_DIR}/mcad.ibm.com_appwrappers.yaml \
${DEPLOYMENT_CRD_DIR}/mcad.ibm.com_queuejobs.yaml \
${DEPLOYMENT_CRD_DIR}/mcad.ibm.com_schedulingspecs.yaml

update-deployment-crds: ${MCAD_CRDS}

${DEPLOYMENT_CRD_DIR}/mcad.ibm.com_schedulingspecs.yaml : ${CRD_BASE_DIR}/mcad.ibm.com_schedulingspecs.yaml
${DEPLOYMENT_CRD_DIR}/ibm.com_quotasubtrees.yaml : ${CRD_BASE_DIR}/ibm.com_quotasubtrees.yaml
${DEPLOYMENT_CRD_DIR}/mcad.ibm.com_appwrappers.yaml : ${CRD_BASE_DIR}/mcad.ibm.com_appwrappers.yaml
${DEPLOYMENT_CRD_DIR}/mcad.ibm.com_queuejobs.yaml : ${CRD_BASE_DIR}/mcad.ibm.com_queuejobs.yaml
${DEPLOYMENT_CRD_DIR}/mcad.ibm.com_schedulingspecs.yaml : ${CRD_BASE_DIR}/mcad.ibm.com_schedulingspecs.yaml


$(DEPLOYMENT_CRD_DIR)/%: ${CRD_BASE_DIR}/%
cp $< $@
cp $< $@
62 changes: 0 additions & 62 deletions config/crd/bases/ibm.com_quotasubtree-v1.yaml

This file was deleted.

122 changes: 122 additions & 0 deletions config/crd/bases/ibm.com_quotasubtrees.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: quotasubtrees.ibm.com
spec:
group: ibm.com
names:
kind: QuotaSubtree
listKind: QuotaSubtreeList
plural: quotasubtrees
singular: quotasubtree
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
description: QuotaSubtree is a specification for a quota subtree resource
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: QuotaSubtreeSpec is the spec for a resource plan
properties:
children:
items:
description: Child is the spec for a QuotaSubtree resource
properties:
name:
type: string
namespace:
type: string
path:
type: string
quotas:
description: Quota is the spec for a QuotaSubtree resource
properties:
disabled:
type: boolean
hardLimit:
type: boolean
requests:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
type: object
type: object
type: array
parent:
type: string
parentNamespace:
type: string
type: object
status:
description: QuotaSubtreeStatus is the status for a QuotaSubtree resource
properties:
children:
items:
description: ResourceAllocation is the spec for the child status
properties:
allocated:
description: ResourceAllocationStatus is the spec for the child
resource usage
properties:
requests:
additionalProperties:
type: string
type: object
type: object
name:
type: string
namespace:
type: string
path:
type: string
type: object
type: array
totalAllocation:
description: ResourceAllocation is the spec for the child status
properties:
allocated:
description: ResourceAllocationStatus is the spec for the child
resource usage
properties:
requests:
additionalProperties:
type: string
type: object
type: object
name:
type: string
namespace:
type: string
path:
type: string
type: object
required:
- children
- totalAllocation
type: object
required:
- spec
type: object
served: true
storage: true
Loading