def get_api_objs(self, group, manifest, ctx=None):
if ctx is None:
ctx = {}
ctx = self.get_manifest_ctx(group, manifest, **ctx)
docs = yaml.load_all(
self.cluster.decode_manifest(
self.cluster.config["release"][group]["manifests"][manifest],
ctx,
)
)
objs = collections.defaultdict(list)
for doc in docs:
obj = getattr(pykube.objects, doc["kind"])(self.api, doc)
if obj.exists():
obj.reload()
# set the shadow object to the original doc enabling proper
# update handling if the object has changed in the manifest
obj.obj = doc
objs[doc["kind"]].append(obj)
return objs
评论列表
文章目录