MCPcopy
hub / github.com/fluid-cloudnative/fluid / parseRuntimeImage

Method parseRuntimeImage

pkg/ddc/alluxio/utils.go:191–226  ·  view source on GitHub ↗
(image string, tag string, imagePullPolicy string, imagePullSecrets []v1.LocalObjectReference)

Source from the content-addressed store, hash-verified

189}
190
191func (e *AlluxioEngine) parseRuntimeImage(image string, tag string, imagePullPolicy string, imagePullSecrets []v1.LocalObjectReference) (string, string, string, []v1.LocalObjectReference) {
192 if len(imagePullPolicy) == 0 {
193 imagePullPolicy = common.DefaultImagePullPolicy
194 }
195
196 if len(image) == 0 {
197 image = docker.GetImageRepoFromEnv(common.AlluxioRuntimeImageEnv)
198 if len(image) == 0 {
199 runtimeImageInfo := strings.Split(common.DefaultAlluxioRuntimeImage, ":")
200 if len(runtimeImageInfo) < 1 {
201 panic("invalid default alluxio runtime image!")
202 } else {
203 image = runtimeImageInfo[0]
204 }
205 }
206 }
207
208 if len(tag) == 0 {
209 tag = docker.GetImageTagFromEnv(common.AlluxioRuntimeImageEnv)
210 if len(tag) == 0 {
211 runtimeImageInfo := strings.Split(common.DefaultAlluxioRuntimeImage, ":")
212 if len(runtimeImageInfo) < 2 {
213 panic("invalid default alluxio runtime image!")
214 } else {
215 tag = runtimeImageInfo[1]
216 }
217 }
218 }
219
220 if len(imagePullSecrets) == 0 {
221 // if the environment variable is not set, it is still an empty slice
222 imagePullSecrets = docker.GetImagePullSecretsFromEnv(common.EnvImagePullSecretsKey)
223 }
224
225 return image, tag, imagePullPolicy, imagePullSecrets
226}
227
228func (e *AlluxioEngine) parseFuseImage(image string, tag string, imagePullPolicy string, imagePullSecrets []v1.LocalObjectReference) (string, string, string, []v1.LocalObjectReference) {
229 if len(imagePullPolicy) == 0 {

Callers 2

TestParseRuntimeImageFunction · 0.95
transformCommonPartMethod · 0.95

Calls 3

GetImageRepoFromEnvFunction · 0.92
GetImageTagFromEnvFunction · 0.92

Tested by 1

TestParseRuntimeImageFunction · 0.76