Skip to content

Feat/revert cr 28342 usage #474

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 3 commits into from
May 14, 2025
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
45 changes: 0 additions & 45 deletions charts/gitops-runtime/templates/hooks/pre-install/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,48 +41,3 @@ metadata:
helm.sh/hook-delete-policy: hook-succeeded,before-hook-creation,hook-failed
helm.sh/hook-weight: "-10"
{{- end }}

{{- if not .Values.installer.skipUsageValidation }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: validate-usage-cr
annotations:
helm.sh/hook: pre-install
helm.sh/hook-delete-policy: hook-succeeded,before-hook-creation,hook-failed
helm.sh/hook-weight: "5"
rules:
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: validate-usage-crb
annotations:
helm.sh/hook: pre-install
helm.sh/hook-delete-policy: hook-succeeded,before-hook-creation,hook-failed
helm.sh/hook-weight: "5"
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: validate-usage-cr
subjects:
- kind: ServiceAccount
name: validate-usage-sa
namespace: {{ .Release.Namespace }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: validate-usage-sa
annotations:
helm.sh/hook: pre-install
helm.sh/hook-delete-policy: hook-succeeded,before-hook-creation,hook-failed
helm.sh/hook-weight: "5"
{{- end }}

This file was deleted.

62 changes: 0 additions & 62 deletions charts/gitops-runtime/tests/global_constraints_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -436,68 +436,6 @@ tests:
value: another-value
effect: NoSchedule

- it: validate-usage job should have nodeSelector from .Values.global
values:
- ./values/global-constraints-values.yaml
template: hooks/pre-install/validate-usage.yaml
documentSelector:
path: kind
value: Job
asserts:
- equal:
path: spec.template.spec.nodeSelector
value:
some-key: some-value
extra-key: extra-value

- it: validate-usage job should have nodeSelector from .Values.installer and NOT from .Values.global
values:
- ./values/global-constraints-values.yaml
- ./values/subcharts-constraints-values.yaml
template: hooks/pre-install/validate-usage.yaml
documentSelector:
path: kind
value: Job
asserts:
- equal:
path: spec.template.spec.nodeSelector
value:
some-key: another-value
foo: bar

- it: validate-usage job should have tolerations from .Values.global
values:
- ./values/global-constraints-values.yaml
template: hooks/pre-install/validate-usage.yaml
documentSelector:
path: kind
value: Job
asserts:
- equal:
path: spec.template.spec.tolerations
value:
- key: some-key
operator: Equal
value: some-value
effect: NoSchedule

- it: validate-usage job should have tolerations from .Values.installer and NOT from .Values.global
values:
- ./values/global-constraints-values.yaml
- ./values/subcharts-constraints-values.yaml
template: hooks/pre-install/validate-usage.yaml
documentSelector:
path: kind
value: Job
asserts:
- equal:
path: spec.template.spec.tolerations
value:
- key: another-key
operator: Equal
value: another-value
effect: NoSchedule


- it: cleanup-resources job should have nodeSelector from .Values.global
values:
Expand Down
2 changes: 0 additions & 2 deletions charts/gitops-runtime/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,6 @@ 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 @@ -8,7 +8,7 @@ FROM debian:12.10-slim

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

ARG CF_CLI_VERSION=v0.2.7
ARG CF_CLI_VERSION=v0.2.6
ARG TARGETARCH

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