示例#1
0
func imageRefNode(g osgraph.MutableUniqueGraph, ref *kapi.ObjectReference, bc *buildapi.BuildConfig) graph.Node {
	if ref == nil {
		return nil
	}
	switch ref.Kind {
	case "DockerImage":
		if ref, err := imageapi.ParseDockerImageReference(ref.Name); err == nil {
			tag := ref.Tag
			ref.Tag = ""
			return imagegraph.EnsureDockerRepositoryNode(g, ref.String(), tag)
		}
	case "ImageStream":
		return imagegraph.FindOrCreateSyntheticImageStreamTagNode(g, imagegraph.MakeImageStreamTagObjectMeta(defaultNamespace(ref.Namespace, bc.Namespace), ref.Name, imageapi.DefaultImageTag))
	case "ImageStreamTag":
		return imagegraph.FindOrCreateSyntheticImageStreamTagNode(g, imagegraph.MakeImageStreamTagObjectMeta2(defaultNamespace(ref.Namespace, bc.Namespace), ref.Name))
	case "ImageStreamImage":
		return imagegraph.FindOrCreateSyntheticImageStreamImageNode(g, imagegraph.MakeImageStreamImageObjectMeta(defaultNamespace(ref.Namespace, bc.Namespace), ref.Name))
	}
	return nil
}
示例#2
0
文件: casts.go 项目: cjnygard/origin
func ToClusterRoleRef(in kapi.ObjectReference) kapi.ObjectReference {
	ret := kapi.ObjectReference{}

	ret.Name = in.Name
	return ret
}
示例#3
0
文件: casts.go 项目: cjnygard/origin
func ToPolicyRef(in kapi.ObjectReference) kapi.ObjectReference {
	ret := kapi.ObjectReference{}

	ret.Name = in.Name
	return ret
}