I have created an initContainer
initContainers:
- name: migration
image: registry.access.redhat.com/ubi8/ubi:latest
securityContext:
allowPrivilegeEscalation: false
privileged: false
readOnlyRootFilesystem: true
runAsNonRoot: true
command: ['sh', '-c', 'mkdir -p /tmp/import_export/ && cp /tmp/migration/* /tmp/import_export/ && rm -rf /tmp/migration/*']
volumeMounts:
- name: backup-config-volume
mountPath: /tmp/migration/
- name: dest
mountPath: /cnom/var/import_export/
which has shared volume /tmp/migration , /tmp/import_export/ with main container
if i just copy files from /tmp/migration to /tmp/import_export/ it works if I try to remove files in source directory after copy
&& rm -rf /tmp/migration/*
it fails could you suggest any workaround so that I can remove files from source directory after copy completes ?
tried to remove files by issuing bash command in init container and it failed
New contributor
Rip Kirby is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.