argocd-image-updater
argocd-image-updater copied to clipboard
do not support standard kustomization format
Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like A clear and concise description of what you want to happen.
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Additional context Add any other context or screenshots about the feature request here.
when write back with follow go panic
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: gulimall-auth-server
# 添加 images 字段用于镜像更新
images:
- name: gulimall-auth-server
newName: harbor.mark.demo/guli/gulimall-auth-server
newTag: ac47eef
resources:
- deployment.yaml
- service.yaml
- propagationpolicy-deployment.yaml
- propagationpolicy-svc.yaml
- configmap.yaml
with code
switch appType {
case ApplicationTypeKustomize:
if appSource.Kustomize == nil {
return []byte{}, nil
}
var params kustomizeOverride
newParams := kustomizeOverride{
Kustomize: kustomizeImages{
Images: &appSource.Kustomize.Images,
},
}
if len(originalData) == 0 {
override, err = marshalWithIndent(newParams, defaultIndent)
break
}
err = yaml.Unmarshal(originalData, ¶ms)
if err != nil {
override, err = marshalWithIndent(newParams, defaultIndent)
break
}
mergeKustomizeOverride(¶ms, &newParams)
override, err = marshalWithIndent(params, defaultIndent)
params is nil