Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
kang-makes committed Sep 4, 2024
1 parent 5dd1ae6 commit 2b9279a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ spec:
- name: NR_CLUSTER_NAME
value: {{ include "newrelic.common.cluster" . }}
- name: NR_STAGING
value: {{ include "newrelic.common.nrStaging.value" . }}
value: {{ include "newrelic.common.nrStaging.value" . | quote }}
- name: NR_VERBOSE
value: {{ include "newrelic.common.verboseLog.valueAsBoolean" . }}
value: {{ include "newrelic.common.verboseLog.valueAsBoolean" . | quote }}
- name: NR_REGION
value: {{ include "newrelic.common.region" . }}
{{- /* ----- Variables used to send data downstream to subagents */}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
{{- if include "newrelic-super-agent.auth.secret.shouldRunJob" . -}}
{{- /*
User key secret is used only in the step that create the system identity.
The secret that is created by the common-library does not allow to add annotations so the secret is removed
once the installation hook is finished, so I have to add it as a hook.
*/ -}}
{{- if not (include "newrelic.common.userKey._customSecretName" .) }}
---
apiVersion: v1
kind: Secret
metadata:
annotations:
helm.sh/hook: pre-install # TODO we cannot enable auth after installation, we should add pre-upgrade and check if the secret exists
helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded
helm.sh/hook-weight: "-1010"
labels:
{{- include "newrelic.common.labels" . | nindent 4 }}
name: {{ include "newrelic.common.naming.truncateToDNSWithSuffix" (dict "name" (include "newrelic.common.naming.fullname" .) "suffix" "preinstall-user-key" ) }}
namespace: {{ .Release.Namespace }}
data:
{{ include "newrelic.common.userKey.secretKeyName" . }}: {{ include "newrelic.common.userKey._userKey" . | b64enc }}
{{- end }}
---
apiVersion: batch/v1
kind: Job
metadata:
Expand All @@ -21,7 +43,11 @@ spec:
- name: USER_KEY
valueFrom:
secretKeyRef:
{{- if include "newrelic.common.userKey._customSecretName" . }}
name: {{ include "newrelic.common.userKey.secretName" . }}
{{- else }}
name: {{ include "newrelic.common.naming.truncateToDNSWithSuffix" (dict "name" (include "newrelic.common.naming.fullname" .) "suffix" "preinstall-user-key" ) }}
{{- end }}
key: {{ include "newrelic.common.userKey.secretKeyName" . }}
command:
- ash
Expand Down
8 changes: 6 additions & 2 deletions charts/super-agent/ci/test-values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
super-agent-deployment:
global:
cluster: sa-cluster
licenseKey: test

super-agent-deployment:
config:
auth:
organizationId: test
# There is no way to test the auth flow for now. Tests get stuck as the pre-install job cannot succeed to create a new system identity.
# Until we have a better idea or we are able to create a fake oauth server, we have to disable this.
enabled: false

0 comments on commit 2b9279a

Please sign in to comment.