I can't figure a namespace-portable way to build an image into an imagestream that can then be used for a job in an OpenShift project namespace without hard-coding the internal registry URL in the job config.
Unlike deployment configs, the job configuration does not automatically build a pod config with the image URL correct for the internal registry. The resulting job never runs because the image can't be pulled.
Failed to pull image "is-copy-adaptermappings": Error: image library/is-copy-adaptermappings:latest not found
Working example generated deployconfig-generated pod
...
containers:
- name: i2b2-webclient
image: >-
172.30.1.1:5000/c2/is-i2b2-webclient@sha256:51460a7b65ddd8cc32e41e9a3ac069efb587220364edc9285d06438b22e2ea47
ports:
- containerPort: 8080
protocol: TCP
...
Failing example generated job pod excerpt
apiVersion: v1
kind: Pod
...
containers:
- name: copy-config-to-pv
image: is-copy-adaptermappings
resources: {}
volumeMounts:
...
Job config (json)
{
"apiVersion": "batch/v1",
"kind": "Job",
"metadata": {
"name": "configpod"
},
"spec": {
"parallelism": 1,
"completions": 1,
"template": {
"metadata": {
"name": "copy-config-to-pv"
},
"spec": {
"containers": [
{
"name": "copy-config-to-pv",
"image": "is-copy-adaptermappings",
"imagePullPolicy": "Always",
"volumeMounts": [
{
"mountPath": "/dest",
"name": "volume-config"
}
]
}
],
"restartPolicy": "OnFailure",
"volumes": [
{
"name": "volume-config",
"persistentVolumeClaim": {
"claimName": "pvc-configs"
}
}
]
}
}
}
}
Is there a good way of referring to, or generating that URL to the built-in local registry image?