---
apiVersion: v1
kind: Pod
metadata:
  annotations:
    k8s.v1.cni.cncf.io/network-status: |-
      [{
          "name": "",
          "interface": "eth0",
          "ips": [
              "10.130.0.30"
          ],
          "default": true,
          "dns": {}
      }]
    k8s.v1.cni.cncf.io/networks-status: |-
      [{
          "name": "",
          "interface": "eth0",
          "ips": [
              "10.130.0.30"
          ],
          "default": true,
          "dns": {}
      }]
    openshift.io/scc: restricted
  creationTimestamp: "2022-03-08T10:43:25Z"
  generateName: downloads-88d4c8dfb-
  labels:
    app: console
    component: downloads
    pod-template-hash: 88d4c8dfb
  managedFields:
  - apiVersion: v1
    fieldsType: FieldsV1
    fieldsV1:
      f:metadata:
        f:generateName: {}
        f:labels:
          .: {}
          f:app: {}
          f:component: {}
          f:pod-template-hash: {}
        f:ownerReferences:
          .: {}
          k:{"uid":"03d87234-53f5-4a79-9bff-4e58518efee4"}:
            .: {}
            f:apiVersion: {}
            f:blockOwnerDeletion: {}
            f:controller: {}
            f:kind: {}
            f:name: {}
            f:uid: {}
      f:spec:
        f:containers:
          k:{"name":"download-server"}:
            .: {}
            f:args: {}
            f:command: {}
            f:image: {}
            f:imagePullPolicy: {}
            f:livenessProbe:
              .: {}
              f:failureThreshold: {}
              f:httpGet:
                .: {}
                f:path: {}
                f:port: {}
                f:scheme: {}
              f:periodSeconds: {}
              f:successThreshold: {}
              f:timeoutSeconds: {}
            f:name: {}
            f:ports:
              .: {}
              k:{"containerPort":8080,"protocol":"TCP"}:
                .: {}
                f:containerPort: {}
                f:name: {}
                f:protocol: {}
            f:readinessProbe:
              .: {}
              f:failureThreshold: {}
              f:httpGet:
                .: {}
                f:path: {}
                f:port: {}
                f:scheme: {}
              f:periodSeconds: {}
              f:successThreshold: {}
              f:timeoutSeconds: {}
            f:resources:
              .: {}
              f:requests:
                .: {}
                f:cpu: {}
                f:memory: {}
            f:terminationMessagePath: {}
            f:terminationMessagePolicy: {}
        f:dnsPolicy: {}
        f:enableServiceLinks: {}
        f:nodeSelector:
          .: {}
          f:kubernetes.io/os: {}
        f:restartPolicy: {}
        f:schedulerName: {}
        f:securityContext: {}
        f:terminationGracePeriodSeconds: {}
        f:tolerations: {}
    manager: kube-controller-manager
    operation: Update
    time: "2022-03-08T10:43:25Z"
  - apiVersion: v1
    fieldsType: FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          f:k8s.v1.cni.cncf.io/network-status: {}
          f:k8s.v1.cni.cncf.io/networks-status: {}
    manager: multus
    operation: Update
    time: "2022-03-08T10:44:24Z"
  - apiVersion: v1
    fieldsType: FieldsV1
    fieldsV1:
      f:status:
        f:conditions:
          k:{"type":"ContainersReady"}:
            .: {}
            f:lastProbeTime: {}
            f:lastTransitionTime: {}
            f:status: {}
            f:type: {}
          k:{"type":"Initialized"}:
            .: {}
            f:lastProbeTime: {}
            f:lastTransitionTime: {}
            f:status: {}
            f:type: {}
          k:{"type":"Ready"}:
            .: {}
            f:lastProbeTime: {}
            f:lastTransitionTime: {}
            f:status: {}
            f:type: {}
        f:containerStatuses: {}
        f:hostIP: {}
        f:phase: {}
        f:podIP: {}
        f:podIPs:
          .: {}
          k:{"ip":"10.130.0.30"}:
            .: {}
            f:ip: {}
        f:startTime: {}
    manager: kubelet
    operation: Update
    time: "2022-03-08T10:44:43Z"
  name: downloads-88d4c8dfb-5g9qb
  namespace: openshift-console
  ownerReferences:
  - apiVersion: apps/v1
    blockOwnerDeletion: true
    controller: true
    kind: ReplicaSet
    name: downloads-88d4c8dfb
    uid: 03d87234-53f5-4a79-9bff-4e58518efee4
  resourceVersion: "17531"
  selfLink: /api/v1/namespaces/openshift-console/pods/downloads-88d4c8dfb-5g9qb
  uid: 3bcf3885-72f6-4040-b2a4-83de4d09fc51
spec:
  containers:
  - args:
    - -c
    - "cat <<EOF >>/tmp/serve.py\nimport errno, http.server, os, re, signal, socket, sys, tarfile, tempfile, threading, time, zipfile\n\nsignal.signal(signal.SIGTERM, lambda signum, frame: sys.exit(0))\n\ndef write_index(path, message):\n    with open(path, 'wb') as f:\n        f.write('\\n'.join([\n            '<!doctype html>',\n            '<html lang=\"en\">',\n            '<head>',\n            '  <meta charset=\"utf-8\">',\n            '</head>',\n            '<body>',\n            '  {}'.format(message),\n            '</body>',\n            '</html>',\n            '',\n        ]).encode('utf-8'))\n\n# Launch multiple listeners as threads\nclass Thread(threading.Thread):\n    def __init__(self, i, socket):\n        threading.Thread.__init__(self)\n        self.i = i\n        self.socket = socket\n        self.daemon = True\n        self.start()\n\n    def run(self):\n        httpd = http.server.HTTPServer(addr, http.server.SimpleHTTPRequestHandler, False)\n\n        # Prevent the HTTP server from re-binding every handler.\n        # https://stackoverflow.com/questions/46210672/\n        httpd.socket = self.socket\n        httpd.server_bind = self.server_close = lambda self: None\n\n        httpd.serve_forever()\n\ntemp_dir = tempfile.mkdtemp()\nprint('serving from {}'.format(temp_dir))\nos.chdir(temp_dir)\nfor arch in ['amd64']:\n    os.mkdir(arch)\n    for operating_system in ['linux', 'mac', 'windows']:\n        os.mkdir(os.path.join(arch, operating_system))\nfor arch in ['arm64', 'ppc64le', 's390x']:\n    os.mkdir(arch)\n    for operating_system in ['linux']:\n        os.mkdir(os.path.join(arch, operating_system))\ncontent = ['<a href=\"oc-license\">license</a>']\nos.symlink('/usr/share/openshift/LICENSE', 'oc-license')\n\nfor arch, operating_system, path in [\n        ('amd64', 'linux', '/usr/share/openshift/linux_amd64/oc'),\n        ('amd64', 'mac', '/usr/share/openshift/mac/oc'),\n        ('amd64', 'windows', '/usr/share/openshift/windows/oc.exe'),\n        ('arm64', 'linux', '/usr/share/openshift/linux_arm64/oc'),\n        ('ppc64le', 'linux', '/usr/share/openshift/linux_ppc64le/oc'),\n        ('s390x', 'linux', '/usr/share/openshift/linux_s390x/oc'),\n        ]:\n    basename = os.path.basename(path)\n    target_path = os.path.join(arch, operating_system, basename)\n    os.symlink(path, target_path)\n    base_root, _ = os.path.splitext(basename)\n    archive_path_root = os.path.join(arch, operating_system, base_root)\n    with tarfile.open('{}.tar'.format(archive_path_root), 'w') as tar:\n        tar.add(path, basename)\n    with zipfile.ZipFile('{}.zip'.format(archive_path_root), 'w') as zip:\n        zip.write(path, basename)\n    content.append('<a href=\"{0}\">oc ({1} {2})</a> (<a href=\"{0}.tar\">tar</a> <a href=\"{0}.zip\">zip</a>)'.format(target_path, arch, operating_system))\n\nfor root, directories, filenames in os.walk(temp_dir):\n    root_link = os.path.relpath(temp_dir, os.path.join(root, 'child')).replace(os.path.sep, '/')\n    for directory in directories:\n        write_index(\n            path=os.path.join(root, directory, 'index.html'),\n            message='<p>Directory listings are disabled.  See <a href=\"{}\">here</a> for available content.</p>'.format(root_link),\n        )\n\nwrite_index(\n    path=os.path.join(temp_dir, 'index.html'),\n    message='\\n'.join(\n        ['<ul>'] +\n        ['  <li>{}</li>'.format(entry) for entry in content] +\n        ['</ul>']\n    ),\n)\n\n# Create socket\n# IPv6 should handle IPv4 passively so long as it is not bound to a\n# specific address or set to IPv6_ONLY\n# https://stackoverflow.com/questions/25817848/python-3-does-http-server-support-ipv6\ntry:\n    addr = ('::', 8080)\n    sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)\nexcept socket.error as err:\n    # errno.EAFNOSUPPORT is \"socket.error: [Errno 97] Address family not supported by protocol\"\n    # When IPv6 is disabled, socket will bind using IPv4.\n    if err.errno == errno.EAFNOSUPPORT:\n        addr = ('', 8080)\n        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n    else:\n        raise    \nsock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\nsock.bind(addr)\nsock.listen(5)\n\n[Thread(i, socket=sock) for i in range(100)]\ntime.sleep(9e9)\nEOF\nexec python3 /tmp/serve.py\n"
    command:
    - /bin/sh
    image: quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:6494c710e14aaa44d36c1f0b16cfa170b905a290b88707b5caac15ae5e5de916
    imagePullPolicy: IfNotPresent
    livenessProbe:
      failureThreshold: 3
      httpGet:
        path: /
        port: 8080
        scheme: HTTP
      periodSeconds: 10
      successThreshold: 1
      timeoutSeconds: 1
    name: download-server
    ports:
    - containerPort: 8080
      name: http
      protocol: TCP
    readinessProbe:
      failureThreshold: 3
      httpGet:
        path: /
        port: 8080
        scheme: HTTP
      periodSeconds: 10
      successThreshold: 1
      timeoutSeconds: 1
    resources:
      requests:
        cpu: 10m
        memory: 50Mi
    securityContext:
      capabilities:
        drop:
        - KILL
        - MKNOD
        - SETGID
        - SETUID
      runAsUser: 1000570000
    terminationMessagePath: /dev/termination-log
    terminationMessagePolicy: FallbackToLogsOnError
    volumeMounts:
    - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
      name: default-token-dwkbk
      readOnly: true
  dnsPolicy: ClusterFirst
  enableServiceLinks: true
  imagePullSecrets:
  - name: default-dockercfg-hk5np
  nodeName: master-0.case03116926.lab.upshift.rdu2.redhat.com
  nodeSelector:
    kubernetes.io/os: linux
  preemptionPolicy: PreemptLowerPriority
  priority: 0
  restartPolicy: Always
  schedulerName: default-scheduler
  securityContext:
    fsGroup: 1000570000
    seLinuxOptions:
      level: s0:c24,c9
  serviceAccount: default
  serviceAccountName: default
  terminationGracePeriodSeconds: 1
  tolerations:
  - effect: NoSchedule
    key: node-role.kubernetes.io/master
    operator: Exists
  - effect: NoExecute
    key: node.kubernetes.io/unreachable
    operator: Exists
    tolerationSeconds: 120
  - effect: NoExecute
    key: node.kubernetes.io/not-ready
    operator: Exists
    tolerationSeconds: 120
  - effect: NoSchedule
    key: node.kubernetes.io/memory-pressure
    operator: Exists
  volumes:
  - name: default-token-dwkbk
    secret:
      defaultMode: 420
      secretName: default-token-dwkbk
status:
  conditions:
  - lastProbeTime: null
    lastTransitionTime: "2022-03-08T10:43:25Z"
    status: "True"
    type: Initialized
  - lastProbeTime: null
    lastTransitionTime: "2022-03-08T10:44:43Z"
    status: "True"
    type: Ready
  - lastProbeTime: null
    lastTransitionTime: "2022-03-08T10:44:43Z"
    status: "True"
    type: ContainersReady
  - lastProbeTime: null
    lastTransitionTime: "2022-03-08T10:43:25Z"
    status: "True"
    type: PodScheduled
  containerStatuses:
  - containerID: cri-o://fa6aca9608bf02aedabca2afcb7f87e663532260b5c83191c52ad8b1340344a6
    image: quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:6494c710e14aaa44d36c1f0b16cfa170b905a290b88707b5caac15ae5e5de916
    imageID: quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:6494c710e14aaa44d36c1f0b16cfa170b905a290b88707b5caac15ae5e5de916
    lastState: {}
    name: download-server
    ready: true
    restartCount: 0
    started: true
    state:
      running:
        startedAt: "2022-03-08T10:44:38Z"
  hostIP: 10.0.94.119
  phase: Running
  podIP: 10.130.0.30
  podIPs:
  - ip: 10.130.0.30
  qosClass: Burstable
  startTime: "2022-03-08T10:43:25Z"
