func adjustCacheFrom(a *latestV1.Artifact, artifactTag string) *latestV1.Artifact {
	if os.Getenv("SKAFFOLD_DISABLE_DOCKER_CACHE_ADJUSTMENT") != "" {
		// allow this behaviour to be disabled
		return a
	}

	if !stringslice.Contains(a.DockerArtifact.CacheFrom, a.ImageName) {
		return a
	}

	cf := make([]string, 0, len(a.DockerArtifact.CacheFrom))
	for _, image := range a.DockerArtifact.CacheFrom {
		if image == a.ImageName {
			cf = append(cf, artifactTag)
		} else {
			cf = append(cf, image)
		}
	}
	copy := *a
	copy.DockerArtifact.CacheFrom = cf
	return &copy
}
// adjustCacheFrom returns an artifact where any cache references from the artifactImage is changed to the tagged built image name instead.
adjustCacheFrom returns an artifact where any cache references from the artifactImage is changed to the tagged built image name instead.
// adjustCacheFrom returns an artifact where any cache references from the artifactImage is changed to the tagged built image name instead .
func adjustCacheFrom(a *latestV1.Artifact, artifactTag string) *latestV1.Artifact {
	if os.Getenv("SKAFFOLD_DISABLE_DOCKER_CACHE_ADJUSTMENT") != "" {
		return a
	}
	if !stringslice.Contains(a.DockerArtifact.CacheFrom, a.ImageName) {
		return a
	}
	cf := make([]string, 0, len(a.DockerArtifact.CacheFrom))
	for _, image := range a.DockerArtifact.CacheFrom {
		if image == a.ImageName {
			cf = append(cf, artifactTag)
		} else {
			cf = append(cf, image)
		}
	}
	copy := *a
	copy.DockerArtifact.CacheFrom = cf
	return &copy
}
func adjustCacheFrom ( a * latestV1 . Artifact , artifactTag string ) * latestV1 . Artifact { if os . Getenv ( " " ) != " " { return a } if ! stringslice . Contains ( a . DockerArtifact . CacheFrom , a . ImageName ) { return a } cf := make ( [ ] string , 0 , len ( a . DockerArtifact . CacheFrom ) ) for _ , image := range a . DockerArtifact . CacheFrom { if image == a . ImageName { cf = append ( cf , artifactTag ) } else { cf = append ( cf , image ) } } copy := * a copy . DockerArtifact . CacheFrom = cf return & copy }
adjustCacheFrom returns an artifact where any cache references from the artifactImage is changed to the tagged built image name instead.
adjustCacheFrom returns an artifact where any cache references from the artifactImage is changed to the tagged built image name instead .
// allow this behaviour to be disabled