Skip to content

Error handling updates in quota management usage #367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
May 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,8 @@ kubernetes.tar.gz

# .devcontainer files
.devcontainer

#local debug files
cmd/kar-controllers/__debug_bin
apiserver.local.config
kubeconfig
cover.out
27 changes: 23 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ ${BIN_DIR}/deepcopy-gen:
$(info Compiling deepcopy-gen...)
go build -o ${BIN_DIR}/deepcopy-gen ./cmd/deepcopy-gen/

images: verify-tag-name generate-code
images: verify-tag-name generate-code update-deployment-crds
$(info List executable directory)
$(info repo id: ${git_repository_id})
$(info branch: ${GIT_BRANCH})
Expand All @@ -83,7 +83,7 @@ else
docker build --no-cache --tag mcad-controller:${TAG} --build-arg GO_BUILD_ARGS=$(GO_BUILD_ARGS) -f ${CURRENT_DIR}/Dockerfile ${CURRENT_DIR}
endif

images-podman: verify-tag-name generate-code
images-podman: verify-tag-name generate-code update-deployment-crds
$(info List executable directory)
$(info repo id: ${git_repository_id})
$(info branch: ${GIT_BRANCH})
Expand Down Expand Up @@ -115,9 +115,9 @@ endif

run-test:
$(info Running unit tests...)
hack/make-rules/test.sh $(WHAT) $(TESTS)
go test -v -coverprofile cover.out -race -parallel 8 ./pkg/...
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asm582, @KPostOffice, @dmatch01, @metalcycling let me know if you are OK with the verbose output from testing and with the exclusion of the ./cmd package.


run-e2e: verify-tag-name
run-e2e: verify-tag-name update-deployment-crds
ifeq ($(strip $(quay_repository)),)
echo "Running e2e with MCAD local image: mcad-controller ${TAG} IfNotPresent."
hack/run-e2e-kind.sh mcad-controller ${TAG} IfNotPresent
Expand All @@ -131,3 +131,22 @@ coverage:

clean:
rm -rf _output/

#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 \
${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}/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 $< $@
6 changes: 3 additions & 3 deletions config/crd/bases/ibm.com_quotasubtree-v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ spec:
properties:
cpu:
x-kubernetes-int-or-string: true
pattern: '^[0-9]*(m)*$'
pattern: '^[0-9]*(m)?$'
memory:
x-kubernetes-int-or-string: true
pattern: '^[0-9]*(Ei|Pi|Ti|Gi|Mi|Ki|E|P|T|G|M|K)*$'
pattern: '^[0-9]*(Ei|Pi|Ti|Gi|Mi|Ki|E|P|T|G|M|K)?$'
nvidia.com/gpu:
x-kubernetes-int-or-string: true
pattern: '^[0-9]*$'
pattern: '^[0-9]?$'
3 changes: 2 additions & 1 deletion config/crd/bases/mcad.ibm.com_appwrappers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
creationTimestamp: null
name: appwrappers.mcad.ibm.com
spec:
group: mcad.ibm.com
Expand Down Expand Up @@ -68,6 +67,8 @@ spec:
The associated item's level .status.conditions[].type field is monitored for any one of these conditions. Once all items with this
option is set and the conditionstatus is met the entire appwrapper state will be changed to one of the valid appwrapper completion state. Note :- this is an AND
operation for all items where this option is set. See the list of appwrapper states for a list of valid complete states.
type: string

custompodresources:
description: Optional section that specifies resource requirements
for non-standard k8s resources, follows same format as
Expand Down
1 change: 0 additions & 1 deletion config/crd/bases/mcad.ibm.com_queuejobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
creationTimestamp: null
name: queuejobs.mcad.ibm.com
spec:
group: mcad.ibm.com
Expand Down
1 change: 0 additions & 1 deletion config/crd/bases/mcad.ibm.com_schedulingspecs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
creationTimestamp: null
name: schedulingspecs.mcad.ibm.com
spec:
group: mcad.ibm.com
Expand Down
62 changes: 62 additions & 0 deletions deployment/mcad-controller/crds/ibm.com_quotasubtree-v1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: quotasubtrees.ibm.com
finalizers: []
spec:
group: ibm.com
scope: Namespaced
names:
kind: QuotaSubtree
singular: quotasubtree
plural: quotasubtrees
shortNames:
- qst
versions:
- name: v1
served: true
storage: true
subresources:
status: {}
schema:
openAPIV3Schema:
type: object
properties:
status:
type: object
x-kubernetes-preserve-unknown-fields: true
spec:
type: object
properties:
parent:
type: string
parentNamespace:
type: string
children:
type: array
items:
type: object
properties:
name:
type: string
namespace:
type: string
quotas:
type: object
properties:
disabled:
type: boolean
hardLimit:
type: boolean
requests:
type: object
properties:
cpu:
x-kubernetes-int-or-string: true
pattern: '^[0-9]*(m)?$'
memory:
x-kubernetes-int-or-string: true
pattern: '^[0-9]*(Ei|Pi|Ti|Gi|Mi|Ki|E|P|T|G|M|K)?$'
nvidia.com/gpu:
x-kubernetes-int-or-string: true
pattern: '^[0-9]?$'
Loading