🌳
pt0/deployF/k8sF/configMapWithHashAI.mts
3type ConfigMapWithHashProps = {
4 name: string
5 data: Record<string, string>
6 mountPath: string
7}
9export const configMapWithHash = ({name, data, mountPath}: ConfigMapWithHashProps) => {
10 const content = Object.values(data).join('\n')
11 const configHash = calcHash(content)
12 const configMap = {apiVersion: 'v1', kind: 'ConfigMap', metadata: {name}, data}
13 const volume = {name, configMap: {name}}
14 const volumeMount = {name, mountPath}
15 return {configMap, volume, volumeMount, configHash}