小编mar*_*tin的帖子

Kubernetes 无法连接到服务器:x509:由未知机构签名的证书

我配置了我的配置文件,当我运行时:

kubectl get nodes
Run Code Online (Sandbox Code Playgroud)

我有这个错误:

Unable to connect to the server: x509: certificate signed by unknown authority
Run Code Online (Sandbox Code Playgroud)

我尝试了所有这些命令,但它仍然没有改变:

kubectl config set-cluster ${KUBE_CONTEXT} --insecure-skip-tls-verify=true \
--server=${KUBE_CONTEXT} 
--insecure-skip-tls-verify=true 

kubectl proxy --address 0.0.0.0 --accept-hosts '.*'
Run Code Online (Sandbox Code Playgroud)

kubernetes

7
推荐指数
1
解决办法
2万
查看次数

Python将xml转换为json需要一个类似字节的对象

我有这样的 xml 文件:

<?xml version="1.0" encoding="UTF-8"?>
<Main xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns="http://cnig.gouv.fr/pcrs" gml:id="PlanCorpsRueSimplifie.1" version="2.0">
    <gml:boundedBy>
    </gml:boundedBy>
    <featureMember>
        <EmpriseEchangePCRS gml:id="EmpriseEchangePCRS.12189894">
            <datePublication>2020-05-13</datePublication>
            <type>Cellules</type>
            <geometrie>
                <gml:MultiSurface gml:id="EmpriseEchangePCRS.12189894-0" srsName="EPSG:3944" srsDimension="3">
                    <gml:surfaceMember>
                        <gml:Surface gml:id="EmpriseEchangePCRS.12189894-1">
                            <gml:patches>
                            </gml:patches>
                        </gml:Surface>
Run Code Online (Sandbox Code Playgroud)

我想将此文件转换为 json 文件。我尝试过这个,但我总是遇到同样的错误:

import xmltodict
import xml.etree.ElementTree as ET

root = ET.fromstring(open('JeuxTestv2.gml').read())

print(xmltodict.parse(root)['Main'])
Run Code Online (Sandbox Code Playgroud)

错误 :

Traceback (most recent call last):
  File "C:\Users\xmltodict.py", line 6, in <module>
    print(xmltodict.parse(root)['Main'])
  File "C:\Users\xmltodict.py", line 327, in parse
    parser.Parse(xml_input, True)
TypeError: a bytes-like object is required, not 'xml.etree.ElementTree.Element'
Run Code Online (Sandbox Code Playgroud)

python xml json

5
推荐指数
1
解决办法
9617
查看次数

标签 统计

json ×1

kubernetes ×1

python ×1

xml ×1