Skip to content

Commit a197464

Browse files
committed
add validation on hostPath and update comments
1 parent c6d258b commit a197464

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

charts/mgmt-agent/templates/mgmt-agent-daemonset.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ spec:
9696
name: {{ include "mgmt-agent.resourceNamePrefix" . }}-agent
9797
- name: mgmtagent-hostpath
9898
hostPath:
99-
path: "{{ required "deployment.daemonSet.hostPath is required" .Values.deployment.daemonSet.hostPath }}/daemonset-mgmtagent-container"
99+
path: "{{ required "deployment.daemonSet.hostPath is required" .Values.deployment.daemonSet.hostPath }}"
100+
{{- if regexMatch "^/opt/oracle/*$" .Values.deployment.daemonSet.hostPath }}
101+
{{- fail "Error: deployment.daemonSet.hostPath cannot be /opt/oracle. Please provide another location or create a sub-directory under /opt/oracle and use that as hostPath" }}
102+
{{- end }}
100103
- emptyDir: {}
101104
name: tmp
102105
{{- end }}

charts/mgmt-agent/values.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,10 @@ deployment:
8484
daemonSetDeployment: false
8585

8686
daemonSet:
87-
# Provide the host path (defaults to /opt/oracle, please change if required) if Agent is deployed as DaemonSet. Management Agent Pod should have read-write access to it.
88-
# The host path needs to be owned by runAsUser and runAsGroup, provided under security context above.
89-
# Note: The deployment will create a sub directory i.e. daemonset-mgmtagent-container under the the provided hostPath.
90-
hostPath: /opt/oracle
91-
# Override the ownership and permissions on the hostPath, to be owned by the runAsUser and runAsGroup provided under security context above and the permission as 750.
87+
# Provide the host path if Agent is deployed as DaemonSet. Management Agent Pod should have read-write access to it.
88+
# Note: The hostPath cannot point to /opt/oracle, please provide another location or create a sub-directory under /opt/oracle and use that as hostPath
89+
hostPath:
90+
# Override the ownership and permissions on the hostPath. The hostPath will be owned by the runAsUser and runAsGroup provided under security context above and the permission as 750.
9291
# Note: This requires oraclelinux:8-slim image
9392
# Setting overrideOwnership to false will disable the ownership change.
9493
overrideOwnership: true

0 commit comments

Comments
 (0)