我知道oc tag -d python:3.5只会删除3.5Oc,我希望使用oc命令从相同的Image中删除多个旧标签。
例如,图像流phython:rel-1,phython:rel-2,phython:rel-3.我试着像oc tag -d python:rel-*__一样。但我最后会收到下面的错误信息。
*Error from server (NotFound): imagestreamtags.image.openshift.io "rel-*" not found*,我想知道有什么方法可以一次使用通配符来删除多个旧标签吗?
发布于 2018-04-17 09:10:51
没有完全测试,而且不能在一次命令调用中执行,但是可以使用shell脚本,如下所示:
#!/bin/bash
TAGS=`oc get is python --template='{{range .spec.tags}}{{" "}}{{.name}}{{end}}{{"\n"}}'`
for tag in $TAGS; do
if [[ "$tag" = rel-* ]]; then
oc tag python:$tag -d
fi
donehttps://stackoverflow.com/questions/49818162
复制相似问题