namespaces

How do I copy all resources to a new namespace?

孤街醉人 提交于 2020-12-13 03:05:01
问题 I would like to create a new namespace which is identical to the old one. My approach would look something like this (full command below): kubectl get <resources> -o json --namespace OLD-NAMESPACE | jq '.items[].metadata.namespace = "NEW-NAMESPACE"' | kubectl create -f - This basically gets all resource definitions in a json format, replaces the old namespace with the new one, and applies everything. Unfortunately, this does not work, since the old definitions contain namespace specific

Parsing XML with undeclared prefixes in Python

懵懂的女人 提交于 2020-12-02 07:47:08
问题 I am trying to parse XML data with Python that uses prefixes, but not every file has the declaration of the prefix. Example XML: <?xml version="1.0" encoding="UTF-8"?> <item subtype="bla"> <thing>Word</thing> <abc:thing2>Another Word</abc:thing2> </item> I have been using xml.etree.ElementTree to parse these files, but whenever the prefix is not properly declared, ElementTree throws a parse error. ( unbound prefix , right at the start of <abc:thing2> ) Searching for this error leads me to

Parsing XML with undeclared prefixes in Python

天涯浪子 提交于 2020-12-02 07:46:15
问题 I am trying to parse XML data with Python that uses prefixes, but not every file has the declaration of the prefix. Example XML: <?xml version="1.0" encoding="UTF-8"?> <item subtype="bla"> <thing>Word</thing> <abc:thing2>Another Word</abc:thing2> </item> I have been using xml.etree.ElementTree to parse these files, but whenever the prefix is not properly declared, ElementTree throws a parse error. ( unbound prefix , right at the start of <abc:thing2> ) Searching for this error leads me to