Skip to content

feat: limits enforcement in runtime installation #452

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

Closed
wants to merge 2 commits into from
Closed
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{- if not .Values.installer.skipUsageValidation }}
apiVersion: batch/v1
kind: Job
metadata:
name: validate-usage
annotations:
helm.sh/hook: pre-install
helm.sh/hook-delete-policy: hook-succeeded,before-hook-creation
spec:
backoffLimit: 0
ttlSecondsAfterFinished: 300
template:
spec:
serviceAccountName: validate-values-sa
restartPolicy: Never
containers:
- name: validate-usage
image: "{{ .Values.installer.image.repository }}:{{ .Values.installer.image.tag | default .Chart.Version }}"
imagePullPolicy: {{ .Values.installer.image.pullPolicy }}
command: ["sh", "-c"]
args:
- |
cf account validate-usage --fail-condition=reached --subject=clusters --log-level debug
{{- end }}
2 changes: 2 additions & 0 deletions charts/gitops-runtime/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ global:
installer:
# -- if set to true, pre-install hook will *not* run
skipValidation: false
# -- if set to true, pre-install hook will *not* run
skipUsageValidation: false
image:
repository: quay.io/codefresh/gitops-runtime-installer
tag: ""
Expand Down
2 changes: 1 addition & 1 deletion installer-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM debian:12.9-slim

RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections

ARG CF_CLI_VERSION=v0.1.70
ARG CF_CLI_VERSION=v0.2.6
ARG TARGETARCH

RUN apt-get update && apt-get install curl -y
Expand Down