6const claimCheckEpPath = 'pt0/deployF/ethF/binF/epClaimCheck.mjs' 7export const claimCheckCmName = 'ethclaimcheck' 9export const mkClaimCheckConfigMap = async () => { 10 const {bundleAbsPath} = await genBundleTar({entrypointAbsPath: tsAbsPath(claimCheckEpPath), bundleName: claimCheckCmName}) 14 metadata: {name: claimCheckCmName}, 15 data: {'bundle.mjs': fs.readFileSync(bundleAbsPath, 'utf8')}, 19export const mkClaimCheckContainer = ({ethValidatorNum, cluster_name, domainName, cfApiKeySecretName}: { 20 ethValidatorNum: number | string, cluster_name: string, domainName: string, cfApiKeySecretName: string, 24 command: ['node', '/claimcheck/bundle.mjs'], 26 {name: 'ETH_VALIDATOR_NUM', value: String(ethValidatorNum)}, 27 {name: 'CLUSTER_NAME', value: cluster_name}, 28 {name: 'DOMAIN_NAME', value: domainName}, 30 envFrom: [{secretRef: {name: cfApiKeySecretName}}], 31 volumeMounts: [{name: claimCheckCmName, mountPath: '/claimcheck'}], 34// injects the claim-check initContainer + ConfigMap volume into a validator Deployment; returns the ConfigMap (or undefined if disabled). 35export const withClaimCheck = async ({deployment, enabled, ethValidatorNum, cluster_name, domainName, cfApiKeySecretName}: { 36 deployment: any, enabled: boolean, ethValidatorNum?: number, cluster_name: string, domainName?: string, cfApiKeySecretName?: string, 38 if (!enabled || ethValidatorNum == null || !domainName || !cfApiKeySecretName) return undefined 39 const configMap = await mkClaimCheckConfigMap() 40 deployment.spec.template.spec.initContainers.push(mkClaimCheckContainer({ethValidatorNum, cluster_name, domainName, cfApiKeySecretName})) 41 deployment.spec.template.spec.volumes.push({name: claimCheckCmName, configMap: {name: claimCheckCmName}})