fix name ref issue

This commit is contained in:
ymqytw 2018-01-26 15:03:01 -08:00
parent 775ef29560
commit 333d6e8ddf
3 changed files with 5 additions and 8 deletions

View File

@ -116,6 +116,8 @@ spec:
ports:
- containerPort: 80
- envFrom:
- configMapRef:
name: someConfigMap
- configMapRef:
name: test-infra-app-env-hf26mf2f2f
- secretRef:

View File

@ -23,6 +23,8 @@ spec:
- name: busybox
image: busybox
envFrom:
- configMapRef:
name: someConfigMap
- configMapRef:
name: app-env
- secretRef:

View File

@ -61,12 +61,6 @@ func (o *NameReferenceTransformer) Transform(
}
err := mutateField(objMap, path.Path, path.CreateIfNotPresent,
o.updateNameReference(referencePathConfig.referencedGVK, m))
// Ignore the error when we can't find the GVKN that is being
// referenced, because the missing GVKN may be not included in
// this manifest and will be created later.
if IsNoMatchingGVKNError(err) {
continue
}
if err != nil {
return err
}
@ -116,7 +110,6 @@ func (o *NameReferenceTransformer) updateNameReference(
return obj.GetName(), nil
}
}
return nil, NewNoMatchingGVKNError(
fmt.Sprintf("no matching for GroupVersionKind %v and Name %v", GVK, s))
return in, nil
}
}