in apply/src/awsqs_kubernetes_resource/utils.py [0:0]
def get_model(model, session):
token, cluster, namespace, kind = decode_id(model.CfnId)
cmd = f"kubectl get {kind} -o yaml"
if namespace:
cmd = f"{cmd} -n {namespace}"
outp = run_command(cmd, cluster, session)
for i in yaml.safe_load(outp)["items"]:
if token == i.get("metadata", {}).get("annotations", {}).get(
"cfn-client-token"
):
build_model([i], model)
return model
return None