diff --git a/Documentation/CRDs/Cluster/ceph-cluster-crd.md b/Documentation/CRDs/Cluster/ceph-cluster-crd.md index b0eaf8a7655c..168dcb1415cf 100755 --- a/Documentation/CRDs/Cluster/ceph-cluster-crd.md +++ b/Documentation/CRDs/Cluster/ceph-cluster-crd.md @@ -86,6 +86,9 @@ For more details on the mons and when to choose a number other than `3`, see the * For non-PVCs: `placement.all` and `placement.osd` * For PVCs: `placement.all` and inside the storageClassDeviceSets from the `placement` or `preparePlacement` * `flappingRestartIntervalHours`: Defines the time for which an OSD pod will sleep before restarting, if it stopped due to flapping. Flapping occurs where OSDs are marked `down` by Ceph more than 5 times in 600 seconds. The OSDs will stay down when flapping since they likely have a bad disk or other issue that needs investigation. If the issue with the OSD is fixed manually, the OSD pod can be manually restarted. The sleep is disabled if this interval is set to 0. + * `fullRatio`: The ratio at which Ceph should block IO if the OSDs are too full. The default is 0.95. + * `backfillFullRatio`: The ratio at which Ceph should stop backfilling data if the OSDs are too full. The default is 0.90. + * `nearFullRatio`: The ratio at which Ceph should raise a health warning if the cluster is almost full. The default is 0.85. * `disruptionManagement`: The section for configuring management of daemon disruptions * `managePodBudgets`: if `true`, the operator will create and manage PodDisruptionBudgets for OSD, Mon, RGW, and MDS daemons. OSD PDBs are managed dynamically via the strategy outlined in the [design](https://github.com/rook/rook/blob/master/design/ceph/ceph-managed-disruptionbudgets.md). The operator will block eviction of OSDs by default and unblock them safely when drains are detected. * `osdMaintenanceTimeout`: is a duration in minutes that determines how long an entire failureDomain like `region/zone/host` will be held in `noout` (in addition to the default DOWN/OUT interval) when it is draining. The default value is `30` minutes. diff --git a/Documentation/CRDs/Cluster/network-providers.md b/Documentation/CRDs/Cluster/network-providers.md index f7923acbf24e..053e443a9807 100644 --- a/Documentation/CRDs/Cluster/network-providers.md +++ b/Documentation/CRDs/Cluster/network-providers.md @@ -73,6 +73,14 @@ Ceph daemons will use any network available on the host for communication. To re only a specific specific host interfaces or networks, use `addressRanges` to select the network CIDRs Ceph will bind to on the host. +If the Ceph mons are expected to bind to a public network that is different from the IP address +assign to the K8s node where the mon is running, the IP address for the mon can be set by +adding an annotation to the node: + +```yaml +network.rook.io/mon-ip: +``` + If the host networking setting is changed in a cluster where mons are already running, the existing mons will remain running with the same network settings with which they were created. To complete the conversion to or from host networking after you update this setting, you will need to diff --git a/Documentation/CRDs/specification.md b/Documentation/CRDs/specification.md index 61c329b27e06..f03bc8648ca2 100644 --- a/Documentation/CRDs/specification.md +++ b/Documentation/CRDs/specification.md @@ -12170,6 +12170,42 @@ User needs to manually restart the OSD pod if they manage to fix the underlying The sleep will be disabled if this interval is set to 0.

+ + +fullRatio
+ +float64 + + + +(Optional) +

FullRatio is the ratio at which the cluster is considered full and ceph will stop accepting writes. Default is 0.95.

+ + + + +nearFullRatio
+ +float64 + + + +(Optional) +

NearFullRatio is the ratio at which the cluster is considered nearly full and will raise a ceph health warning. Default is 0.85.

+ + + + +backfillFullRatio
+ +float64 + + + +(Optional) +

BackfillFullRatio is the ratio at which the cluster is too full for backfill. Backfill will be disabled if above this threshold. Default is 0.90.

+ +

StoreType diff --git a/ROADMAP.md b/ROADMAP.md index 749bd0fa8867..c365a2aaca30 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -8,26 +8,20 @@ We hope that the items listed below will inspire further engagement from the com Any dates listed below and the specific issues that will ship in a given milestone are subject to change but should give a general idea of what we are planning. See the [GitHub project boards](https://github.com/rook/rook/projects) for the most up-to-date issues and their status. -## Rook Ceph 1.14 +## Rook Ceph 1.15 -The following high level features are targeted for Rook v1.14 (April 2024). For more detailed project tracking see the [v1.14 board](https://github.com/rook/rook/projects/31). +The following high level features are targeted for Rook v1.15 (July 2024). For more detailed project tracking see the [v1.15 board](https://github.com/rook/rook/projects/32). -* Support for Ceph Squid (v19) -* Allow setting the application name on a CephBlockPool [#13744](https://github.com/rook/rook/pull/13744) -* Pool sharing for multiple object stores [#11411](https://github.com/rook/rook/issues/11411) -* DNS subdomain style access to RGW buckets [#4780](https://github.com/rook/rook/issues/4780) * Replace a single OSD when a metadataDevice is configured with multiple OSDs [#13240](https://github.com/rook/rook/issues/13240) -* Create a default service account for all Ceph daemons [#13362](https://github.com/rook/rook/pull/13362) -* Enable the rook orchestrator mgr module by default for improved dashboard integration [#13760](https://github.com/rook/rook/issues/13760) -* Option to run all components on the host network [#13571](https://github.com/rook/rook/issues/13571) -* Multus-enabled clusters to begin "holder" pod deprecation [#13055](https://github.com/rook/rook/issues/13055) -* Separate CSI image repository and tag for all images in the helm chart [#13585](https://github.com/rook/rook/issues/13585) -* Ceph-CSI [v3.11](https://github.com/ceph/ceph-csi/issues?q=is%3Aopen+is%3Aissue+milestone%3Arelease-v3.11.0) -* Add build support for Go 1.22 [#13738](https://github.com/rook/rook/pull/13738) -* Add topology based provisioning for external clusters [#13821](https://github.com/rook/rook/pull/13821) +* Multus-enabled clusters will potentially remove "holder" pods [#14289](https://github.com/rook/rook/issues/14289) +* Key rotation for Ceph object store users [#11563](https://github.com/rook/rook/issues/11563) +* CSI Driver + * Integrate the new Ceph-CSI operator [#14260](https://github.com/rook/rook/issues/14260) + * Ceph-CSI [v3.12](https://github.com/ceph/ceph-csi/issues?q=is%3Aopen+is%3Aissue+milestone%3Arelease-v3.12.0) + * Support log rotation for the Ceph-CSI pods [#12809](https://github.com/rook/rook/issues/12809) ## Kubectl Plugin -Features are planned in the 1.14 time frame for the [Kubectl Plugin](https://github.com/rook/kubectl-rook-ceph). +Features are planned for the [Kubectl Plugin](https://github.com/rook/kubectl-rook-ceph), though without a committed timeline. * Collect details to help troubleshoot the csi driver [#69](https://github.com/rook/kubectl-rook-ceph/issues/69) -* Command to flatten an RBD image [#222](https://github.com/rook/kubectl-rook-ceph/issues/222) +* Support `radosgw-admin` commands from the plugin [#253](https://github.com/rook/kubectl-rook-ceph/issues/253) diff --git a/build/csv/ceph/ceph.rook.io_cephclusters.yaml b/build/csv/ceph/ceph.rook.io_cephclusters.yaml index 6843cd9197cf..4e7b1f2b4d1e 100644 --- a/build/csv/ceph/ceph.rook.io_cephclusters.yaml +++ b/build/csv/ceph/ceph.rook.io_cephclusters.yaml @@ -1502,6 +1502,11 @@ spec: storage: nullable: true properties: + backfillFullRatio: + maximum: 1 + minimum: 0 + nullable: true + type: number config: additionalProperties: type: string @@ -1531,6 +1536,16 @@ spec: x-kubernetes-preserve-unknown-fields: true flappingRestartIntervalHours: type: integer + fullRatio: + maximum: 1 + minimum: 0 + nullable: true + type: number + nearFullRatio: + maximum: 1 + minimum: 0 + nullable: true + type: number nodes: items: properties: diff --git a/build/csv/ceph/rook-ceph-operator.clusterserviceversion.yaml b/build/csv/ceph/rook-ceph-operator.clusterserviceversion.yaml index c011245c8133..76123e2b1595 100644 --- a/build/csv/ceph/rook-ceph-operator.clusterserviceversion.yaml +++ b/build/csv/ceph/rook-ceph-operator.clusterserviceversion.yaml @@ -214,1655 +214,1637 @@ metadata: IiBCQVNJUywKV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVp dGhlciBleHByZXNzIG9yIGltcGxpZWQuClNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmlj IGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKbGltaXRhdGlvbnMgdW5kZXIgdGhl - IExpY2Vuc2UuCiIiIgoKIyBweWxpbnQ6IGRpc2FibGU9RTA2MDYKCmltcG9ydCBlcnJubwppbXBv - cnQgc3lzCmltcG9ydCBqc29uCmltcG9ydCBhcmdwYXJzZQppbXBvcnQgcmUKaW1wb3J0IHN1YnBy - b2Nlc3MKaW1wb3J0IGhtYWMKZnJvbSBoYXNobGliIGltcG9ydCBzaGExIGFzIHNoYQpmcm9tIG9z - IGltcG9ydCBsaW5lc2VwIGFzIExJTkVTRVAKZnJvbSBvcyBpbXBvcnQgcGF0aApmcm9tIGVtYWls - LnV0aWxzIGltcG9ydCBmb3JtYXRkYXRlCmltcG9ydCByZXF1ZXN0cwpmcm9tIH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XRoLmFic3Bh - dGgocGF0aC5kaXJuYW1lKF9fZmlsZV9fKSkKICAgICAgICBjZXBoX3N0YXR1c19zdHIgPSAiIgog - ICAgICAgIHdpdGggb3BlbigKICAgICAgICAgICAgcGF0aC5qb2luKHNjcmlwdF9kaXIsIGpzb25f - ZmlsZV9uYW1lKSwgbW9kZT0iciIsIGVuY29kaW5nPSJVVEYtOCIKICAgICAgICApIGFzIGpzb25f - ZmlsZToKICAgICAgICAgICAgY2VwaF9zdGF0dXNfc3RyID0ganNvbl9maWxlLnJlYWQoKQogICAg - ICAgIHNlbGYuY21kX25hbWVzWyJmcyBscyJdID0gIiIieyJmb3JtYXQiOiAianNvbiIsICJwcmVm - aXgiOiAiZnMgbHMifSIiIgogICAgICAgIHNlbGYuY21kX25hbWVzWyJxdW9ydW1fc3RhdHVzIl0g - PSAoCiAgICAgICAgICAgICIiInsiZm9ybWF0IjogImpzb24iLCAicHJlZml4IjogInF1b3J1bV9z - dGF0dXMifSIiIgogICAgICAgICkKICAgICAgICBzZWxmLmNtZF9uYW1lc1sibWdyIHNlcnZpY2Vz - Il0gPSAoCiAgICAgICAgICAgICIiInsiZm9ybWF0IjogImpzb24iLCAicHJlZml4IjogIm1nciBz - ZXJ2aWNlcyJ9IiIiCiAgICAgICAgKQogICAgICAgICMgYWxsIHRoZSBjb21tYW5kcyBhbmQgdGhl - aXIgb3V0cHV0CiAgICAgICAgc2VsZi5jbWRfb3V0cHV0X21hcFtzZWxmLmNtZF9uYW1lc1siZnMg - bHMiXV0gPSAoCiAgICAgICAgICAgICIiIlt7Im5hbWUiOiJteWZzIiwibWV0YWRhdGFfcG9vbCI6 - Im15ZnMtbWV0YWRhdGEiLCJtZXRhZGF0YV9wb29sX2lkIjoyLCJkYXRhX3Bvb2xfaWRzIjpbM10s - ImRhdGFfcG9vbHMiOlsibXlmcy1yZXBsaWNhdGVkIl19XSIiIgogICAgICAgICkKICAgICAgICBz - ZWxmLmNtZF9vdXRwdXRfbWFwW3NlbGYu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jb25uZWN0ZWQiCiAgICAgICAgc2VsZi5jbWRfb3V0cHV0X21hcCA9 + IHt9CiAgICAgICAgc2VsZi5jbWRfbmFtZXMgPSB7fQogICAgICAgIHNlbGYuX2luaXRfY21kX291 + dHB1dF9tYXAoKQogICAgICAgIHNlbGYuZHVtbXlfaG9zdF9pcF9tYXAgPSB7fQoKICAgIGRlZiBf + aW5pdF9jbWRfb3V0cHV0X21hcChzZWxmKToKICAgICAgICBqc29uX2ZpbGVfbmFtZSA9ICJ0ZXN0 + LWRhdGEvY2VwaC1zdGF0dXMtb3V0IgogICAgICAgIHNjcmlwdF9kaXIgPSBwYXRoLmFic3BhdGgo + cGF0aC5kaXJuYW1lKF9fZmlsZV9fKSkKICAgICAgICBjZXBoX3N0YXR1c19zdHIgPSAiIgogICAg + ICAgIHdpdGggb3BlbigKICAgICAgICAgICAgcGF0aC5qb2luKHNjcmlwdF9kaXIsIGpzb25fZmls + ZV9uYW1lKSwgbW9kZT0iciIsIGVuY29kaW5nPSJVVEYtOCIKICAgICAgICApIGFzIGpzb25fZmls + ZToKICAgICAgICAgICAgY2VwaF9zdGF0dXNfc3RyID0ganNvbl9maWxlLnJlYWQoKQogICAgICAg + IHNlbGYuY21kX25hbWVzWyJmcyBscyJdID0gIiIieyJmb3JtYXQiOiAianNvbiIsICJwcmVmaXgi + OiAiZnMgbHMifSIiIgogICAgICAgIHNlbGYuY21kX25hbWVzWyJxdW9ydW1fc3RhdHVzIl0gPSAo + CiAgICAgICAgICAgICIiInsiZm9ybWF0IjogImpzb24iLCAicHJlZml4IjogInF1b3J1bV9zdGF0 + dXMifSIiIgogICAgICAgICkKICAgICAgICBzZWxmLmNtZF9uYW1lc1sibWdyIHNlcnZpY2VzIl0g + PSAoCiAgICAgICAgICAgICIiInsiZm9ybWF0IjogImpzb24iLCAicHJlZml4IjogIm1nciBzZXJ2 + aWNlcyJ9IiIiCiAgICAgICAgKQogICAgICAgICMgYWxsIHRoZSBjb21tYW5kcyBhbmQgdGhl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Zmls - ZSByYmQifX1dIiIiCiAgICAgICAgc2VsZi5jbWRfb3V0cHV0X21hcFsKICAgICAgICAgICAgIiIi - eyJjYXBzIjogWyJtb24iLCAiYWxsb3cgciwgYWxsb3cgY29tbWFuZCAnb3NkIGJsb2NrbGlzdCci - LCAibWdyIiwgImFsbG93IHJ3IiwgIm9zZCIsICJhbGxvdyBydyB0YWcgY2VwaGZzICo9KiIsICJt - ZHMiLCAiYWxsb3cgcnciXSwgImVudGl0eSI6ICJjbGllbnQuY3NpLWNlcGhmcy1ub2RlIiwgImZv - cm1hdCI6ICJqc29uIiwgInByZWZpeCI6ICJhdXRoIGdldC1vci1jcmVhdGUifSIiIgogICAgICAg - IF0gPSAiIiJbeyJlbnRpdHkiOiJjbGllbnQuY3NpLWNlcGhmcy1ub2RlIiwia2V5IjoiQVFCT2dy - TmVFTnVuS3hBQVBDbWdFN1I2RzhEY1huYUoxRjMycWc9PSIsImNhcHMiOnsibWRzIjoiYWxsb3cg - cnciLCJtZ3IiOiJhbGxvdyBydyIsIm1vbiI6ImFsbG93IHIsIGFsbG93IGNvbW1hbmQgJ29zZCBi - bG9ja2xpc3QnIiwib3NkIjoiYWxsb3cgcncgdGFnIGNlcGhmcyAqPSoifX1dIiIiCiAgICAgICAg - c2VsZi5jbWRfb3V0cHV0X21hcFsKICAgICAgICAgICAgIiIieyJjYXBzIjogWyJtb24iLCAiYWxs - b3cgciwgYWxsb3cgY29tbWFuZCAnb3NkIGJsb2NrbGlzdCciLCAibWdyIiwgImFsbG93IHJ3Iiwg - Im9zZCIsICJhbGxvdyBydyB0YWcgY2VwaGZzIG1ldGFkYXRhPSoiXSwgImVudGl0eSI6ICJjbGll - bnQuY3NpLWNlcGhmcy1wcm92aXNpb25lciIsICJmb3JtYXQiOiAianNvbiIsICJwcmVmaXgiOiAi - YXV0aCBnZXQtb3ItY3JlYXRlIn0iIiIKICAgICAgICBdID0gIiIiW3siZW50aXR5IjoiY2xpZW50 - LmNzaS1jZXBoZnMtcH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ItYS01N2NmOWY4NGJjLWY0am5s - OjkyODMvIn0iIiIKICAgICAgICBzZWxmLmNtZF9vdXRwdXRfbWFwWwogICAgICAgICAgICAiIiJ7 - ImVudGl0eSI6ICJjbGllbnQuaGVhbHRoY2hlY2tlciIsICJmb3JtYXQiOiAianNvbiIsICJwcmVm - aXgiOiAiYXV0aCBnZXQifSIiIgogICAgICAgIF0gPSAiIiJbeyJlbnRpdHkiOiJjbGllbnQuaGVh - bHRoY2hlY2tlciIsImtleSI6IkFRREZrYk5lZnQ1YkZSQUFUbmRMTlVTRUtydW96eGlaaTNscmRB - PT0iLCJjYXBzIjp7Im1vbiI6ICJhbGxvdyByLCBhbGxvdyBjb21tYW5kIHF1b3J1bV9zdGF0dXMs - IGFsbG93IGNvbW1hbmQgdmVyc2lvbiIsICJtZ3IiOiAiYWxsb3cgY29tbWFuZCBjb25maWciLCAi - b3NkIjogInByb2ZpbGUgcmJkLXJlYWQtb25seSwgYWxsb3cgcnd4IHBvb2w9ZGVmYXVsdC5yZ3cu - bWV0YSwgYWxsb3cgciBwb29sPS5yZ3cucm9vdCwgYWxsb3cgcncgcG9vbD1kZWZhdWx0LnJndy5j - b250cm9sLCBhbGxvdyByeCBwb29sPWRlZmF1bHQucmd3LmxvZywgYWxsb3cgeCBwb29sPWRlZmF1 - bHQucmd3LmJ1Y2tldHMuaW5kZXgifX1dIiIiCiAgICAgICAgc2VsZi5jbWRfb3V0cHV0X21hcFsK - ICAgICAgICAgICAgIiIieyJlbnRpdHkiOiAiY2xpZW50LmNzaS1jZXBoZnMtbm9kZSIsICJmb3Jt - YXQiOiAianNvbiIsICJwcmVmaXgiOiAiYXV0aCBnZXQifSIiIgogICAgICAgIF0gPSAiIiJbXSIi - IgogICAgICAgIHNlbGYuY21kX291dHB1dF9tYXBbCiAgICAgICAgICAgICIiInsiZW50aXR5Ijog - ImNsaWVudC5jc2ktcmJkLW5vZGUiLCAiZm9ybWF0IjogImpzb24iLCAicHJlZml4IjogImF1dGgg - Z2V0In0iIiIKICAgICAgICBdID0gIiIiW10iIiIKICAgICAgICBzZWxmLmNtZF9vdXRwdXRfbWFw - WwogICAgICAgICAgICAiIiJ7ImVudGl0eSI6ICJjbGllbnQuY3NpLXJiZC1wcm92aXNpb25lciIs - ICJmb3JtYXQiOiAianNvbiIsICJwcmVmaXgiOiAiYXV0aCBnZXQifSIiIgogICAgICAgIF0gPSAi - IiJbXSIiIgogICAgICAgIHNlbGYuY21kX291dHB1dF9tYXBbCiAgICAgICAgICAgICIiInsiZW50 - aXR5IjogImNsaWVudC5jc2ktY2VwaGZzLXByb3Zpc2lvbmVyIiwgImZvcm1hdCI6ICJqc29uIiwg + OiJjbGllbnQuY3NpLXJiZC1wcm92aXNpb25lciIsImtleSI6IkFRQk5nck5lMWdleUt4QUE4ZWtW + aVJkRStoc3M1T3dlWUJrd05nPT0iLCJjYXBzIjp7Im1nciI6ImFsbG93IHJ3IiwibW9uIjoicHJv + ZmlsZSByYmQsIGFsbG93IGNvbW1hbmQgJ29zZCBibG9ja2xpc3QnIiwib3NkIjoicHJvZmlsZSBy + YmQifX1dIiIiCiAgICAgICAgc2VsZi5jbWRfb3V0cHV0X21hcFsKICAgICAgICAgICAgIiIieyJj + YXBzIjogWyJtb24iLCAiYWxsb3cgciwgYWxsb3cgY29tbWFuZCAnb3NkIGJsb2NrbGlzdCciLCAi + bWdyIiwgImFsbG93IHJ3IiwgIm9zZCIsICJhbGxvdyBydyB0YWcgY2VwaGZzICo9KiIsICJtZHMi + LCAiYWxsb3cgcnciXSwgImVudGl0eSI6ICJjbGllbnQuY3NpLWNlcGhmcy1ub2RlIiwgImZvcm1h + dCI6ICJqc29uIiwgInByZWZpeCI6ICJhdXRoIGdldC1vci1jcmVhdGUifSIiIgogICAgICAgIF0g + PSAiIiJbeyJlbnRpdHkiOiJjbGllbnQuY3NpLWNlcGhmcy1ub2RlIiwia2V5IjoiQVFCT2dyTmVF + TnVuS3hBQVBDbWdFN1I2RzhEY1huYUoxRjMycWc9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WZhdWx0LnJndy5tZXRhLCBhbGxv + dyByIHBvb2w9LnJndy5yb290LCBhbGxvdyBydyBwb29sPWRlZmF1bHQucmd3LmNvbnRyb2wsIGFs + bG93IHJ4IHBvb2w9ZGVmYXVsdC5yZ3cubG9nLCBhbGxvdyB4IHBvb2w9ZGVmYXVsdC5yZ3cuYnVj + a2V0cy5pbmRleCJ9fV0iIiIKICAgICAgICBzZWxmLmNtZF9vdXRwdXRfbWFwWyIiInsiZm9ybWF0 + IjogImpzb24iLCAicHJlZml4IjogIm1nciBzZXJ2aWNlcyJ9IiIiXSA9ICgKICAgICAgICAgICAg + IiIieyJkYXNoYm9hcmQiOiAiaHR0cDovL3Jvb2stY2VwaC1tZ3ItYS01N2NmOWY4NGJjLWY0am5s + OjcwMDAvIiwgInByb21ldGhldXMiOiAiaHR0cDovL3Jvb2stY2VwaC1tZ3ItYS01N2NmOWY4NGJj + LWY0am5sOjkyODMvIn0iIiIKICAgICAgICApCiAgICAgICAgc2VsZi5jbWRfb3V0cHV0X21hcFsK + ICAgICAgICAgICAgIiIieyJlbnRpdHkiOiAiY2xpZW50LmhlYWx0aGNoZWNrZXIiLCAiZm9ybWF0 + IjogImpzb24iLCAicHJlZml4IjogImF1dGggZ2V0In0iIiIKICAgICAgICBdID0gIiIieyJkYXNo + Ym9hcmQiOiAiaHR0cDovL3Jvb2stY2VwaC1tZ3ItYS01N2NmOWY4NGJjLWY0am5sOjcwMDAvIiwg + InByb21ldGhldXMiOiAiaHR0cDovL3Jvb2stY2VwaC1tZ3ItYS01N2NmOWY4NGJjLWY0am5sOjky + ODMvIn0iIiIKICAgICAgICBzZWxmLmNtZF9vdXRwdXRfbWFwWwogICAgICAgICAgICAiIiJ7ImVu + dGl0eSI6ICJjbGllbnQuaGVhbHRoY2hlY2tlciIsICJmb3JtYXQiOiAianNvbiIsICJwcmVmaXgi + OiAiYXV0aCBnZXQifSIiIgogICAgICAgIF0gPSAiIiJbeyJlbnRpdHkiOiJjbGllbnQuaGVhbHRo + Y2hlY2tlciIsImtleSI6IkFRREZrYk5lZnQ1YkZSQUFUbmRMTlVTRUtydW96eGlaaTNscmRBPT0i + LCJjYXBzIjp7Im1vbiI6ICJhbGxvdyByLCBhbGxvdyBjb21tYW5kIHF1b3J1bV9zdGF0dXMsIGFs + bG93IGNvbW1hbmQgdmVyc2lvbiIsICJtZ3IiOiAiYWxsb3cgY29tbWFuZCBjb25maWciLCAib3Nk + IjogInByb2ZpbGUgcmJkLXJlYWQtb25seSwgYWxsb3cgcnd4IHBvb2w9ZGVmYXVsdC5yZ3cubWV0 + YSwgYWxsb3cgciBwb29sPS5yZ3cucm9vdCwgYWxsb3cgcncgcG9vbD1kZWZhdWx0LnJndy5jb250 + cm9sLCBhbGxvdyByeCBwb29sPWRlZmF1bHQucmd3LmxvZywgYWxsb3cgeCBwb29sPWRlZmF1bHQu + cmd3LmJ1Y2tldHMuaW5kZXgifX1dIiIiCiAgICAgICAgc2VsZi5jbWRfb3V0cHV0X21hcFsKICAg + ICAgICAgICAgIiIieyJlbnRpdHkiOiAiY2xpZW50LmNzaS1jZXBoZnMtbm9kZSIsICJmb3JtYXQi + OiAianNvbiIsICJwcmVmaXgiOiAiYXV0aCBnZXQifSIiIgogICAgICAgIF0gPSAiIiJbXSIiIgog + ICAgICAgIHNlbGYuY21kX291dHB1dF9tYXBbCiAgICAgICAgICAgICIiInsiZW50aXR5IjogImNs + aWVudC5jc2ktcmJkLW5vZGUiLCAiZm9ybWF0IjogImpzb24iLCAicHJlZml4IjogImF1dGggZ2V0 + In0iIiIKICAgICAgICBdID0gIiIiW10iIiIKICAgICAgICBzZWxmLmNtZF9vdXRwdXRfbWFwWwog + ICAgICAgICAgICAiIiJ7ImVudGl0eSI6ICJjbGllbnQuY3NpLXJiZC1wcm92aXNpb25lciIsICJm + b3JtYXQiOiAianNvbiIsICJwcmVmaXgiOiAiYXV0aCBnZXQifSIiIgogICAgICAgIF0gPSAiIiJb + XSIiIgogICAgICAgIHNlbGYuY21kX291dHB1dF9tYXBbCiAgICAgICAgICAgICIiInsiZW50aXR5 + IjogImNsaWVudC5jc2ktY2VwaGZzLXByb3Zpc2lvbmVyIiwgImZvcm1hdCI6ICJqc29uIiwgInBy + ZWZpeCI6ICJhdXRoIGdldCJ9IiIiCiAgICAgICAgXSA9ICIiIltdIiIiCiAgICAgICAgc2VsZi5j + bWRfb3V0cHV0X21hcFsKICAgICAgICAgICAgIiIieyJlbnRpdHkiOiAiY2xpZW50LmNzaS1jZXBo + ZnMtcHJvdmlzaW9uZXItb3BlbnNoaWZ0LXN0b3JhZ2UiLCAiZm9ybWF0IjogImpzb24iLCAicHJl + Zml4IjogImF1dGggZ2V0In0iIiIKICAgICAgICBdID0gIiIiW10iIiIKICAgICAgICBzZWxmLmNt + ZF9vdXRwdXRfbWFwWwogICAgICAgICAgICAiIiJ7ImVudGl0eSI6ICJjbGllbnQuY3NpLWNlcGhm + cy1wcm92aXNpb25lci1vcGVuc2hpZnQtc3RvcmFnZS1teWZzIiwgImZvcm1hdCI6ICJqc29uIiwg InByZWZpeCI6ICJhdXRoIGdldCJ9IiIiCiAgICAgICAgXSA9ICIiIltdIiIiCiAgICAgICAgc2Vs Zi5jbWRfb3V0cHV0X21hcFsKICAgICAgICAgICAgIiIieyJlbnRpdHkiOiAiY2xpZW50LmNzaS1j - ZXBoZnMtcHJvdmlzaW9uZXItb3BlbnNoaWZ0LXN0b3JhZ2UiLCAiZm9ybWF0IjogImpzb24iLCAi - cHJlZml4IjogImF1dGggZ2V0In0iIiIKICAgICAgICBdID0gIiIiW10iIiIKICAgICAgICBzZWxm - LmNtZF9vdXRwdXRfbWFwWwogICAgICAgICAgICAiIiJ7ImVudGl0eSI6ICJjbGllbnQuY3NpLWNl - cGhmcy1wcm92aXNpb25lci1vcGVuc2hpZnQtc3RvcmFnZS1teWZzIiwgImZvcm1hdCI6ICJqc29u - IiwgInByZWZpeCI6ICJhdXRoIGdldCJ9IiIiCiAgICAgICAgXSA9ICIiIltdIiIiCiAg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X3JlZ194Lm1hdGNoKGhvc3RfbmFtZSk6CiAgICAgICAgICAgIHJldHVy - biBob3N0X25hbWUKICAgICAgICBpbXBvcnQgcmFuZG9tCgogICAgICAgIGhvc3RfaXAgPSBzZWxm - LmR1bW15X2hvc3RfaXBfbWFwLmdldChob3N0X25hbWUsICIiKQogICAgICAgIGlmIG5vdCBob3N0 - X2lwOgogICAgICAgICAgICBob3N0X2lwID0gZiIxNzIuOS57cmFuZG9tLnJhbmRpbnQoMCwgMjU0 - KX0ue3JhbmRvbS5yYW5kaW50KDAsIDI1NCl9IgogICAgICAgICAgICBzZWxmLmR1bW15X2hvc3Rf - aXBfbWFwW2hvc3RfbmFtZV0gPSBob3N0X2lwCiAgICAgICAgZGVsIHJhbmRvbQogICAgICAgIHJl - dHVybiBob3N0X2lwCgogICAgQGNsYXNzbWV0aG9kCiAgICBkZWYgUmFkb3MoY29uZmZpbGU9Tm9u - ZSk6CiAgICAgICAgcmV0dXJuIER1bW15UmFkb3MoKQoKCmNsYXNzIFMzQXV0aChBdXRoQmFzZSk6 - CiAgICAiIiJBdHRhY2hlcyBBV1MgQXV0aGVudGljYXRpb24gdG8gdGhlIGdpdmVuIFJlcXVlc3Qg - b2JqZWN0LiIiIgoKICAgIHNlcnZpY2VfYmFzZV91cmwgPSAiczMuYW1hem9uYXdzLmNvbSIKCiAg - ICBkZWYgX19pbml0X18oc2VsZiwgYWNjZXNzX2tleSwgc2VjcmV0X2tleSwgc2VydmljZV91cmw9 - Tm9uZSk6CiAgICAgICAgaWYgc2VydmljZV91cmw6CiAgICAgICAgICAgIHNlbGYuc2VydmljZV9i - YXNlX3VybCA9IHNlcnZpY2VfdXJsCiAgICAgICAgc2VsZi5hY2Nlc3Nfa2V5ID0gc3RyKGFjY2Vz - c19rZXkpCiAgICAgICAgc2VsZi5zZWNyZXRfa2V5ID0gc3RyKHNlY3JldF9rZXkpCgogICAgZGVm - IF9fY2FsbF9fKHNlbGYsIHIpOgogICAgICAgICMgQ3JlYXR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ZGVmIGdldF9j - YW5vbmljYWxfc3RyaW5nKHNlbGYsIHVybCwgaGVhZGVycywgbWV0aG9kKToKICAgICAgICBwYXJz - ZWR1cmwgPSB1cmxwYXJzZSh1cmwpCiAgICAgICAgb2JqZWN0a2V5ID0gcGFyc2VkdXJsLnBhdGhb - MTpdCgogICAgICAgIGJ1Y2tldCA9IHBhcnNlZHVybC5uZXRsb2NbOiAtbGVuKHNlbGYuc2Vydmlj - ZV9iYXNlX3VybCldCiAgICAgICAgaWYgbGVuKGJ1Y2tldCkgPiAxOgogICAgICAgICAgICAjIHJl - bW92ZSBsYXN0IGRvdAogICAgICAgICAgICBidWNrZXQgPSBidWNrZXRbOi0xXQoKICAgICAgICBp - bnRlcmVzdGluZ19oZWFkZXJzID0geyJjb250ZW50LW1kNSI6ICIiLCAiY29udGVudC10eXBlIjog - IiIsICJkYXRlIjogIiJ9CiAgICAgICAgZm9yIGtleSBpbiBoZWFkZXJzOgogICAgICAgICAgICBs - ayA9IGtleS5sb3dlcigpCiAgICAgICAgICAgIHRyeToKICAgICAgICAgICAgICAgIGxrID0gbGsu - ZGVjb2RlKCJ1dGYtOCIpCiAgICAgICAgICAgIGV4Y2VwdDoKICAgICAgICAgICAgICAgIHBhc3MK - ICAgICAgICAgICAgaWYgaGVhZGVyc1trZXldIGFuZCAoCiAgICAgICAgICAgICAgICBsayBpbiBp - bnRlcmVzdGluZ19oZWFkZXJzLmtleXMoKSBvciBsay5zdGFydHN3aXRoKCJ4LWFtei0iKQogICAg - ICAgICAgICApOgogICAgICAgICAgICAgICAgaW50ZXJlc3RpbmdfaGVhZGVyc1tsa10gPSBoZWFk - ZXJzW2tleV0uc3RyaXAoKQoKICAgICAgICAjIElmIHgtYW16LWRhdGUgaXMgdXNlZCBpdCBzdXBl - cnNlZGVzIHRoZSBkYXRlIGhlYWRlci4KICAgICAgICBpZiBub3QgcHkzazoKICAgICAgICAgICAg - aWYgIngtYW16LWRhdGUiIGluIGludGVyZXN0aW5nX2hlYWRlcnM6CiAgICAgICAgICAgICAgICBp - bnRlcmVzdGluZ19oZWFkZXJzWyJkYXRlIl0gPSAiIgogICAgICAgIGVsc2U6CiAgICAgICAgICAg - IGlmICJ4LWFtei1kYXRlIiBpbiBpbnRlcmVzdGluZ19oZWFkZXJzOgogICAgICAgICAgICAgICAg - aW50ZXJlc3RpbmdfaGVhZGVyc1siZGF0ZSJdID0gIiIKCiAgICAgICAgYnVmID0gZiJ7bWV0aG9k - fVxuIgogICAgICAgIGZvciBrZXkgaW4gc29ydGVkKGludGVyZXN0aW5nX2hlYWRlcnMua2V5cygp - KToKICAgICAgICAgICAgdmFsID0gaW50ZXJlc3RpbmdfaGVhZGVyc1trZXldCiAgICAgICAgICAg - IGlmIGtleS5zdGFydHN3aXRoKCJ4LWFtei0iKToKICAgICAgICAgICAgICAgIGJ1ZiArPSBmIntr - ZXl9Ont2YWx9XG4iCiAgICAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICAgICBidWYgKz0gZiJ7 - dmFsfVxuIgoKICAgICAgICAjIGFwcGVuZCB0aGUgYnVja2V0IGlmIGl0IGV4aXN0cwogICAgICAg - IGlmIGJ1Y2tldCAhPSAiIjoKICAgICAgICAgICAgYnVmICs9IGYiL3tidWNrZXR9IgoKICAgICAg - ICAjIGFkZCB0aGUgb2JqZWN0a2V5LiBldmVuIGlmIGl0IGRvZXNuJ3QgZXhpc3QsIGFkZCB0aGUg - c2xhc2gKICAgICAgICBidWYgKz0gZiIve29iamVjdGtleX0iCgogICAgICAgIHJldHVybiBidWYK - CgpjbGFzcyBSYWRvc0pTT046CiAgICBFWFRFUk5BTF9VU0VSX05BTUUgPSAiY2xpZW50LmhlYWx0 - aGNoZWNrZXIiCiAgICBFWFRFUk5BTF9SR1dfQURNSU5fT1BTX1VTRVJfTkFNRSA9ICJyZ3ctYWRt - aW4tb3BzLXVzZXIiCiAgICBFTVBUWV9PVVRQVVRfTElTVCA9ICJFbXB0eSBvdXRwdXQgbGlzdCIK - ICAgIERFRkFVTFRfUkdXX1BPT0xfUFJFRklYID0gImRlZmF1bHQiCiAgICBERUZBVUxUX01PTklU - T1JJTkdfRU5EUE9JTlRfUE9SVCA9ICI5MjgzIgoKICAgIEBjbGFzc21ldGhvZAogICAgZGVmIGdl - bl9hcmdfcGFyc2VyKGNscywgYXJnc190b19wYXJzZT1Ob25lKToKICAgICAgICBhcmdQID0gYXJn - cGFyc2UuQXJndW1lbnRQYXJzZXIoKQoKICAgICAgICBjb21tb25fZ3JvdXAgPSBhcmdQLmFkZF9h - cmd1bWVudF9ncm91cCgiY29tbW9uIikKICAgICAgICBjb21tb25fZ3JvdXAuYWRkX2FyZ3VtZW50 - KCItLXZlcmJvc2UiLCAiLXYiLCBhY3Rpb249InN0b3JlX3RydWUiLCBkZWZhdWx0PUZhbHNlKQog - ICAgICAgIGNvbW1vbl9ncm91cC5hZGRfYXJndW1lbnQoCiAgICAgICAgICAgICItLWNlcGgtY29u - ZiIsICItYyIsIGhlbHA9IlByb3ZpZGUgYSBjZXBoIGNvbmYgZmlsZS4iLCB0eXBlPXN0cgogICAg - ICAgICkKICAgICAgICBjb21tb25fZ3JvdXAuYWRkX2FyZ3VtZW50KAogICAgICAgICAgICAiLS1r - ZXlyaW5nIiwgIi1rIiwgaGVscD0iUGF0aCB0byBjZXBoIGtleXJpbmcgZmlsZS4iLCB0eXBlPXN0 - cgogICAgICAgICkKICAgICAgICBjb21tb25fZ3JvdXAuYWRkX2FyZ3VtZW50KAogICAgICAgICAg - ICAiLS1ydW4tYXMtdXNlciIsCiAgICAgICAgICAgICItdSIsCiAgICAgICAgICAgIGRlZmF1bHQ9 - IiIsCiAgICAgICAgICAgIHR5cGU9c3RyLAogICAgICAgICAgICBoZWxwPSJQcm92aWRlcyBhIHVz - ZXIgbmFtZSB0byBjaGVjayB0aGUgY2x1c3RlcidzIGhlYWx0aCBzdGF0dXMsIG11c3QgYmUgcHJl - Zml4ZWQgYnkgJ2NsaWVudC4nIiwKICAgICAgICApCiAgICAgICAgY29tbW9uX2dyb3VwLmFkZF9h - cmd1bWVudCgKICAgICAgICAgICAgIi0tY2x1c3Rlci1uYW1lIiwKICAgICAgICAgICAgZGVmYXVs - dD0iIiwKICAgICAgICAgICAgaGVscD0iS3ViZXJuZXRlcyBjbHVzdGVyIG5hbWUobGVnYWN5IGZs - YWcpLCBOb3RlOiBFaXRoZXIgdXNlIHRoaXMgb3IgLS1rOHMtY2x1c3Rlci1uYW1lIiwKICAgICAg - ICApCiAgICAgICAgY29tbW9uX2dyb3VwLmFkZF9hcmd1bWVudCgKICAgICAgICAgICAgIi0tazhz - LWNsdXN0ZXItbmFtZSIsIGRlZmF1bHQ9IiIsIGhlbHA9Ikt1YmVybmV0ZXMgY2x1c3RlciBuYW1l - IgogICAgICAgICkKICAgICAgICBjb21tb25fZ3JvdXAuYWRkX2FyZ3VtZW50KAogICAgICAgICAg - ICAiLS1uYW1lc3BhY2UiLAogICAgICAgICAgICBkZWZhdWx0PSIiLAogICAgICAgICAgICBoZWxw - PSJOYW1lc3BhY2Ugd2hlcmUgQ2VwaENsdXN0ZXIgaXMgcnVubmluZyIsCiAgICAgICAgKQogICAg - ICAgIGNvbW1vbl9ncm91cC5hZGRfYXJndW1lbnQoCiAgICAgICAgICAgICItLXJndy1wb29sLXBy - ZWZpeCIsIGRlZmF1bHQ9IiIsIGhlbHA9IlJHVyBQb29sIHByZWZpeCIKICAgICAgICApCiAgICAg - ICAgY29tbW9uX2dyb3VwLmFkZF9hcmd1bWVudCgKICAgICAgICAgICAgIi0tcmVzdHJpY3RlZC1h - dXRoLXBlcm1pc3Npb24iLAogICAgICAgICAgICBkZWZhdWx0PUZhbHNlLAogICAgICAgICAgICBo - ZWxwPSJSZXN0cmljdCBjZXBoQ1NJS2V5cmluZ3MgYXV0aCBwZXJtaXNzaW9ucyB0byBzcGVjaWZp - YyBwb29scywgY2x1c3Rlci4iCiAgICAgICAgICAgICsgIk1hbmRhdG9yeSBmbGFncyB0aGF0IG5l - ZWQgdG8gYmUg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cmVfdHJ1ZSIsCiAgICAgICAgICAgIGRlZmF1bHQ9RmFsc2UsCiAgICAgICAgICAgIGhlbHA9 - IkVuYWJsZSB2MiBtb24gcG9ydCgzMzAwKSBmb3IgbW9ucyIsCiAgICAgICAgKQoKICAgICAgICBv - dXRwdXRfZ3JvdXAgPSBhcmdQLmFkZF9hcmd1bWVudF9ncm91cCgib3V0cHV0IikKICAgICAgICBv - dXRwdXRfZ3JvdXAuYWRkX2FyZ3VtZW50KAogICAgICAgICAgICAiLS1mb3JtYXQiLAogICAgICAg - ICAgICAiLXQiLAogICAgICAgICAgICBjaG9pY2VzPVsianNvbiIsICJiYXNoIl0sCiAgICAgICAg - ICAgIGRlZmF1bHQ9Impzb24iLAogICAgICAgICAgICBoZWxwPSJQcm92aWRlcyB0aGUgb3V0cHV0 - IGZvcm1hdCAoanNvbiB8IGJhc2gpIiwKICAgICAgICApCiAgICAgICAgb3V0cHV0X2dyb3VwLmFk - ZF9hcmd1bWVudCgKICAgICAgICAgICAgIi0tb3V0cHV0IiwKICAgICAgICAgICAgIi1vIiwKICAg - ICAgICAgICAgZGVmYXVsdD0iIiwKICAgICAgICAgICAgaGVscD0iT3V0cHV0IHdpbGwgYmUgc3Rv - cmVkIGludG8gdGhlIHByb3ZpZGVkIGZpbGUiLAogICAgICAgICkKICAgICAgICBvdXRwdXRfZ3Jv - dXAuYWRkX2FyZ3VtZW50KAogICAgICAgICAgICAiLS1jZXBoZnMtZmlsZXN5c3RlbS1uYW1lIiwK - ICAgICAgICAgICAgZGVmYXVsdD0iIiwKICAgICAgICAgICAgaGVscD0iUHJvdmlkZXMgdGhlIG5h - bWUgb2YgdGhlIENlcGggZmlsZXN5c3RlbSIsCiAgICAgICAgKQogICAgICAgIG91dHB1dF9ncm91 - cC5hZGRfYXJndW1lbnQoCiAgICAgICAgICAgICItLWNlcGhmcy1tZXRhZGF0YS1wb29sLW5hbWUi - LAogICAgICAgICAgICBkZWZhdWx0PSIiLAogICAgICAgICAgICBoZWx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h + ZyBjZXBoZnMgbWV0YWRhdGE9KiJdLCAiZW50aXR5IjogImNsaWVudC5jc2ktY2VwaGZzLXByb3Zp + c2lvbmVyIiwgImZvcm1hdCI6ICJqc29uIiwgInByZWZpeCI6ICJhdXRoIGNhcHMifSIiIgogICAg + ICAgIF0gPSAiIiJbeyJlbnRpdHkiOiJjbGllbnQuY3NpLWNlcGhmcy1wcm92aXNpb25lciIsImtl + eSI6IkFRREZrYk5lZnQ1YkZSQUFUbmRMTlVTRUtydW96eGlaaTNscmRBPT0iLCJjYXBzIjp7Im1v + biI6ImFsbG93IHIsICBhbGxvdyBjb21tYW5kICdvc2QgYmxvY2tsaXN0JyIsICJtZ3IiOiJhbGxv + dyBydyIsICJvc2QiOiJhbGxvdyBydyB0YWcgY2VwaGZzIG1ldGFkYXRhPSoifX1dIiIiCiAgICAg + ICAgc2VsZi5jbWRfb3V0cHV0X21hcFsneyJmb3JtYXQiOiAianNvbiIsICJwcmVmaXgiOiAic3Rh + dHVzIn0nXSA9IGNlcGhfc3RhdHVzX3N0cgoKICAgIGRlZiBzaHV0ZG93bihzZWxmKToKICAgICAg + ICBwYXNzCgogICAgZGVmIGdldF9mc2lkKHNlbGYpOgogICAgICAgIHJldHVybiAiYWY0ZTE2NzMt + MGI3Mi00MDJkLTk5MGEtMjJkMjkxOWQwZjFjIgoKICAgIGRlZiBjb25mX3JlYWRfZmlsZShzZWxm + KToKICAgICAgICBwYXNzCgogICAgZGVmIGNvbm5lY3Qoc2VsZik6CiAgICAgICAgcGFzcwoKICAg + IGRlZiBwb29sX2V4aXN0cyhzZWxmLCBwb29sX25hbWUpOgogICAgICAgIHJldHVybiBUcnVlCgog + ICAgZGVmIG1vbl9jb21tYW5kKHNlbGYsIGNtZCwgb3V0KToKICAgICAgICBqc29uX2NtZCA9IGpz + b24ubG9hZHMoY21kKQogICAgICAgIGpzb25fY21kX3N0ciA9IGpzb24uZHVtcHMoanNvbl9jbWQs + IHNvcnRfa2V5cz1UcnVlKQogICAgICAgIGNtZF9vdXRwdXQgPSBzZWxmLmNtZF9vdXRwdXRfbWFw + W2pzb25fY21kX3N0cl0KICAgICAgICByZXR1cm4gc2VsZi5yZXR1cm5fdmFsLCBjbWRfb3V0cHV0 + LCBzdHIoc2VsZi5lcnJfbWVzc2FnZS5lbmNvZGUoInV0Zi04IikpCgogICAgZGVmIF9jb252ZXJ0 + X2hvc3RuYW1lX3RvX2lwKHNlbGYsIGhvc3RfbmFtZSk6CiAgICAgICAgaXBfcmVnX3ggPSByZS5j + b21waWxlKHIiXGR7MSwzfS5cZHsxLDN9LlxkezEsM30uXGR7MSwzfSIpCiAgICAgICAgIyBpZiBw + cm92aWRlZCBob3N0IGlzIGRpcmVjdGx5IGFuIElQIGFkZHJlc3MsIHJldHVybiB0aGUgc2FtZQog + ICAgICAgIGlmIGlwX3JlZ194Lm1hdGNoKGhvc3RfbmFtZSk6CiAgICAgICAgICAgIHJldHVybiBo + b3N0X25hbWUKICAgICAgICBpbXBvcnQgcmFuZG9tCgogICAgICAgIGhvc3RfaXAgPSBzZWxmLmR1 + bW15X2hvc3RfaXBfbWFwLmdldChob3N0X25hbWUsICIiKQogICAgICAgIGlmIG5vdCBob3N0X2lw + OgogICAgICAgICAgICBob3N0X2lwID0gZiIxNzIuOS57cmFuZG9tLnJhbmRpbnQoMCwgMjU0KX0u + e3JhbmRvbS5yYW5kaW50KDAsIDI1NCl9IgogICAgICAgICAgICBzZWxmLmR1bW15X2hvc3RfaXBf + bWFwW2hvc3RfbmFtZV0gPSBob3N0X2lwCiAgICAgICAgZGVsIHJhbmRvbQogICAgICAgIHJldHVy + biBob3N0X2lwCgogICAgQGNsYXNzbWV0aG9kCiAgICBkZWYgUmFkb3MoY29uZmZpbGU9Tm9uZSk6 + CiAgICAgICAgcmV0dXJuIER1bW15UmFkb3MoKQoKCmNsYXNzIFMzQXV0aChBdXRoQmFzZSk6CiAg + ICAiIiJBdHRhY2hlcyBBV1MgQXV0aGVudGljYXRpb24gdG8gdGhlI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ZWFkZXJzLCBy + Lm1ldGhvZCkKICAgICAgICBrZXkgPSBzZWxmLnNlY3JldF9rZXkuZW5jb2RlKCJ1dGYtOCIpCiAg + ICAgICAgbXNnID0gY2Fub25pY2FsX3N0cmluZy5lbmNvZGUoInV0Zi04IikKICAgICAgICBoID0g + aG1hYy5uZXcoa2V5LCBtc2csIGRpZ2VzdG1vZD1zaGEpCiAgICAgICAgcmV0dXJuIGVuY29kZXN0 + cmluZyhoLmRpZ2VzdCgpKS5zdHJpcCgpCgogICAgZGVmIGdldF9jYW5vbmljYWxfc3RyaW5nKHNl + bGYsIHVybCwgaGVhZGVycywgbWV0aG9kKToKICAgICAgICBwYXJzZWR1cmwgPSB1cmxwYXJzZSh1 + cmwpCiAgICAgICAgb2JqZWN0a2V5ID0gcGFyc2VkdXJsLnBhdGhbMTpdCgogICAgICAgIGJ1Y2tl + dCA9IHBhcnNlZHVybC5uZXRsb2NbOiAtbGVuKHNlbGYuc2VydmljZV9iYXNlX3VybCldCiAgICAg + ICAgaWYgbGVuKGJ1Y2tldCkgPiAxOgogICAgICAgICAgICAjIHJlbW92ZSBsYXN0IGRvdAogICAg + ICAgICAgICBidWNrZXQgPSBidWNrZXRbOi0xXQoKICAgICAgICBpbnRlcmVzdGluZ19oZWFkZXJz + ID0geyJjb250ZW50LW1kNSI6ICIiLCAiY29udGVudC10eXBlIjogIiIsICJkYXRlIjogIiJ9CiAg + ICAgICAgZm9yIGtleSBpbiBoZWFkZXJzOgogICAgICAgICAgICBsayA9IGtleS5sb3dlcigpCiAg + ICAgICAgICAgIHRyeToKICAgICAgICAgICAgICAgIGxrID0gbGsuZGVjb2RlKCJ1dGYtOCIpCiAg + ICAgICAgICAgIGV4Y2VwdDoKICAgICAgICAgICAgICAgIHBhc3MKICAgICAgICAgICAgaWYgaGVh + ZGVyc1trZXldIGFuZCAoCiAgICAgICAgICAgICAgICBsayBpbiBpbnRlcmVzdGluZ19oZWFkZXJz + LmtleXMoKSBvciBsay5zdGFydHN3aXRoKCJ4LWFtei0iKQogICAgICAgICAgICApOgogICAgICAg + ICAgICAgICAgaW50ZXJlc3RpbmdfaGVhZGVyc1tsa10gPSBoZWFkZXJzW2tleV0uc3RyaXAoKQoK + ICAgICAgICAjIElmIHgtYW16LWRhdGUgaXMgdXNlZCBpdCBzdXBlcnNlZGVzIHRoZSBkYXRlIGhl + YWRlci4KICAgICAgICBpZiAieC1hbXotZGF0ZSIgaW4gaW50ZXJlc3RpbmdfaGVhZGVyczoKICAg + ICAgICAgICAgaW50ZXJlc3RpbmdfaGVhZGVyc1siZGF0ZSJdID0gIiIKCiAgICAgICAgYnVmID0g + ZiJ7bWV0aG9kfVxuIgogICAgICAgIGZvciBrZXkgaW4gc29ydGVkKGludGVyZXN0aW5nX2hlYWRl + cnMua2V5cygpKToKICAgICAgICAgICAgdmFsID0gaW50ZXJlc3RpbmdfaGVhZGVyc1trZXldCiAg + ICAgICAgICAgIGlmIGtleS5zdGFydHN3aXRoKCJ4LWFtei0iKToKICAgICAgICAgICAgICAgIGJ1 + ZiArPSBmIntrZXl9Ont2YWx9XG4iCiAgICAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICAgICBi + dWYgKz0gZiJ7dmFsfVxuIgoKICAgICAgICAjIGFwcGVuZCB0aGUgYnVja2V0IGlmIGl0IGV4aXN0 + cwogICAgICAgIGlmIGJ1Y2tldCAhPSAiIjoKICAgICAgICAgICAgYnVmICs9IGYiL3tidWNrZXR9 + IgoKICAgICAgICAjIGFkZCB0aGUgb2JqZWN0a2V5LiBldmVuIGlmIGl0IGRvZXNuJ3QgZXhpc3Qs + IGFkZCB0aGUgc2xhc2gKICAgICAgICBidWYgKz0gZiIve29iamVjdGtleX0iCgogICAgICAgIHJl + dHVybiBidWYKCgpjbGFzcyBSYWRvc0pTT046CiAgICBFWFRFUk5BTF9VU0VSX05BTUUgPSAiY2xp + ZW50LmhlYWx0aGNoZWNrZXIiCiAgICBFWFRFUk5BTF9SR1dfQURNSU5fT1BTX1VTRVJfTkFNRSA9 + ICJyZ3ctYWRtaW4tb3BzLXVzZXIiCiAgICBFTVBUWV9PVVRQVVRfTElTVCA9ICJFbXB0eSBvdXRw + dXQgbGlzdCIKICAgIERFRkFVTFRfUkdXX1BPT0xfUFJFRklYID0gImRlZmF1bHQiCiAgICBERUZB + VUxUX01PTklUT1JJTkdfRU5EUE9JTlRfUE9SVCA9ICI5MjgzIgoKICAgIEBjbGFzc21ldGhvZAog + ICAgZGVmIGdlbl9hcmdfcGFyc2VyKGNscywgYXJnc190b19wYXJzZT1Ob25lKToKICAgICAgICBh + cmdQID0gYXJncGFyc2UuQXJndW1lbnRQYXJzZXIoKQoKICAgICAgICBjb21tb25fZ3JvdXAgPSBh + cmdQLmFkZF9hcmd1bWVudF9ncm91cCgiY29tbW9uIikKICAgICAgICBjb21tb25fZ3JvdXAuYWRk + X2FyZ3VtZW50KCItLXZlcmJvc2UiLCAiLXYiLCBhY3Rpb249InN0b3JlX3RydWUiLCBkZWZhdWx0 + PUZhbHNlKQogICAgICAgIGNvbW1vbl9ncm91cC5hZGRfYXJndW1lbnQoCiAgICAgICAgICAgICIt + LWNlcGgtY29uZiIsICItYyIsIGhlbHA9IlByb3ZpZGUgYSBjZXBoIGNvbmYgZmlsZS4iLCB0eXBl + PXN0cgogICAgICAgICkKICAgICAgICBjb21tb25fZ3JvdXAuYWRkX2FyZ3VtZW50KAogICAgICAg + ICAgICAiLS1rZXlyaW5nIiwgIi1rIiwgaGVscD0iUGF0aCB0byBjZXBoIGtleXJpbmcgZmlsZS4i + LCB0eXBlPXN0cgogICAgICAgICkKICAgICAgICBjb21tb25fZ3JvdXAuYWRkX2FyZ3VtZW50KAog + ICAgICAgICAgICAiLS1ydW4tYXMtdXNlciIsCiAgICAgICAgICAgICItdSIsCiAgICAgICAgICAg + IGRlZmF1bHQ9IiIsCiAgICAgICAgICAgIHR5cGU9c3RyLAogICAgICAgICAgICBoZWxwPSJQcm92 + aWRlcyBhIHVzZXIgbmFtZSB0byBjaGVjayB0aGUgY2x1c3RlcidzIGhlYWx0aCBzdGF0dXMsIG11 + c3QgYmUgcHJlZml4ZWQgYnkgJ2NsaWVudC4nIiwKICAgICAgICApCiAgICAgICAgY29tbW9uX2dy + b3VwLmFkZF9hcmd1bWVudCgKICAgICAgICAgICAgIi0tY2x1c3Rlci1uYW1lIiwKICAgICAgICAg + ICAgZGVmYXVsdD0iIiwKICAgICAgICAgICAgaGVscD0iS3ViZXJuZXRlcyBjbHVzdGVyIG5hbWUo + bGVnYWN5IGZsYWcpLCBOb3RlOiBFaXRoZXIgdXNlIHRoaXMgb3IgLS1rOHMtY2x1c3Rlci1uYW1l + IiwKICAgICAgICApCiAgICAgICAgY29tbW9uX2dyb3VwLmFkZF9hcmd1bWVudCgKICAgICAgICAg + ICAgIi0tazhzLWNsdXN0ZXItbmFtZSIsIGRlZmF1bHQ9IiIsIGhlbHA9Ikt1YmVybmV0ZXMgY2x1 + c3RlciBuYW1lIgogICAgICAgICkKICAgICAgICBjb21tb25fZ3JvdXAuYWRkX2FyZ3VtZW50KAog + ICAgICAgICAgICAiLS1uYW1lc3BhY2UiLAogICAgICAgICAgICBkZWZhdWx0PSIiLAogICAgICAg + ICAgICBoZWxwPSJOYW1lc3BhY2Ugd2hlcmUgQ2VwaENsdXN0ZXIgaXMgcnVubmluZyIsCiAgICAg + ICAgKQogICAgICAgIGNvbW1vbl9ncm91cC5hZGRfYXJndW1lbnQoCiAgICAgICAgICAgICItLXJn + dy1wb29sLXByZWZpeCIsIGRlZmF1bHQ9IiIsIGhlbHA9IlJHVyBQb29sIHByZWZpeCIKICAgICAg + ICApCiAgICAgICAgY29tbW9uX2dyb3VwLmFkZF9hcmd1bWVudCgKICAgICAgICAgICAgIi0tcmVz + dHJpY3RlZC1hdXRoLXBlcm1pc3Npb24iLAogICAgICAgICAgICBkZWZhdWx0PUZhbHNlLAogICAg + ICAgICAgICBoZWxwPSJSZXN0cmljdCBjZXBoQ1NJS2V5cmluZ3MgYXV0aCBwZXJta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Bjb21tb25fZ3JvdXAu + YWRkX2FyZ3VtZW50KAogICAgICAgICAgICAiLS12Mi1wb3J0LWVuYWJsZSIsCiAgICAgICAgICAg + IGFjdGlvbj0ic3RvcmVfdHJ1ZSIsCiAgICAgICAgICAgIGRlZmF1bHQ9RmFsc2UsCiAgICAgICAg + ICAgIGhlbHA9IkVuYWJsZSB2MiBtb24gcG9ydCgzMzAwKSBmb3IgbW9ucyIsCiAgICAgICAgKQoK + ICAgICAgICBvdXRwdXRfZ3JvdXAgPSBhcmdQLmFkZF9hcmd1bWVudF9ncm91cCgib3V0cHV0IikK + ICAgICAgICBvdXRwdXRfZ3JvdXAuYWRkX2FyZ3VtZW50KAogICAgICAgICAgICAiLS1mb3JtYXQi + LAogICAgICAgICAgICAiLXQiLAogICAgICAgICAgICBjaG9pY2VzPVsianNvbiIsICJiYXNoIl0s + CiAgICAgICAgICAgIGRlZmF1bHQ9Impzb24iLAogICAgICAgICAgICBoZWxwPSJQcm92aWRlcyB0 + aGUgb3V0cHV0IGZvcm1hdCAoanNvbiB8IGJhc2gpIiwKICAgICAgICApCiAgICAgICAgb3V0cHV0 + X2dyb3VwLmFkZF9hcmd1bWVudCgKICAgICAgICAgICAgIi0tb3V0cHV0IiwKICAgICAgICAgICAg + Ii1vIiwKICAgICAgICAgICAgZGVmYXVsdD0iIiwKICAgICAgICAgICAgaGVscD0iT3V0cHV0IHdp + bGwgYmUgc3RvcmVkIGludG8gdGhlIHByb3ZpZGVkIGZpbGUiLAogICAgICAgICkKICAgICAgICBv + dXRwdXRfZ3JvdXAuYWRkX2FyZ3VtZW50KAogICAgICAgICAgICAiLS1jZXBoZnMtZmlsZXN5c3Rl + bS1uYW1lIiwKICAgICAgICAgICAgZGVmYXVsdD0iIiwKICAgICAgICAgICAgaGVscD0iUHJvdmlk + ZXMgdGhlIG5hbWUgb2YgdGhlIENlcGggZmlsZXN5c3RlbSIsCiAgICAgICAgKQogICAgICAgIG91 + dHB1dF9ncm91cC5hZGRfYXJndW1lbnQoCiAgICAgICAgICAgICItLWNlcGhmcy1tZXRhZGF0YS1w + b29sLW5hbWUiLAogICAgICAgICAgICBkZWZhdWx0PSIiLAogICAgICAgICAgICBoZWxwPSJQcm92 + aWRlcyB0aGUgbmFtZSBvZiB0aGUgY2VwaGZzIG1ldGFkYXRhIHBvb2wiLAogICAgICAgICkKICAg + ICAgICBvdXRwdXRfZ3JvdXAuYWRkX2FyZ3VtZW50KAogICAgICAgICAgICAiLS1jZXBoZnMtZGF0 + YS1wb29sLW5hbWUiLAogICAgICAgICAgICBkZWZhdWx0PSIiLAogICAgICAgICAgICBoZWxwPSJQ + cm92aWRlcyB0aGUgbmFtZSBvZiB0aGUgY2VwaGZzIGRhdGEgcG9vbCIsCiAgICAgICAgKQogICAg + ICAgIG91dHB1dF9ncm91cC5hZGRfYXJndW1lbnQoCiAgICAgICAgICAgICItLXJiZC1kYXRhLXBv + b2wtbmFtZSIsCiAgICAgICAgICAgIGRlZmF1bHQ9IiIsCiAgICAgICAgICAgIHJlcXVpcmVkPUZh + bHNlLAogICAgICAgICAgICBoZWxwPSJQcm92aWRlcyB0aGUgbmFtZSBvZiB0aGUgUkJEIGRhdGFw + b29sIiwKICAgICAgICApCiAgICAgICAgb3V0cHV0X2dyb3VwLmFkZF9hcmd1bWVudCgKICAgICAg + ICAgICAgIi0tYWxpYXMtcmJkLWRhdGEtcG9vbC1uYW1lIiwKICAgICAgICAgICAgZGVmYXVsdD0i + IiwKICAgICAgICAgICAgcmVxdWlyZWQ9RmFsc2UsCiAgICAgICAgICAgIGhlbHA9IlByb3ZpZGVz + IGFuIGFsaWFzIGZvciB0aGUgIFJCRCBkYXRhIHBvb2wgbmFtZSwgbmVjZXNzYXJ5IGlmIGEgc3Bl + Y2lhbCBjaGFyYWN0ZXIgaXMgcHJlc2VudCBpbiB0aGUgcG9vbCBuYW1lIHN1Y2ggYXMgYSBwZXJp + b2Qgb3IgdW5kZXJzY29yZSIsCiAgICAgICAgKQogICAgICAgIG91dHB1dF9ncm91cC5hZGRfYXJn + dW1lbnQoCiAgICAgICAgICAgICItLXJndy1lbmRwb2ludCIsCiAgICAgICAgICAgIGRlZmF1bHQ9 + IiIsCiAgICAgICAgICAgIHJlcXVpcmVkPUZhbHNlLAogICAgICAgICAgICBoZWxwPSJSQURPUyBH + YXRld2F5IGVuZHBvaW50IChpbiBgPElQdjQ+OjxQT1JUPmAgb3IgYDxbSVB2Nl0+OjxQT1JUPmAg + b3IgYDxGUUROPjo8UE9SVD5gIGZvcm1hdCkiLAogICAgICAgICkKICAgICAgICBvdXRwdXRfZ3Jv + dXAuYWRkX2FyZ3VtZW50KAogICAgICAgICAgICAiLS1yZ3ctdGxzLWNlcnQtcGF0aCIsCiAgICAg + ICAgICAgIGRlZmF1bHQ9IiIsCiAgICAgICAgICAgIHJlcXVpcmVkPUZhbHNlLAogICAgICAgICAg + ICBoZWxwPSJSQURPUyBHYXRld2F5IGVuZHBvaW50IFRMUyBjZXJ0aWZpY2F0ZSIsCiAgICAgICAg + KQogICAgICAgIG91dHB1dF9ncm91cC5hZGRfYXJndW1lbnQoCiAgICAgICAgICAgICItLXJndy1z + a2lwLXRscyIsCiAgICAgICAgICAgIHJlcXVpcmVkPUZhbHNlLAogICAgICAgICAgICBkZWZhdWx0 + PUZhbHNlLAogICAgICAgICAgICBoZWxwPSJJZ25vcmUgVExTIGNlcnRpZmljYXRpb24gdmFsaWRh + dGlvbiB3aGVuIGEgc2VsZi1zaWduZWQgY2VydGlmaWNhdGUgaXMgcHJvdmlkZWQgKE5PVCBSRUNP + TU1FTkRFRCIsCiAgICAgICAgKQogICAgICAgIG91dHB1dF9ncm91cC5hZGRfYXJndW1lbnQoCiAg + ICAgICAgICAgICItLW1vbml0b3JpbmctZW5kcG9pbnQiLAogICAgICAgICAgICBkZWZhdWx0PSIi + LAogICAgICAgICAgICByZXF1aXJlZD1GYWxzZSwKICAgICAgICAgICAgaGVscD0iQ2VwaCBNYW5h + Z2VyIHByb21ldGhldXMgZXhwb3J0ZXIgZW5kcG9pbnRzIChjb21tYSBzZXBhcmF0ZWQgbGlzdCBv + ZiAoZm9ybWF0IGA8SVB2ND5gIG9yIGA8W0lQdjZdPmAgb3IgYDxGUUROPmApIGVudHJpZXMgb2Yg + YWN0aXZlIGFuZCBzdGFuZGJ5IG1ncnMpIiwKICAgICAgICApCiAgICAgICAgb3V0cHV0X2dyb3Vw + LmFkZF9hcmd1bWVudCgKICAgICAgICAgICAgIi0tbW9uaXRvcmluZy1lbmRwb2ludC1wb3J0IiwK + ICAgICAgICAgICAgZGVmYXVsdD0iIiwKICAgICAgICAgICAgcmVxdWlyZWQ9RmFsc2UsCiAgICAg + ICAgICAgIGhlbHA9IkNlcGggTWFuYWdlciBwcm9tZXRoZXVzIGV4cG9ydGVyIHBvcnQiLAogICAg + ICAgICkKICAgICAgICBvdXRwdXRfZ3JvdXAuYWRkX2FyZ3VtZW50KAogICAgICAgICAgICAiLS1z + a2lwLW1vbml0b3JpbmctZW5kcG9pbnQiLAogICAgICAgICAgICBkZWZhdWx0PUZhbHNlLAogICAg + ICAgICAgICBhY3Rpb249InN0b3JlX3RydWUiLAogICAgICAgICAgICBoZWxwPSJEbyBub3QgY2hl + Y2sgZm9yIGEgbW9uaXRvcmluZyBlbmRwb2ludCBmb3IgdGhlIENlcGggY2x1c3RlciIsCiAgICAg + ICAgKQogICAgICAgIG91dHB1dF9ncm91cC5hZGRfYXJndW1lbnQoCiAgICAgICAgICAgICItLXJi + ZC1tZXRhZGF0YS1lYy1wb29sLW5hbWUiLAogICAgICAgICAgICBkZWZhdWx0PSIiLAogICAgICAg + ICAgICByZXF1aXJlZD1GYWxzZSwKICAgICAgICAgICAgaGVscD0iUHJvdmlkZXMgdGhlIG5hbWUg + b2YgZXJhc3VyZSBjb2RlZCBSQkQgbWV0YWRhdGEgcG9vbCIsCiAgICAgICAgKQogICAgICAgIG91 + dHB1dF9ncm91cC5hZGRfYXJndW1lbnQoCiAgICAgICAgICAgICItLWRyeS1ydW4iLAogICAgICAg + ICAgICBkZWZhdWx0PUZhbHNlLAogICAgICAgICAgICBhY3Rpb249InN0b3JlX3RydWUiLAogICAg + ICAgICAgICBoZWxwPSJEcnkgcnVuIHByaW50cyB0aGUgZXhlY3V0ZWQgY29tbWFuZHMgd2l0aG91 + dCBydW5uaW5nIHRoZW0iLAogICAgICAgICkKICAgICAgICBvdXRwdXRfZ3JvdXAuYWRkX2FyZ3Vt + ZW50KAogICAgICAgICAgICAiLS1yYWRvcy1uYW1lc3BhY2UiLAogICAgICAgICAgICBkZWZhdWx0 + PSIiLAogICAgICAgICAgICByZXF1aXJlZD1GYWxzZSwKICAgICAgICAgICAgaGVscD0iRGl2aWRl + cyBhIHBvb2wgaW50byBzZXBhcmF0ZSBsb2dpY2FsIG5hbWVzcGFjZXMsIHVzZWQgZm9yIGNyZWF0 + aW5nIFJCRCBQVkMgaW4gYSBDZXBoQmxvY2tQb29sUmFkb3NOYW1lc3BhY2UgKHNob3VsZCBiZSBs + b3dlciBjYXNlKSIsCiAgICAgICAgKQogICAgICAgIG91dHB1dF9ncm91cC5hZGRfYXJndW1lbnQo + CiAgICAgICAgICAgICItLXN1YnZvbHVtZS1ncm91cCIsCiAgICAgICAgICAgIGRlZmF1bHQ9IiIs + CiAgICAgICAgICAgIHJlcXVpcmVkPUZhbHNlLAogICAgICAgICAgICBoZWxwPSJwcm92aWRlcyB0 + aGUgbmFtZSBvZiB0aGUgc3Vidm9sdW1lIGdyb3VwIiwKICAgICAgICApCiAgICAgICAgb3V0cHV0 + X2dyb3VwLmFkZF9hcmd1bWVudCgKICAgICAgICAgICAgIi0tcmd3LXJlYWxtLW5hbWUiLAogICAg + ICAgICAgICBkZWZhdWx0PSIiLAogICAgICAgICAgICByZXF1aXJlZD1GYWxzZSwKICAgICAgICAg + ICAgaGVscD0icHJvdmlkZXMgdGhlIG5hbWUgb2YgdGhlIHJndy1yZWFsbSIsCiAgICAgICAgKQog + ICAgICAgIG91dHB1dF9ncm91cC5hZGRfYXJndW1lbnQoCiAgICAgICAgICAgICItLXJndy16b25l + LW5hbWUiLAogICAgICAgICAgICBkZWZhdWx0PSIiLAogICAgICAgICAgICByZXF1aXJlZD1GYWxz + ZSwKICAgICAgICAgICAgaGVscD0icHJvdmlkZXMgdGhlIG5hbWUgb2YgdGhlIHJndy16b25lIiwK + ICAgICAgICApCiAgICAgICAgb3V0cHV0X2dyb3VwLmFkZF9hcmd1bWVudCgKICAgICAgICAgICAg + Ii0tcmd3LXpvbmVncm91cC1uYW1lIiwKICAgICAgICAgICAgZGVmYXVsdD0iIiwKICAgICAgICAg + ICAgcmVxdWlyZWQ9RmFsc2UsCiAgICAgICAgICAgIGhlbHA9InByb3ZpZGVzIHRoZSBuYW1lIG9m + IHRoZSByZ3ctem9uZWdyb3VwIiwKICAgICAgICApCiAgICAgICAgb3V0cHV0X2dyb3VwLmFkZF9h + cmd1bWVudCgKICAgICAgICAgICAgIi0tdG9wb2xvZ3ktcG9vbHMiLAogICAgICAgICAgICBkZWZh + dWx0PSIiLAogICAgICAgICAgICByZXF1aXJlZD1GYWxzZSwKICAgICAgICAgICAgaGVscD0iY29t + bWEtc2VwYXJhdGVkIGxpc3Qgb2YgdG9wb2xvZ3ktY29uc3RyYWluZWQgcmJkIHBvb2xzIiwKICAg ICAgICApCiAgICAgICAgb3V0cHV0X2dyb3VwLmFkZF9hcmd1bWVudCgKICAgICAgICAgICAgIi0t - YWxpYXMtcmJkLWRhdGEtcG9vbC1uYW1lIiwKICAgICAgICAgICAgZGVmYXVsdD0iIiwKICAgICAg - ICAgICAgcmVxdWlyZWQ9RmFsc2UsCiAgICAgICAgICAgIGhlbHA9IlByb3ZpZGVzIGFuIGFsaWFz - IGZvciB0aGUgIFJCRCBkYXRhIHBvb2wgbmFtZSwgbmVjZXNzYXJ5IGlmIGEgc3BlY2lhbCBjaGFy - YWN0ZXIgaXMgcHJlc2VudCBpbiB0aGUgcG9vbCBuYW1lIHN1Y2ggYXMgYSBwZXJpb2Qgb3IgdW5k - ZXJzY29yZSIsCiAgICAgICAgKQogICAgICAgIG91dHB1dF9ncm91cC5hZGRfYXJndW1lbnQoCiAg - ICAgICAgICAgICItLXJndy1lbmRwb2ludCIsCiAgICAgICAgICAgIGRlZmF1bHQ9IiIsCiAgICAg - ICAgICAgIHJlcXVpcmVkPUZhbHNlLAogICAgICAgICAgICBoZWxwPSJSQURPUyBHYXRld2F5IGVu - ZHBvaW50IChpbiBgPElQdjQ+OjxQT1JUPmAgb3IgYDxbSVB2Nl0+OjxQT1JUPmAgb3IgYDxGUURO - Pjo8UE9SVD5gIGZvcm1hdCkiLAogICAgICAgICkKICAgICAgICBvdXRwdXRfZ3JvdXAuYWRkX2Fy - Z3VtZW50KAogICAgICAgICAgICAiLS1yZ3ctdGxzLWNlcnQtcGF0aCIsCiAgICAgICAgICAgIGRl - ZmF1bHQ9IiIsCiAgICAgICAgICAgIHJlcXVpcmVkPUZhbHNlLAogICAgICAgICAgICBoZWxwPSJS - QURPUyBHYXRld2F5IGVuZHBvaW50IFRMUyBjZXJ0aWZpY2F0ZSIsCiAgICAgICAgKQogICAgICAg - IG91dHB1dF9ncm91cC5hZGRfYXJndW1lbnQoCiAgICAgICAgICAgICItLXJndy1za2lwLXRscyIs - CiAgICAgICAgICAgIHJlcXVpcmVkPUZhbHNlLAogICAgICAgICAgICBkZWZhdWx0PUZhbHNlLAog - ICAgICAgICAgICBoZWxwPSJJZ25vcmUgVExTIGNlcnRpZmljYXRpb24gdmFsaWRhdGlvbiB3aGVu - IGEgc2VsZi1zaWduZWQgY2VydGlmaWNhdGUgaXMgcHJvdmlkZWQgKE5PVCBSRUNPTU1FTkRFRCIs - CiAgICAgICAgKQogICAgICAgIG91dHB1dF9ncm91cC5hZGRfYXJndW1lbnQoCiAgICAgICAgICAg - ICItLW1vbml0b3JpbmctZW5kcG9pbnQiLAogICAgICAgICAgICBkZWZhdWx0PSIiLAogICAgICAg - ICAgICByZXF1aXJlZD1GYWxzZSwKICAgICAgICAgICAgaGVscD0iQ2VwaCBNYW5hZ2VyIHByb21l - dGhldXMgZXhwb3J0ZXIgZW5kcG9pbnRzIChjb21tYSBzZXBhcmF0ZWQgbGlzdCBvZiAoZm9ybWF0 - IGA8SVB2ND5gIG9yIGA8W0lQdjZdPmAgb3IgYDxGUUROPmApIGVudHJpZXMgb2YgYWN0aXZlIGFu - ZCBzdGFuZGJ5IG1ncnMpIiwKICAgICAgICApCiAgICAgICAgb3V0cHV0X2dyb3VwLmFkZF9hcmd1 - bWVudCgKICAgICAgICAgICAgIi0tbW9uaXRvcmluZy1lbmRwb2ludC1wb3J0IiwKICAgICAgICAg - ICAgZGVmYXVsdD0iIiwKICAgICAgICAgICAgcmVxdWlyZWQ9RmFsc2UsCiAgICAgICAgICAgIGhl - bHA9IkNlcGggTWFuYWdlciBwcm9tZXRoZXVzIGV4cG9ydGVyIHBvcnQiLAogICAgICAgICkKICAg - ICAgICBvdXRwdXRfZ3JvdXAuYWRkX2FyZ3VtZW50KAogICAgICAgICAgICAiLS1za2lwLW1vbml0 - b3JpbmctZW5kcG9pbnQiLAogICAgICAgICAgICBkZWZhdWx0PUZhbHNlLAogICAgICAgICAgICBh - Y3Rpb249InN0b3JlX3RydWUiLAogICAgICAgICAgICBoZWxwPSJEbyBub3QgY2hlY2sgZm9yIGEg - bW9uaXRvcmluZyBlbmRwb2ludCBmb3IgdGhlIENlcGggY2x1c3RlciIsCiAgICAgICAgKQogICAg - ICAgIG91dHB1dF9ncm91cC5hZGRfYXJndW1lbnQoCiAgICAgICAgICAgICItLXJiZC1tZXRhZGF0 - YS1lYy1wb29sLW5hbWUiLAogICAgICAgICAgICBkZWZhdWx0PSIiLAogICAgICAgICAgICByZXF1 - aXJlZD1GYWxzZSwKICAgICAgICAgICAgaGVscD0iUHJvdmlkZXMgdGhlIG5hbWUgb2YgZXJhc3Vy - ZSBjb2RlZCBSQkQgbWV0YWRhdGEgcG9vbCIsCiAgICAgICAgKQogICAgICAgIG91dHB1dF9ncm91 - cC5hZGRfYXJndW1lbnQoCiAgICAgICAgICAgICItLWRyeS1ydW4iLAogICAgICAgICAgICBkZWZh - dWx0PUZhbHNlLAogICAgICAgICAgICBhY3Rpb249InN0b3JlX3RydWUiLAogICAgICAgICAgICBo - ZWxwPSJEcnkgcnVuIHByaW50cyB0aGUgZXhlY3V0ZWQgY29tbWFuZHMgd2l0aG91dCBydW5uaW5n - IHRoZW0iLAogICAgICAgICkKICAgICAgICBvdXRwdXRfZ3JvdXAuYWRkX2FyZ3VtZW50KAogICAg - ICAgICAgICAiLS1yYWRvcy1uYW1lc3BhY2UiLAogICAgICAgICAgICBkZWZhdWx0PSIiLAogICAg - ICAgICAgICByZXF1aXJlZD1GYWxzZSwKICAgICAgICAgICAgaGVscD0iRGl2aWRlcyBhIHBvb2wg - aW50byBzZXBhcmF0ZSBsb2dpY2FsIG5hbWVzcGFjZXMsIHVzZWQgZm9yIGNyZWF0aW5nIFJCRCBQ - VkMgaW4gYSBDZXBoQmxvY2tQb29sUmFkb3NOYW1lc3BhY2UgKHNob3VsZCBiZSBsb3dlciBjYXNl - KSIsCiAgICAgICAgKQogICAgICAgIG91dHB1dF9ncm91cC5hZGRfYXJndW1lbnQoCiAgICAgICAg - ICAgICItLXN1YnZvbHVtZS1ncm91cCIsCiAgICAgICAgICAgIGRlZmF1bHQ9IiIsCiAgICAgICAg - ICAgIHJlcXVpcmVkPUZhbHNlLAogICAgICAgICAgICBoZWxwPSJwcm92aWRlcyB0aGUgbmFtZSBv - ZiB0aGUgc3Vidm9sdW1lIGdyb3VwIiwKICAgICAgICApCiAgICAgICAgb3V0cHV0X2dyb3VwLmFk - ZF9hcmd1bWVudCgKICAgICAgICAgICAgIi0tcmd3LXJlYWxtLW5hbWUiLAogICAgICAgICAgICBk - ZWZhdWx0PSIiLAogICAgICAgICAgICByZXF1aXJlZD1GYWxzZSwKICAgICAgICAgICAgaGVscD0i - cHJvdmlkZXMgdGhlIG5hbWUgb2YgdGhlIHJndy1yZWFsbSIsCiAgICAgICAgKQogICAgICAgIG91 - dHB1dF9ncm91cC5hZGRfYXJndW1lbnQoCiAgICAgICAgICAgICItLXJndy16b25lLW5hbWUiLAog - ICAgICAgICAgICBkZWZhdWx0PSIiLAogICAgICAgICAgICByZXF1aXJlZD1GYWxzZSwKICAgICAg - ICAgICAgaGVscD0icHJvdmlkZXMgdGhlIG5hbWUgb2YgdGhlIHJndy16b25lIiwKICAgICAgICAp - CiAgICAgICAgb3V0cHV0X2dyb3VwLmFkZF9hcmd1bWVudCgKICAgICAgICAgICAgIi0tcmd3LXpv - bmVncm91cC1uYW1lIiwKICAgICAgICAgICAgZGVmYXVsdD0iIiwKICAgICAgICAgICAgcmVxdWly - ZWQ9RmFsc2UsCiAgICAgICAgICAgIGhlbHA9InByb3ZpZGVzIHRoZSBuYW1lIG9mIHRoZSByZ3ct - em9uZWdyb3VwIiwKICAgICAgICApCiAgICAgICAgb3V0cHV0X2dyb3VwLmFkZF9hcmd1bWVudCgK - ICAgICAgICAgICAgIi0tdG9wb2xvZ3ktcG9vbHMiLAogICAgICAgICAgICBkZWZhdWx0PSIiLAog - ICAgICAgICAgICByZXF1aXJlZD1GYWxzZSwKICAgICAgICAgICAgaGVscD0iY29tbWEtc2VwYXJh - dGVkIGxpc3Qgb2YgdG9wb2xvZ3ktY29uc3RyYWluZWQgcmJkIHBvb2xzIiwKICAgICAgICApCiAg - ICAgICAgb3V0cHV0X2dyb3VwLmFkZF9hcmd1bWVudCgKICAgICAgICAgICAgIi0tdG9wb2xvZ3kt - ZmFpbHVyZS1kb21haW4tbGFiZWwiLAogICAgICAgICAgICBkZWZhdWx0PSIiLAogICAgICAgICAg - ICByZXF1aXJlZD1GYWxzZSwKICAgICAgICAgICAgaGVscD0iazhzIGNsdXN0ZXIgZmFpbHVyZSBk - b21haW4gbGFiZWwgKGV4YW1wbGU6IHpvbmUsIHJhY2ssIG9yIGhvc3QpIGZvciB0aGUgdG9wb2xv - Z3ktcG9vbHMgdGhhdCBtYXRjaCB0aGUgY2VwaCBk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ICAgaWYgcmJkX3Bvb2xfbmFt - ZSA9PSAiIjoKICAgICAgICAgICAgICAgIHJhaXNlIEV4ZWN1dGlvbkZhaWx1cmVFeGNlcHRpb24o - CiAgICAgICAgICAgICAgICAgICAgIkZsYWcgJy0tcmJkLWRhdGEtcG9vbC1uYW1lJyBzaG91bGQg - bm90IGJlIGVtcHR5IgogICAgICAgICAgICAgICAgKQoKICAgICAgICAgICAgaWYgcmJkX21ldGFk - YXRhX2VjX3Bvb2xfbmFtZSA9PSAiIjoKICAgICAgICAgICAgICAgIHJhaXNlIEV4ZWN1dGlvbkZh - aWx1cmVFeGNlcHRpb24oCiAgICAgICAgICAgICAgICAgICAgIkZsYWcgJy0tcmJkLW1ldGFkYXRh - LWVjLXBvb2wtbmFtZScgc2hvdWxkIG5vdCBiZSBlbXB0eSIKICAgICAgICAgICAgICAgICkKCiAg - ICAgICAgICAgIGNtZF9qc29uID0geyJwcmVmaXgiOiAib3NkIGR1bXAiLCAiZm9ybWF0IjogImpz - b24ifQogICAgICAgICAgICByZXRfdmFsLCBqc29uX291dCwgZXJyX21zZyA9IHNlbGYuX2NvbW1v - bl9jbWRfanNvbl9nZW4oY21kX2pzb24pCiAgICAgICAgICAgIGlmIHJldF92YWwgIT0gMCBvciBs - ZW4oanNvbl9vdXQpID09IDA6CiAgICAgICAgICAgICAgICByYWlzZSBFeGVjdXRpb25GYWlsdXJl - RXhjZXB0aW9uKAogICAgICAgICAgICAgICAgICAgIGYie2NtZF9qc29uWydwcmVmaXgnXX0gY29t - bWFuZCBmYWlsZWQuXG4iCiAgICAgICAgICAgICAgICAgICAgZiJFcnJvcjoge2Vycl9tc2cgaWYg - cmV0X3ZhbCAhPSAwIGVsc2Ugc2VsZi5FTVBUWV9PVVRQVVRfTElTVH0iCiAgICAgICAgICAgICAg - ICApCiAgICAgICAgICAgIG1ldGFkYXRhX3Bvb2xfZXhpc3QsIHBvb2xfZXhpc3QgPSBGYWxzZSwg - RmFsc2UKCiAgICAgICAgICAgIGZvciBrZXkgaW4ganNvbl9vdXRbInBvb2xzIl06CiAgICAgICAg - ICAgICAgICAjIGlmIGVyYXN1cmVfY29kZV9wcm9maWxlIGlzIGVtcHR5IGFuZCBwb29sIG5hbWUg - ZXhpc3RzIHRoZW4gaXQgcmVwbGljYSBwb29sCiAgICAgICAgICAgICAgICBpZiAoCiAgICAgICAg - ICAgICAgICAgICAga2V5WyJlcmFzdXJlX2NvZGVfcHJvZmlsZSJdID09ICIiCiAgICAgICAgICAg - ICAgICAgICAgYW5kIGtleVsicG9vbF9uYW1lIl0gPT0gcmJkX21ldGFkYXRhX2VjX3Bvb2xfbmFt - ZQogICAgICAgICAgICAgICAgKToKICAgICAgICAgICAgICAgICAgICBtZXRhZGF0YV9wb29sX2V4 - aXN0ID0gVHJ1ZQogICAgICAgICAgICAgICAgIyBpZiBlcmFzdXJlX2NvZGVfcHJvZmlsZSBpcyBu - b3QgZW1wdHkgYW5kIHBvb2wgbmFtZSBleGlzdHMgdGhlbiBpdCBpcyBlYyBwb29sCiAgICAgICAg - ICAgICAgICBpZiBrZXlbImVyYXN1cmVfY29kZV9wcm9maWxlIl0gYW5kIGtleVsicG9vbF9uYW1l - Il0gPT0gcmJkX3Bvb2xfbmFtZToKICAgICAgICAgICAgICAgICAgICBwb29sX2V4aXN0ID0gVHJ1 - ZQoKICAgICAgICAgICAgaWYgbm90IG1ldGFkYXRhX3Bvb2xfZXhpc3Q6CiAgICAgICAgICAgICAg - ICByYWlzZSBFeGVjdXRpb25GYWlsdXJlRXhjZXB0aW9uKAogICAgICAgICAgICAgICAgICAgICJQ - cm92aWRlZCByYmRfZWNfbWV0YWRhdGFfcG9vbCBuYW1lLCIKICAgICAgICAgICAgICAgICAgICBm - IiB7cmJkX21ldGFkYXRhX2VjX3Bvb2xfbmFtZX0sIGRvZXMgbm90IGV4aXN0IgogICAgICAgICAg - ICAgICAgKQogICAgICAgICAgICBpZiBub3QgcG9vbF9leGlzdDoKICAgICAgICAgICAgICAgIHJh - aXNlIEV4ZWN1dGlvbkZhaWx1cmVFeGNlcHRpb24oCiAgICAgICAgICAgICAgICAgICAgZiJQcm92 - aWRlZCByYmRfZGF0YV9wb29sIG5hbWUsIHtyYmRfcG9vbF9uYW1lfSwgZG9lcyBub3QgZXhpc3Qi - CiAgICAgICAgICAgICAgICApCiAgICAgICAgICAgIHJldHVybiByYmRfbWV0YWRhdGFfZWNfcG9v - bF9uYW1lCgogICAgZGVmIGRyeV9ydW4oc2VsZiwgbXNnKToKICAgICAgICBpZiBzZWxmLl9hcmdf - cGFyc2VyLmRyeV9ydW46CiAgICAgICAgICAgIHByaW50KCJFeGVjdXRlOiAiICsgIiciICsgbXNn - ICsgIiciKQoKICAgIGRlZiB2YWxpZGF0ZV9yZ3dfZW5kcG9pbnRfdGxzX2NlcnQoc2VsZik6CiAg - ICAgICAgaWYgc2VsZi5fYXJnX3BhcnNlci5yZ3dfdGxzX2NlcnRfcGF0aDoKICAgICAgICAgICAg - d2l0aCBvcGVuKHNlbGYuX2FyZ19wYXJzZXIucmd3X3Rsc19jZXJ0X3BhdGgsIGVuY29kaW5nPSJ1 - dGY4IikgYXMgZjoKICAgICAgICAgICAgICAgIGNvbnRlbnRzID0gZi5yZWFkKCkKICAgICAgICAg - ICAgICAgIHJldHVybiBjb250ZW50cy5yc3RyaXAoKQoKICAgIGRlZiBfY2hlY2tfY29uZmxpY3Rp - bmdfb3B0aW9ucyhzZWxmKToKICAgICAgICBpZiBub3Qgc2VsZi5fYXJnX3BhcnNlci51cGdyYWRl - IGFuZCBub3Qgc2VsZi5fYXJnX3BhcnNlci5yYmRfZGF0YV9wb29sX25hbWU6CiAgICAgICAgICAg - IHJhaXNlIEV4ZWN1dGlvbkZhaWx1cmVFeGNlcHRpb24oCiAgICAgICAgICAgICAgICAiRWl0aGVy - ICctLXVwZ3JhZGUnIG9yICctLXJiZC1kYXRhLXBvb2wtbmFtZSA8cG9vbF9uYW1lPicgc2hvdWxk - IGJlIHNwZWNpZmllZCIKICAgICAgICAgICAgKQoKICAgIGRlZiBfaW52YWxpZF9lbmRwb2ludChz - ZWxmLCBlbmRwb2ludF9zdHIpOgogICAgICAgICMgZXh0cmFjdCB0aGUgcG9ydCBieSBnZXR0aW5n - IHRoZSBsYXN0IHNwbGl0IG9uIGA6YCBkZWxpbWl0ZXIKICAgICAgICB0cnk6CiAgICAgICAgICAg - IGVuZHBvaW50X3N0cl9pcCwgcG9ydCA9IGVuZHBvaW50X3N0ci5yc3BsaXQoIjoiLCAxKQogICAg - ICAgIGV4Y2VwdCBWYWx1ZUVycm9yOgogICAgICAgICAgICByYWlzZSBFeGVjdXRpb25GYWlsdXJl - RXhjZXB0aW9uKGYiTm90IGEgcHJvcGVyIGVuZHBvaW50OiB7ZW5kcG9pbnRfc3RyfSIpCgogICAg - ICAgIHRyeToKICAgICAgICAgICAgaWYgZW5kcG9pbnRfc3RyX2lwWzBdID09ICJbIjoKICAgICAg - ICAgICAgICAgIGVuZHBvaW50X3N0cl9pcCA9IGVuZHBvaW50X3N0cl9pcFsxIDogbGVuKGVuZHBv - aW50X3N0cl9pcCkgLSAxXQogICAgICAgICAgICBpcF90eXBlID0gKAogICAgICAgICAgICAgICAg - IklQdjQiIGlmIHR5cGUoaXBfYWRkcmVzcyhlbmRwb2ludF9zdHJfaXApKSBpcyBJUHY0QWRkcmVz - cyBlbHNlICJJUHY2IgogICAgICAgICAgICApCiAgICAgICAgZXhjZXB0IFZhbHVlRXJyb3I6CiAg - ICAgICAgICAgIGlwX3R5cGUgPSAiRlFETiIKICAgICAgICBpZiBub3QgcG9ydC5pc2RpZ2l0KCk6 - CiAgICAgICAgICAgIHJhaXNlIEV4ZWN1dGlvbkZhaWx1cmVFeGNlcHRpb24oZiJQb3J0IG5vdCB2 - YWxpZDoge3BvcnR9IikKICAgICAgICBpbnRQb3J0ID0gaW50KHBvcnQpCiAgICAgICAgaWYgaW50 - UG9ydCA8IDEgb3IgaW50UG9ydCA+IDIqKjE2IC0gMToKICAgICAgICAgICAgcmFpc2UgRXhlY3V0 - aW9uRmFpbHVyZUV4Y2VwdGlvbihmIk91dCBvZiByYW5nZSBwb3J0IG51bWJlcjoge3BvcnR9IikK - CiAgICAgICAgcmV0dXJuIGlwX3R5cGUKCiAgICBkZWYgZW5kcG9pbnRfZGlhbChzZWxmLCBlbmRw - b2ludF9zdHIsIGlwX3R5cGUsIHRpbWVvdXQ9MywgY2VydD1Ob25lKToKICAgICAgICAjIGlmIHRo - ZSAnY2x1c3RlcicgaW5zdGFuY2UgaXMgYSBkdW1teSBvbmUsCiAgICAgICAgIyBkb24ndCB0cnkg - dG8gcmVhY2ggb3V0IHRvIHRoZSBlbmRwb2ludAogICAgICAgIGlmIGlzaW5zdGFuY2Uoc2VsZi5j - bHVzdGVyLCBEdW1teVJhZG9zKToKICAgICAgICAgICAgcmV0dXJuICIiLCAiIiwgIiIKICAgICAg - ICBpZiBpcF90eXBlID09ICJJUHY2IjoKICAgICAgICAgICAgdHJ5OgogICAgICAgICAgICAgICAg - ZW5kcG9pbnRfc3RyX2lwLCBlbmRwb2ludF9zdHJfcG9ydCA9IGVuZHBvaW50X3N0ci5yc3BsaXQo - IjoiLCAxKQogICAgICAgICAgICBleGNlcHQgVmFsdWVFcnJvcjoKICAgICAgICAgICAgICAgIHJh - aXNlIEV4ZWN1dGlvbkZhaWx1cmVFeGNlcHRpb24oCiAgICAgICAgICAgICAgICAgICAgZiJOb3Qg - YSBwcm9wZXIgZW5kcG9pbnQ6IHtlbmRwb2ludF9zdHJ9IgogICAgICAgICAgICAgICAgKQogICAg - ICAgICAgICBpZiBlbmRwb2ludF9zdHJfaXBbMF0gIT0gIlsiOgogICAgICAgICAgICAgICAgZW5k - cG9pbnRfc3RyX2lwID0gIlsiICsgZW5kcG9pbnRfc3RyX2lwICsgIl0iCiAgICAgICAgICAgIGVu - ZHBvaW50X3N0ciA9ICI6Ii5qb2luKFtlbmRwb2ludF9zdHJfaXAsIGVuZHBvaW50X3N0cl9wb3J0 - XSkKCiAgICAgICAgcHJvdG9jb2xzID0gWyJodHRwIiwgImh0dHBzIl0KICAgICAgICByZXNwb25z - ZV9lcnJvciA9IE5vbmUKICAgICAgICBmb3IgcHJlZml4IGluIHByb3RvY29sczoKICAgICAgICAg - ICAgdHJ5OgogICAgICAgICAgICAgICAgZXAgPSBmIntwcmVmaXh9Oi8ve2VuZHBvaW50X3N0cn0i - CiAgICAgICAgICAgICAgICB2ZXJpZnkgPSBOb25lCiAgICAgICAgICAgICAgICAjIElmIHZlcmlm - eSBpcyBzZXQgdG8gYSBwYXRoIHRvIGEgZGlyZWN0b3J5LAogICAgICAgICAgICAgICAgIyB0aGUg - ZGlyZWN0b3J5IG11c3QgaGF2ZSBiZWVuIHByb2Nlc3NlZCB1c2luZyB0aGUgY19yZWhhc2ggdXRp - bGl0eSBzdXBwbGllZCB3aXRoIE9wZW5TU0wuCiAgICAgICAgICAgICAgICBpZiBwcmVmaXggPT0g - Imh0dHBzIiBhbmQgc2VsZi5fYXJnX3BhcnNlci5yZ3dfc2tpcF90bHM6CiAgICAgICAgICAgICAg - ICAgICAgdmVyaWZ5ID0gRmFsc2UKICAgICAgICAgICAgICAgICAgICByID0gcmVxdWVzdHMuaGVh - ZChlcCwgdGltZW91dD10aW1lb3V0LCB2ZXJpZnk9RmFsc2UpCiAgICAgICAgICAgICAgICBlbGlm - IHByZWZpeCA9PSAiaHR0cHMiIGFuZCBjZXJ0OgogICAgICAgICAgICAgICAgICAgIHZlcmlmeSA9 - IGNlcnQKICAgICAgICAgICAgICAgICAgICByID0gcmVxdWVzdHMuaGVhZChlcCwgdGltZW91dD10 - aW1lb3V0LCB2ZXJpZnk9Y2VydCkKICAgICAgICAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICAg - ICAgICAgciA9IHJlcXVlc3RzLmhlYWQoZXAsIHRpbWVvdXQ9dGltZW91dCkKICAgICAgICAgICAg - ICAgIGlmIHIuc3RhdHVzX2NvZGUgPT0gMjAwOgogICAgICAgICAgICAgICAgICAgIHJldHVybiBw - cmVmaXgsIHZlcmlmeSwgIiIKICAgICAgICAgICAgZXhjZXB0IEV4Y2VwdGlvbiBhcyBlcnI6CiAg - ICAgICAgICAgICAgICByZXNwb25zZV9lcnJvciA9IGVycgogICAgICAgICAgICAgICAgY29udGlu - dWUKICAgICAgICBzeXMuc3RkZXJyLndyaXRlKAogICAgICAgICAgICBmInVuYWJsZSB0byBjb25u - ZWN0IHRvIGVuZHBvaW50OiB7ZW5kcG9pbnRfc3RyfSwgZmFpbGVkIGVycm9yOiB7cmVzcG9uc2Vf - ZXJyb3J9IgogICAgICAgICkKICAgICAgICByZXR1cm4gKAogICAgICAgICAgICAiIiwKICAgICAg - ICAgICAgIiIsCiAgICAgICAgICAgICgiLTEiKSwKICAgICAgICApCgogICAgZGVmIF9faW5pdF9f - KHNlbGYsIGFyZ19saXN0PU5vbmUpOgogICAgICAgIHNlbGYub3V0X21hcCA9IHt9CiAgICAgICAg - c2VsZi5fZXhjbHVkZWRfa2V5cyA9IHNldCgpCiAgICAgICAgc2VsZi5fYXJnX3BhcnNlciA9IHNl - bGYuZ2VuX2FyZ19wYXJzZXIoYXJnc190b19wYXJzZT1hcmdfbGlzdCkKICAgICAgICBzZWxmLl9j - aGVja19jb25mbGljdGluZ19vcHRpb25zKCkKICAgICAgICBzZWxmLnJ1bl9hc191c2VyID0gc2Vs - Zi5fYXJnX3BhcnNlci5ydW5fYXNfdXNlcgogICAgICAgIHNlbGYub3V0cHV0X2ZpbGUgPSBzZWxm - Ll9hcmdfcGFyc2VyLm91dHB1dAogICAgICAgIHNlbGYuY2VwaF9jb25mID0gc2VsZi5fYXJnX3Bh - cnNlci5jZXBoX2NvbmYKICAgICAgICBzZWxmLmNlcGhfa2V5cmluZyA9IHNlbGYuX2FyZ19wYXJz - ZXIua2V5cmluZwogICAgICAgICMgaWYgdXNlciBub3QgcHJvdmlkZWQsIGdpdmUgYSBkZWZhdWx0 - IHVzZXIKICAgICAgICBpZiBub3Qgc2VsZi5ydW5fYXNfdXNlciBhbmQgbm90IHNlbGYuX2FyZ19w - YXJzZXIudXBncmFkZToKICAgICAgICAgICAgc2VsZi5ydW5fYXNfdXNlciA9IHNlbGYuRVhURVJO - QUxfVVNFUl9OQU1FCiAgICAgICAgaWYgbm90IHNlbGYuX2FyZ19wYXJzZXIucmd3X3Bvb2xfcHJl - Zml4IGFuZCBub3Qgc2VsZi5fYXJnX3BhcnNlci51cGdyYWRlOgogICAgICAgICAgICBzZWxmLl9h - cmdfcGFyc2VyLnJnd19wb29sX3ByZWZpeCA9IHNlbGYuREVGQVVMVF9SR1dfUE9PTF9QUkVGSVgK - ICAgICAgICBpZiBzZWxmLmNlcGhfY29uZjoKICAgICAgICAgICAga3dhcmdzID0ge30KICAgICAg - ICAgICAgaWYgc2VsZi5jZXBoX2tleXJpbmc6CiAgICAgICAgICAgICAgICBrd2FyZ3NbImNvbmYi - XSA9IHsia2V5cmluZyI6IHNlbGYuY2VwaF9rZXlyaW5nfQogICAgICAgICAgICBzZWxmLmNsdXN0 - ZXIgPSByYWRvcy5SYWRvcyhjb25mZmlsZT1zZWxmLmNlcGhfY29uZiwgKiprd2FyZ3MpCiAgICAg - ICAgZWxzZToKICAgICAgICAgICAgc2VsZi5jbHVzdGVyID0gcmFkb3MuUmFkb3MoKQogICAgICAg - ICAgICBzZWxmLmNsdXN0ZXIuY29uZl9yZWFkX2ZpbGUoKQogICAgICAgIHNlbGYuY2x1c3Rlci5j - b25uZWN0KCkKCiAgICBkZWYgc2h1dGRvd24oc2VsZik6CiAgICAgICAgaWYgc2VsZi5jbHVzdGVy - LnN0YXRlID09ICJjb25uZWN0ZWQiOgogICAgICAgICAgICBzZWxmLmNsdXN0ZXIuc2h1dGRvd24o - KQoKICAgIGRlZiBnZXRfZnNpZChzZWxmKToKICAgICAgICBpZiBzZWxmLl9hcmdfcGFyc2VyLmRy - eV9ydW46CiAgICAgICAgICAgIHJldHVybiBzZWxmLmRyeV9ydW4oImNlcGggZnNpZCIpCiAgICAg - ICAgcmV0dXJuIHN0cihzZWxmLmNsdXN0ZXIuZ2V0X2ZzaWQoKSkKCiAgICBkZWYgX2NvbW1vbl9j - bWRfanNvbl9nZW4oc2VsZiwgY21kX2pzb24pOgogICAgICAgIGNtZCA9IGpzb24uZHVtcHMoY21k - X2pzb24sIHNvcnRfa2V5cz1UcnVlKQogICAgICAgIHJldF92YWwsIGNtZF9vdXQsIGVycl9tc2cg - PSBzZWxmLmNsdXN0ZXIubW9uX2NvbW1hbmQoY21kLCBiIiIpCiAgICAgICAgaWYgc2VsZi5fYXJn - X3BhcnNlci52ZXJib3NlOgogICAgICAgICAgICBwcmludChmIkNvbW1hbmQgSW5wdXQ6IHtjbWR9 - IikKICAgICAgICAgICAgcHJpbnQoCiAgICAgICAgICAgICAgICBmIlJldHVybiBWYWw6IHtyZXRf - dmFsfVxuQ29tbWFuZCBPdXRwdXQ6IHtjbWRfb3V0fVxuIgogICAgICAgICAgICAgICAgZiJFcnJv - ciBNZXNzYWdlOiB7ZXJyX21zZ31cbi0tLS0tLS0tLS1cbiIKICAgICAgICAgICAgKQogICAgICAg - IGpzb25fb3V0ID0ge30KICAgICAgICAjIGlmIHRoZXJlIGlzIG5vIGVycm9yIChpLmU7IHJldF92 - YWwgaXMgWkVSTykgYW5kICdjbWRfb3V0JyBpcyBub3QgZW1wdHkKICAgICAgICAjIHRoZW4gY29u - dmVydCAnY21kX291dCcgdG8gYSBqc29uIG91dHB1dAogICAgICAgIGlmIHJldF92YWwgPT0gMCBh - bmQgY21kX291dDoKICAgICAgICAgICAganNvbl9vdXQgPSBqc29uLmxvYWRzKGNtZF9vdXQpCiAg - ICAgICAgcmV0dXJuIHJldF92YWwsIGpzb25fb3V0LCBlcnJfbXNnCgogICAgZGVmIGdldF9jZXBo - X2V4dGVybmFsX21vbl9kYXRhKHNlbGYpOgogICAgICAgIGNtZF9qc29uID0geyJwcmVmaXgiOiAi - cXVvcnVtX3N0YXR1cyIsICJmb3JtYXQiOiAianNvbiJ9CiAgICAgICAgaWYgc2VsZi5fYXJnX3Bh - cnNlci5kcnlfcnVuOgogICAgICAgICAgICByZXR1cm4gc2VsZi5kcnlfcnVuKCJjZXBoICIgKyBj - bWRfanNvblsicHJlZml4Il0pCiAgICAgICAgcmV0X3ZhbCwganNvbl9vdXQsIGVycl9tc2cgPSBz - ZWxmLl9jb21tb25fY21kX2pzb25fZ2VuKGNtZF9qc29uKQogICAgICAgICMgaWYgdGhlcmUgaXMg - YW4gdW5zdWNjZXNzZnVsIGF0dGVtcHQsCiAgICAgICAgaWYgcmV0X3ZhbCAhPSAwIG9yIGxlbihq - c29uX291dCkgPT0gMDoKICAgICAgICAgICAgcmFpc2UgRXhlY3V0aW9uRmFpbHVyZUV4Y2VwdGlv - bigKICAgICAgICAgICAgICAgICIncXVvcnVtX3N0YXR1cycgY29tbWFuZCBmYWlsZWQuXG4iCiAg - ICAgICAgICAgICAgICBmIkVycm9yOiB7ZXJyX21zZyBpZiByZXRfdmFsICE9IDAgZWxzZSBzZWxm - LkVNUFRZX09VVFBVVF9MSVNUfSIKICAgICAgICAgICAgKQogICAgICAgIHFfbGVhZGVyX25hbWUg - PSBqc29uX291dFsicXVvcnVtX2xlYWRlcl9uYW1lIl0KICAgICAgICBxX2xlYWRlcl9kZXRhaWxz - ID0ge30KICAgICAgICBxX2xlYWRlcl9tYXRjaGluZ19saXN0ID0gWwogICAgICAgICAgICBsIGZv - ciBsIGluIGpzb25fb3V0WyJtb25tYXAiXVsibW9ucyJdIGlmIGxbIm5hbWUiXSA9PSBxX2xlYWRl - cl9uYW1lCiAgICAgICAgXQogICAgICAgIGlmIGxlbihxX2xlYWRlcl9tYXRjaGluZ19saXN0KSA9 - PSAwOgogICAgICAgICAgICByYWlzZSBFeGVjdXRpb25GYWlsdXJlRXhjZXB0aW9uKCJObyBtYXRj - aGluZyAnbW9uJyBkZXRhaWxzIGZvdW5kIikKICAgICAgICBxX2xlYWRlcl9kZXRhaWxzID0gcV9s - ZWFkZXJfbWF0Y2hpbmdfbGlzd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XMgYSBkdW1teSB0eXBlLAogICAgICAg - ICMgY2FsbCB0aGUgZHVtbXkgaW5zdGFuY2UncyAiY29udmVydCIgbWV0aG9kCiAgICAgICAgaWYg - bm90IGhvc3RfbmFtZToKICAgICAgICAgICAgcmFpc2UgRXhlY3V0aW9uRmFpbHVyZUV4Y2VwdGlv - bigiRW1wdHkgaG9zdG5hbWUgcHJvdmlkZWQiKQogICAgICAgIGlmIGlzaW5zdGFuY2Uoc2VsZi5j - bHVzdGVyLCBEdW1teVJhZG9zKToKICAgICAgICAgICAgcmV0dXJuIHNlbGYuY2x1c3Rlci5fY29u - dmVydF9ob3N0bmFtZV90b19pcChob3N0X25hbWUpCgogICAgICAgIGlmIGlwX3R5cGUgPT0gIkZR - RE4iOgogICAgICAgICAgICAjIGNoZWNrIHdoaWNoIGlwIEZRRE4gc2hvdWxkIGJlIGNvbnZlcnRl - ZCB0bywgSVB2NCBvciBJUHY2CiAgICAgICAgICAgICMgY2hlY2sgdGhlIGhvc3QgaXAsIHRoZSBl - bmRwb2ludCBpcCB0eXBlIHdvdWxkIGJlIHNpbWlsYXIgdG8gaG9zdCBpcAogICAgICAgICAgICBj - bWRfanNvbiA9IHsicHJlZml4IjogIm9yY2ggaG9zdCBscyIsICJmb3JtYXQiOiAianNvbiJ9CiAg - ICAgICAgICAgIHJldF92YWwsIGpzb25fb3V0LCBlcnJfbXNnID0gc2VsZi5fY29tbW9uX2NtZF9q - c29uX2dlbihjbWRfanNvbikKICAgICAgICAgICAgIyBpZiB0aGVyZSBpcyBhbiB1bnN1Y2Nlc3Nm - dWwgYXR0ZW1wdCwKICAgICAgICAgICAgaWYgcmV0X3ZhbCAhPSAwIG9yIGxlbihqc29uX291dCkg - PT0gMDoKICAgICAgICAgICAgICAgIHJhaXNlIEV4ZWN1dGlvbkZhaWx1cmVFeGNlcHRpb24oCiAg - ICAgICAgICAgICAgICAgICAgIidvcmNoIGhvc3QgbHMnIGNvbW1hbmQgZmFpbGVkLlxuIgogICAg - ICAgICAgICAgICAgICAgIGYiRXJyb3I6IHtlcnJfbXNnIGlmIHJldF92YWwgIT0gMCBlbHNlIHNl - bGYuRU1QVFlfT1VUUFVUX0xJU1R9IgogICAgICAgICAgICAgICAgKQogICAgICAgICAgICBob3N0 - X2FkZHIgPSBqc29uX291dFswXVsiYWRkciJdCiAgICAgICAgICAgICMgYWRkIDo4MCBzYW1wbGUg - cG9ydCBpbiBpcF90eXBlLCBhcyBfaW52YWxpZF9lbmRwb2ludCBhbHNvIHZlcmlmeSBwb3J0CiAg - ICAgICAgICAgIGhvc3RfaXBfdHlwZSA9IHNlbGYuX2ludmFsaWRfZW5kcG9pbnQoaG9zdF9hZGRy - ICsgIjo4MCIpCiAgICAgICAgICAgIGltcG9ydCBzb2NrZXQKCiAgICAgICAgICAgICMgZXhhbXBs - ZSBvdXRwdXQgWyg8QWRkcmVzc0ZhbWlseS5BRl9JTkVUOiAyPiwgPFNvY2tldEtpbmQuU09DS19T - VFJFQU06IDE+LCA2LCAnJywgKCc5My4xODQuMjE2LjM0JywgODApKSwgLi4uXQogICAgICAgICAg - ICAjIHdlIG5lZWQgdG8gZ2V0IDkzLjE4NC4yMTYuMzQgc28gaXQgd291bGQgYmUgaXBbMF1bNF1b - MF0KICAgICAgICAgICAgaWYgaG9zdF9pcF90eXBlID09ICJJUHY2IjoKICAgICAgICAgICAgICAg - IGlwID0gc29ja2V0LmdldGFkZHJpbmZvKAogICAgICAgICAgICAgICAgICAgIGhvc3RfbmFtZSwg - cG9ydCwgZmFtaWx5PXNvY2tldC5BRl9JTkVUNiwgcHJvdG89c29ja2V0LklQUFJPVE9fVENQCiAg - ICAgICAgICAgICAgICApCiAgICAgICAgICAgIGVsaWYgaG9zdF9pcF90eXBlID09ICJJUHY0IjoK - ICAgICAgICAgICAgICAgIGlwID0gc29ja2V0LmdldGFkZHJpbmZvKAogICAgICAgICAgICAgICAg - ICAgIGhvc3RfbmFtZSwgcG9ydCwgZmFtaWx5PXNvY2tldC5BRl9JTkVULCBwcm90bz1zb2NrZXQu - SVBQUk9UT19UQ1AKICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgZGVsIHNvY2tldAogICAg - ICAgICAgICByZXR1cm4gaXBbMF1bNF1bMF0KICAgICAgICByZXR1cm4gaG9zdF9uYW1lCgogICAg - ZGVmIGdldF9hY3RpdmVfYW5kX3N0YW5kYnlfbWdycyhzZWxmKToKICAgICAgICBpZiBzZWxmLl9h - cmdfcGFyc2VyLmRyeV9ydW46CiAgICAgICAgICAgIHJldHVybiAiIiwgc2VsZi5kcnlfcnVuKCJj - ZXBoIHN0YXR1cyIpCiAgICAgICAgbW9uaXRvcmluZ19lbmRwb2ludF9wb3J0ID0gc2VsZi5fYXJn - X3BhcnNlci5tb25pdG9yaW5nX2VuZHBvaW50X3BvcnQKICAgICAgICBtb25pdG9yaW5nX2VuZHBv - aW50X2lwX2xpc3QgPSBzZWxmLl9hcmdfcGFyc2VyLm1vbml0b3JpbmdfZW5kcG9pbnQKICAgICAg - ICBzdGFuZGJ5X21ncnMgPSBbXQogICAgICAgIGlmIG5vdCBtb25pdG9yaW5nX2VuZHBvaW50X2lw - X2xpc3Q6CiAgICAgICAgICAgIGNtZF9qc29uID0geyJwcmVmaXgiOiAic3RhdHVzIiwgImZvcm1h - dCI6ICJqc29uIn0KICAgICAgICAgICAgcmV0X3ZhbCwganNvbl9vdXQsIGVycl9tc2cgPSBzZWxm - Ll9jb21tb25fY21kX2pzb25fZ2VuKGNtZF9qc29uKQogICAgICAgICAgICAjIGlmIHRoZXJlIGlz - IGFuIHVuc3VjY2Vzc2Z1bCBhdHRlbXB0LAogICAgICAgICAgICBpZiByZXRfdmFsICE9IDAgb3Ig - bGVuKGpzb25fb3V0KSA9PSAwOgogICAgICAgICAgICAgICAgcmFpc2UgRXhlY3V0aW9uRmFpbHVy - ZUV4Y2VwdGlvbigKICAgICAgICAgICAgICAgICAgICAiJ21nciBzZXJ2aWNlcycgY29tbWFuZCBm - YWlsZWQuXG4iCiAgICAgICAgICAgICAgICAgICAgZiJFcnJvcjoge2Vycl9tc2cgaWYgcmV0X3Zh - bCAhPSAwIGVsc2Ugc2VsZi5FTVBUWV9PVVRQVVRfTElTVH0iCiAgICAgICAgICAgICAgICApCiAg - ICAgICAgICAgIG1vbml0b3JpbmdfZW5kcG9pbnQgPSAoCiAgICAgICAgICAgICAgICBqc29uX291 - dC5nZXQoIm1ncm1hcCIsIHt9KS5nZXQoInNlcnZpY2VzIiwge30pLmdldCgicHJvbWV0aGV1cyIs - ICIiKQogICAgICAgICAgICApCiAgICAgICAgICAgIGlmIG5vdCBtb25pdG9yaW5nX2VuZHBvaW50 - OgogICAgICAgICAgICAgICAgcmFpc2UgRXhlY3V0aW9uRmFpbHVyZUV4Y2VwdGlvbigKICAgICAg - ICAgICAgICAgICAgICAiY2FuJ3QgZmluZCBtb25pdG9yaW5nX2VuZHBvaW50LCBwcm9tZXRoZXVz - IG1vZHVsZSBtaWdodCBub3QgYmUgZW5hYmxlZCwgIgogICAgICAgICAgICAgICAgICAgICJlbmFi - bGUgdGhlIG1vZHVsZSBieSBydW5uaW5nICdjZXBoIG1nciBtb2R1bGUgZW5hYmxlIHByb21ldGhl - dXMnIgogICAgICAgICAgICAgICAgKQogICAgICAgICAgICAjIG5vdyBjaGVjayB0aGUgc3RhbmQt - YnkgbWdyLXMKICAgICAgICAgICAgc3RhbmRieV9hcnIgPSBqc29uX291dC5nZXQoIm1ncm1hcCIs - IHt9KS5nZXQoInN0YW5kYnlzIiwgW10pCiAgICAgICAgICAgIGZvciBlYWNoX3N0YW5kYnkgaW4g - c3RhbmRieV9hcnI6CiAgICAgICAgICAgICAgICBpZiAibmFtZSIgaW4gZWFjaF9zdGFuZGJ5Lmtl - eXMoKToKICAgICAgICAgICAgICAgICAgICBzdGFuZGJ5X21ncnMuYXBwZW5kKGVhY2hfc3RhbmRi - eVsibmFtZSJdKQogICAgICAgICAgICB0cnk6CiAgICAgICAgICAgICAgICBwYXJzZWRfZW5kcG9p - bnQgPSB1cmxwYXJzZShtb25pdG9yaW5nX2VuZHBvaW50KQogICAgICAgICAgICBleGNlcHQgVmFs - dWVFcnJvcjoKICAgICAgICAgICAgICAgIHJhaXNlIEV4ZWN1dGlvbkZhaWx1cmVFeGNlcHRpb24o - CiAgICAgICAgICAgICAgICAgICAgZiJpbnZhbGlkIGVuZHBvaW50OiB7bW9uaXRvcmluZ19lbmRw - b2ludH0iCiAgICAgICAgICAgICAgICApCiAgICAgICAgICAgIG1vbml0b3JpbmdfZW5kcG9pbnRf - aXBfbGlzdCA9IHBhcnNlZF9lbmRwb2ludC5ob3N0bmFtZQogICAgICAgICAgICBpZiBub3QgbW9u - aXRvcmluZ19lbmRwb2ludF9wb3J0OgogICAgICAgICAgICAgICAgbW9uaXRvcmluZ19lbmRwb2lu - dF9wb3J0ID0gc3RyKHBhcnNlZF9lbmRwb2ludC5wb3J0KQoKICAgICAgICAjIGlmIG1vbml0b3Jp - bmcgZW5kcG9pbnQgcG9ydCBpcyBub3Qgc2V0LCBwdXQgYSBkZWZhdWx0IG1vbiBwb3J0CiAgICAg - ICAgaWYgbm90IG1vbml0b3JpbmdfZW5kcG9pbnRfcG9ydDoKICAgICAgICAgICAgbW9uaXRvcmlu - Z19lbmRwb2ludF9wb3J0ID0gc2VsZi5ERUZBVUxUX01PTklUT1JJTkdfRU5EUE9JTlRfUE9SVAoK - ICAgICAgICAjIHVzZXIgY291bGQgZ2l2ZSBjb21tYSBhbmQgc3BhY2Ugc2VwYXJhdGVkIGlucHV0 - cyAobGlrZSAtLW1vbml0b3JpbmctZW5kcG9pbnQ9IjxpcDE+LCA8aXAyPiIpCiAgICAgICAgbW9u - aXRvcmluZ19lbmRwb2ludF9pcF9saXN0ID0gbW9uaXRvcmluZ19lbmRwb2ludF9pcF9saXN0LnJl - cGxhY2UoIiwiLCAiICIpCiAgICAgICAgbW9uaXRvcmluZ19lbmRwb2ludF9pcF9saXN0X3NwbGl0 - ID0gbW9uaXRvcmluZ19lbmRwb2ludF9pcF9saXN0LnNwbGl0KCkKICAgICAgICAjIGlmIG1vbml0 - b3JpbmctZW5kcG9pbnQgY291bGQgbm90IGJlIGZvdW5kLCByYWlzZSBhbiBlcnJvcgogICAgICAg - IGlmIGxlbihtb25pdG9yaW5nX2VuZHBvaW50X2lwX2xpc3Rfc3BsaXQpID09IDA6CiAgICAgICAg - ICAgIHJhaXNlIEV4ZWN1dGlvbkZhaWx1cmVFeGNlcHRpb24oIk5vICdtb25pdG9yaW5nLWVuZHBv - aW50JyBmb3VuZCIpCiAgICAgICAgIyBmaXJzdCBpcCBpcyB0cmVhdGVkIGFzIHRoZSBtYWluIG1v - bml0b3JpbmctZW5kcG9pbnQKICAgICAgICBtb25pdG9yaW5nX2VuZHBvaW50X2lwID0gbW9uaXRv - cmluZ19lbmRwb2ludF9pcF9saXN0X3NwbGl0WzBdCiAgICAgICAgIyByZXN0IG9mIHRoZSBpcC1z - IGFyZSBhZGRlZCB0byB0aGUgJ3N0YW5kYnlfbWdycycgbGlzdAogICAgICAgIHN0YW5kYnlfbWdy - cy5leHRlbmQobW9uaXRvcmluZ19lbmRwb2ludF9pcF9saXN0X3NwbGl0WzE6XSkKICAgICAgICBm - YWlsZWRfaXAgPSBtb25pdG9yaW5nX2VuZHBvaW50X2lwCgogICAgICAgIG1vbml0b3JpbmdfZW5k - cG9pbnQgPSAiOiIuam9pbigKICAgICAgICAgICAgW21vbml0b3JpbmdfZW5kcG9pbnRfaXAsIG1v - bml0b3JpbmdfZW5kcG9pbnRfcG9ydF0KICAgICAgICApCiAgICAgICAgaXBfdHlwZSA9IHNlbGYu - X2ludmFsaWRfZW5kcG9pbnQobW9uaXRvcmluZ19lbmRwb2ludCkKICAgICAgICB0cnk6CiAgICAg - ICAgICAgIG1vbml0b3JpbmdfZW5kcG9pbnRfaXAgPSBzZWxmLl9jb252ZXJ0X2hvc3RuYW1lX3Rv - X2lwKAogICAgICAgICAgICAgICAgbW9uaXRvcmluZ19lbmRwb2ludF9pcCwgbW9uaXRvcmluZ19l - bmRwb2ludF9wb3J0LCBpcF90eXBlCiAgICAgICAgICAgICkKICAgICAgICAgICAgIyBjb2xsZWN0 - IGFsbCB0aGUgJ3N0YW5kLWJ5JyBtZ3IgaXBzCiAgICAgICAgICAgIG1ncl9pcHMgPSBbXQogICAg - ICAgICAgICBmb3IgZWFjaF9zdGFuZGJ5X21nciBpbiBzdGFuZGJ5X21ncnM6CiAgICAgICAgICAg - ICAgICBmYWlsZWRfaXAgPSBlYWNoX3N0YW5kYnlfbWdyCiAgICAgICAgICAgICAgICBtZ3JfaXBz - LmFwcGVuZCgKICAgICAgICAgICAgICAgICAgICBzZWxmLl9jb252ZXJ0X2hvc3RuYW1lX3RvX2lw - KAogICAgICAgICAgICAgICAgICAgICAgICBlYWNoX3N0YW5kYnlfbWdyLCBtb25pdG9yaW5nX2Vu - ZHBvaW50X3BvcnQsIGlwX3R5cGUKICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAg - ICApCiAgICAgICAgZXhjZXB0OgogICAgICAgICAgICByYWlzZSBFeGVjdXRpb25GYWlsdXJlRXhj - ZXB0aW9uKAogICAgICAgICAgICAgICAgZiJDb252ZXJzaW9uIG9mIGhvc3Q6IHtmYWlsZWRfaXB9 - IHRvIElQIGZhaWxlZC4gIgogICAgICAgICAgICAgICAgIlBsZWFzZSBlbnRlciB0aGUgSVAgYWRk - cmVzc2VzIG9mIGFsbCB0aGUgY2VwaC1tZ3JzIHdpdGggdGhlICctLW1vbml0b3JpbmctZW5kcG9p - bnQnIGZsYWciCiAgICAgICAgICAgICkKCiAgICAgICAgXywgXywgZXJyID0gc2VsZi5lbmRwb2lu - dF9kaWFsKG1vbml0b3JpbmdfZW5kcG9pbnQsIGlwX3R5cGUpCiAgICAgICAgaWYgZXJyID09ICIt - MSI6CiAgICAgICAgICAgIHJhaXNlIEV4ZWN1dGlvbkZhaWx1cmVFeGNlcHRpb24oZXJyKQogICAg - ICAgICMgYWRkIHRoZSB2YWxpZGF0ZWQgYWN0aXZlIG1nciBJUCBpbnRvIHRoZSBmaXJzdCBpbmRl - eAogICAgICAgIG1ncl9pcHMuaW5zZXJ0KDAsIG1vbml0b3JpbmdfZW5kcG9pbnRfaXApCiAgICAg - ICAgYWxsX21ncl9pcHNfc3RyID0gIiwiLmpvaW4obWdyX2lwcykKICAgICAgICByZXR1cm4gYWxs - X21ncl9pcHNfc3RyLCBtb25pdG9yaW5nX2VuZHBvaW50X3BvcnQKCiAgICBkZWYgY2hlY2tfdXNl - cl9leGlzdChzZWxmLCB1c2VyKToKICAgICAgICBjbWRfanNvbiA9IHsicHJlZml4IjogImF1dGgg - Z2V0IiwgImVudGl0eSI6IGYie3VzZXJ9IiwgImZvcm1hdCI6ICJqc29uIn0KICAgICAgICByZXRf - dmFsLCBqc29uX291dCwgXyA9IHNlbGYuX2NvbW1vbl9jbWRfanNvbl9nZW4oY21kX2pzb24pCiAg - ICAgICAgaWYgcmV0X3ZhbCAhPSAwIG9yIGxlbihqc29uX291dCkgPT0gMDoKICAgICAgICAgICAg - cmV0dXJuICIiCiAgICAgICAgcmV0dXJuIHN0cihqc29uX291dFswXVsia2V5Il0pCgogICAgZGVm - IGdldF9jZXBoZnNfcHJvdmlzaW9uZXJfY2Fwc19hbmRfZW50aXR5KHNlbGYpOgogICAgICAgIGVu - dGl0eSA9ICJjbGllbnQuY3NpLWNlcGhmcy1wcm92aXNpb25lciIKICAgICAgICBjYXBzID0gewog - ICAgICAgICAgICAibW9uIjogImFsbG93IHIsIGFsbG93IGNvbW1hbmQgJ29zZCBibG9ja2xpc3Qn - IiwKICAgICAgICAgICAgIm1nciI6ICJhbGxvdyBydyIsCiAgICAgICAgICAgICJvc2QiOiAiYWxs - b3cgcncgdGFnIGNlcGhmcyBtZXRhZGF0YT0qIiwKICAgICAgICB9CiAgICAgICAgaWYgc2VsZi5f - YXJnX3BhcnNlci5yZXN0cmljdGVkX2F1dGhfcGVybWlzc2lvbjoKICAgICAgICAgICAgazhzX2Ns - dXN0ZXJfbmFtZSA9IHNlbGYuX2FyZ19wYXJzZXIuazhzX2NsdXN0ZXJfbmFtZQogICAgICAgICAg - ICBpZiBrOHNfY2x1c3Rlcl9uYW1lID09ICIiOgogICAgICAgICAgICAgICAgcmFpc2UgRXhlY3V0 - aW9uRmFpbHVyZUV4Y2VwdGlvbigKICAgICAgICAgICAgICAgICAgICAiazhzX2NsdXN0ZXJfbmFt - ZSBub3QgZm91bmQsIHBsZWFzZSBzZXQgdGhlICctLWs4cy1jbHVzdGVyLW5hbWUnIGZsYWciCiAg - ICAgICAgICAgICAgICApCiAgICAgICAgICAgIGNlcGhmc19maWxlc3lzdGVtID0gc2VsZi5fYXJn - X3BhcnNlci5jZXBoZnNfZmlsZXN5c3RlbV9uYW1lCiAgICAgICAgICAgIGlmIGNlcGhmc19maWxl - c3lzdGVtID09ICIiOgogICAgICAgICAgICAgICAgZW50aXR5ID0gZiJ7ZW50aXR5fS17azhzX2Ns - dXN0ZXJfbmFtZX0iCiAgICAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICAgICBlbnRpdHkgPSBm - IntlbnRpdHl9LXtrOHNfY2x1c3Rlcl9uYW1lfS17Y2VwaGZzX2ZpbGVzeXN0ZW19IgogICAgICAg - ICAgICAgICAgY2Fwc1sib3NkIl0gPSBmImFsbG93IHJ3IHRhZyBjZXBoZnMgbWV0YWRhdGE9e2Nl - cGhmc19maWxlc3lzdGVtfSIKCiAgICAgICAgcmV0dXJuIGNhcHMsIGVudGl0eQoKICAgIGRlZiBn - ZXRfY2VwaGZzX25vZGVfY2Fwc19hbmRfZW50aXR5KHNlbGYpOgogICAgICAgIGVudGl0eSA9ICJj - bGllbnQuY3NpLWNlcGhmcy1ub2RlIgogICAgICAgIGNhcHMgPSB7CiAgICAgICAgICAgICJtb24i - OiAiYWxsb3cgciwgYWxsb3cgY29tbWFuZCAnb3NkIGJsb2NrbGlzdCciLAogICAgICAgICAgICAi - bWdyIjogImFsbG93IHJ3IiwKICAgICAgICAgICAgIm9zZCI6ICJhbGxvdyBydyB0YWcgY2VwaGZz - ICo9KiIsCiAgICAgICAgICAgICJtZHMiOiAiYWxsb3cgcnciLAogICAgICAgIH0KICAgICAgICBp - ZiBzZWxmLl9hcmdfcGFyc2VyLnJlc3RyaWN0ZWRfYXV0aF9wZXJtaXNzaW9uOgogICAgICAgICAg - ICBrOHNfY2x1c3Rlcl9uYW1lID0gc2VsZi5fYXJnX3BhcnNlci5rOHNfY2x1c3Rlcl9uYW1lCiAg - ICAgICAgICAgIGlmIGs4c19jbHVzdGVyX25hbWUgPT0gIiI6CiAgICAgICAgICAgICAgICByYWlz - ZSBFeGVjdXRpb25GYWlsdXJlRXhjZXB0aW9uKAogICAgICAgICAgICAgICAgICAgICJrOHNfY2x1 - c3Rlcl9uYW1lIG5vdCBmb3VuZCwgcGxlYXNlIHNldCB0aGUgJy0tazhzLWNsdXN0ZXItbmFtZScg - ZmxhZyIKICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgY2VwaGZzX2ZpbGVzeXN0ZW0gPSBz - ZWxmLl9hcmdfcGFyc2VyLmNlcGhmc19maWxlc3lzdGVtX25hbWUKICAgICAgICAgICAgaWYgY2Vw - aGZzX2ZpbGVzeXN0ZW0gPT0gIiI6CiAgICAgICAgICAgICAgICBlbnRpdHkgPSBmIntlbnRpdHl9 - LXtrOHNfY2x1c3Rlcl9uYW1lfSIKICAgICAgICAgICAgZWxzZToKICAgICAgICAgICAgICAgIGVu - dGl0eSA9IGYie2VudGl0eX0te2s4c19jbHVzdGVyX25hbWV9LXtjZXBoZnNfZmlsZXN5c3RlbX0i - CiAgICAgICAgICAgICAgICBjYXBzWyJvc2QiXSA9IGYiYWxsb3cgcncgdGFnIGNlcGhmcyAqPXtj - ZXBoZnNfZmlsZXN5c3RlbX0iCgogICAgICAgIHJldHVybiBjYXBzLCBlbnRpdHkKCiAgICBkZWYg - Z2V0X2VudGl0eSgKICAgICAgICBzZWxmLAogICAgICAgIGVudGl0eSwKICAgICAgICByYmRfcG9v - bF9uYW1lLAogICAgICAgIGFsaWFzX3JiZF9wb29sX25hbWUsCiAgICAgICAgazhzX2NsdXN0ZXJf - bmFtZSwKICAgICAgICByYWRvc19uYW1lc3BhY2UsCiAgICApOgogICAgICAgIGlmICgKICAgICAg - ICAgICAgcmJkX3Bvb2xfbmFtZS5jb3VudCgiLiIpICE9IDAKICAgICAgICAgICAgb3IgcmJkX3Bv - b2xfbmFtZS5jb3VudCgiXyIpICE9IDAKICAgICAgICAgICAgb3IgYWxpYXNfcmJkX3Bvb2xfbmFt - ZSAhPSAiIgogICAgICAgICAgICAjIGNoZWNraW5nIGFsaWFzX3JiZF9wb29sX25hbWUgaXMgbm90 - IGVtcHR5IGFzIHRoZXJlIG1heWJlIGEgc3BlY2lhbCBjaGFyYWN0ZXIgdXNlZCBvdGhlciB0aGFu - IC4gb3IgXwogICAgICAgICk6CiAgICAgICAgICAgIGlmIGFsaWFzX3JiZF9wb29sX25hbWUgPT0g - IiI6CiAgICAgICAgICAgICAgICByYWlzZSBFeGVjdXRpb25GYWlsdXJlRXhjZXB0aW9uKAogICAg - ICAgICAgICAgICAgICAgICJwbGVhc2Ugc2V0IHRoZSAnLS1hbGlhcy1yYmQtZGF0YS1wb29sLW5h - bWUnIGZsYWcgYXMgdGhlIHJiZCBkYXRhIHBvb2wgbmFtZSBjb250YWlucyAnLicgb3IgJ18nIgog - ICAgICAgICAgICAgICAgKQogICAgICAgICAgICBpZiAoCiAgICAgICAgICAgICAgICBhbGlhc19y - YmRfcG9vbF9uYW1lLmNvdW50KCIuIikgIT0gMAogICAgICAgICAgICAgICAgb3IgYWxpYXNfcmJk - X3Bvb2xfbmFtZS5jb3VudCgiXyIpICE9IDAKICAgICAgICAgICAgKToKICAgICAgICAgICAgICAg - IHJhaXNlIEV4ZWN1dGlvbkZhaWx1cmVFeGNlcHRpb24oCiAgICAgICAgICAgICAgICAgICAgIict - LWFsaWFzLXJiZC1kYXRhLXBvb2wtbmFtZScgZmxhZyB2YWx1ZSBzaG91bGQgbm90IGNvbnRhaW4g - Jy4nIG9yICdfJyIKICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgZW50aXR5ID0gZiJ7ZW50 - aXR5fS17azhzX2NsdXN0ZXJfbmFtZX0te2FsaWFzX3JiZF9wb29sX25hbWV9IgogICAgICAgIGVs - c2U6CiAgICAgICAgICAgIGVudGl0eSA9IGYie2VudGl0eX0te2s4c19jbHVzdGVyX25hbWV9LXty - YmRfcG9vbF9uYW1lfSIKCiAgICAgICAgaWYgcmFkb3NfbmFtZXNwYWNlOgogICAgICAgICAgICBl - bnRpdHkgPSBmIntlbnRpdHl9LXtyYWRvc19uYW1lc3BhY2V9IgogICAgICAgIHJldHVybiBlbnRp - dHkKCiAgICBkZWYgZ2V0X3JiZF9wcm92aXNpb25lcl9jYXBzX2FuZF9lbnRpdHkoc2VsZik6CiAg - ICAgICAgZW50aXR5ID0gImNsaWVudC5jc2ktcmJkLXByb3Zpc2lvbmVyIgogICAgICAgIGNhcHMg - PSB7CiAgICAgICAgICAgICJtb24iOiAicHJvZmlsZSByYmQsIGFsbG93IGNvbW1hbmQgJ29zZCBi - bG9ja2xpc3QnIiwKICAgICAgICAgICAgIm1nciI6ICJhbGxvdyBydyIsCiAgICAgICAgICAgICJv - c2QiOiAicHJvZmlsZSByYmQiLAogICAgICAgIH0KICAgICAgICBpZiBzZWxmLl9hcmdfcGFyc2Vy - LnJlc3RyaWN0ZWRfYXV0aF9wZXJtaXNzaW9uOgogICAgICAgICAgICByYmRfcG9vbF9uYW1lID0g - c2VsZi5fYXJnX3BhcnNlci5yYmRfZGF0YV9wb29sX25hbWUKICAgICAgICAgICAgYWxpYXNfcmJk - X3Bvb2xfbmFtZSA9IHNlbGYuX2FyZ19wYXJzZXIuYWxpYXNfcmJkX2RhdGFfcG9vbF9uYW1lCiAg - ICAgICAgICAgIGs4c19jbHVzdGVyX25hbWUgPSBzZWxmLl9hcmdfcGFyc2VyLms4c19jbHVzdGVy - X25hbWUKICAgICAgICAgICA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ICAgICAgICByZXR1cm4gYXJnUC5wYXJzZV9hcmdzKGFy + Z3NfdG9fcGFyc2UpCgogICAgZGVmIHZhbGlkYXRlX3JiZF9tZXRhZGF0YV9lY19wb29sX25hbWUo + c2VsZik6CiAgICAgICAgaWYgc2VsZi5fYXJnX3BhcnNlci5yYmRfbWV0YWRhdGFfZWNfcG9vbF9u + YW1lOgogICAgICAgICAgICByYmRfbWV0YWRhdGFfZWNfcG9vbF9uYW1lID0gc2VsZi5fYXJnX3Bh + cnNlci5yYmRfbWV0YWRhdGFfZWNfcG9vbF9uYW1lCiAgICAgICAgICAgIHJiZF9wb29sX25hbWUg + PSBzZWxmLl9hcmdfcGFyc2VyLnJiZF9kYXRhX3Bvb2xfbmFtZQoKICAgICAgICAgICAgaWYgcmJk + X3Bvb2xfbmFtZSA9PSAiIjoKICAgICAgICAgICAgICAgIHJhaXNlIEV4ZWN1dGlvbkZhaWx1cmVF + eGNlcHRpb24oCiAgICAgICAgICAgICAgICAgICAgIkZsYWcgJy0tcmJkLWRhdGEtcG9vbC1uYW1l + JyBzaG91bGQgbm90IGJlIGVtcHR5IgogICAgICAgICAgICAgICAgKQoKICAgICAgICAgICAgaWYg + cmJkX21ldGFkYXRhX2VjX3Bvb2xfbmFtZSA9PSAiIjoKICAgICAgICAgICAgICAgIHJhaXNlIEV4 + ZWN1dGlvbkZhaWx1cmVFeGNlcHRpb24oCiAgICAgICAgICAgICAgICAgICAgIkZsYWcgJy0tcmJk + LW1ldGFkYXRhLWVjLXBvb2wtbmFtZScgc2hvdWxkIG5vdCBiZSBlbXB0eSIKICAgICAgICAgICAg + ICAgICkKCiAgICAgICAgICAgIGNtZF9qc29uID0geyJwcmVmaXgiOiAib3NkIGR1bXAiLCAiZm9y + bWF0IjogImpzb24ifQogICAgICAgICAgICByZXRfdmFsLCBqc29uX291dCwgZXJyX21zZyA9IHNl + bGYuX2NvbW1vbl9jbWRfanNvbl9nZW4oY21kX2pzb24pCiAgICAgICAgICAgIGlmIHJldF92YWwg + IT0gMCBvciBsZW4oanNvbl9vdXQpID09IDA6CiAgICAgICAgICAgICAgICByYWlzZSBFeGVjdXRp + b25GYWlsdXJlRXhjZXB0aW9uKAogICAgICAgICAgICAgICAgICAgIGYie2NtZF9qc29uWydwcmVm + aXgnXX0gY29tbWFuZCBmYWlsZWQuXG4iCiAgICAgICAgICAgICAgICAgICAgZiJFcnJvcjoge2Vy + cl9tc2cgaWYgcmV0X3ZhbCAhPSAwIGVsc2Ugc2VsZi5FTVBUWV9PVVRQVVRfTElTVH0iCiAgICAg + ICAgICAgICAgICApCiAgICAgICAgICAgIG1ldGFkYXRhX3Bvb2xfZXhpc3QsIHBvb2xfZXhpc3Qg + PSBGYWxzZSwgRmFsc2UKCiAgICAgICAgICAgIGZvciBrZXkgaW4ganNvbl9vdXRbInBvb2xzIl06 + CiAgICAgICAgICAgICAgICAjIGlmIGVyYXN1cmVfY29kZV9wcm9maWxlIGlzIGVtcHR5IGFuZCBw + b29sIG5hbWUgZXhpc3RzIHRoZW4gaXQgcmVwbGljYSBwb29sCiAgICAgICAgICAgICAgICBpZiAo + CiAgICAgICAgICAgICAgICAgICAga2V5WyJlcmFzdXJlX2NvZGVfcHJvZmlsZSJdID09ICIiCiAg + ICAgICAgICAgICAgICAgICAgYW5kIGtleVsicG9vbF9uYW1lIl0gPT0gcmJkX21ldGFkYXRhX2Vj + X3Bvb2xfbmFtZQogICAgICAgICAgICAgICAgKToKICAgICAgICAgICAgICAgICAgICBtZXRhZGF0 + YV9wb29sX2V4aXN0ID0gVHJ1ZQogICAgICAgICAgICAgICAgIyBpZiBlcmFzdXJlX2NvZGVfcHJv + ZmlsZSBpcyBub3QgZW1wdHkgYW5kIHBvb2wgbmFtZSBleGlzdHMgdGhlbiBpdCBpcyBlYyBwb29s + CiAgICAgICAgICAgICAgICBpZiBrZXlbImVyYXN1cmVfY29kZV9wcm9maWxlIl0gYW5kIGtleVsi + cG9vbF9uYW1lIl0gPT0gcmJkX3Bvb2xfbmFtZToKICAgICAgICAgICAgICAgICAgICBwb29sX2V4 + aXN0ID0gVHJ1ZQoKICAgICAgICAgICAgaWYgbm90IG1ldGFkYXRhX3Bvb2xfZXhpc3Q6CiAgICAg + ICAgICAgICAgICByYWlzZSBFeGVjdXRpb25GYWlsdXJlRXhjZXB0aW9uKAogICAgICAgICAgICAg + ICAgICAgICJQcm92aWRlZCByYmRfZWNfbWV0YWRhdGFfcG9vbCBuYW1lLCIKICAgICAgICAgICAg + ICAgICAgICBmIiB7cmJkX21ldGFkYXRhX2VjX3Bvb2xfbmFtZX0sIGRvZXMgbm90IGV4aXN0Igog + ICAgICAgICAgICAgICAgKQogICAgICAgICAgICBpZiBub3QgcG9vbF9leGlzdDoKICAgICAgICAg ICAgICAgIHJhaXNlIEV4ZWN1dGlvbkZhaWx1cmVFeGNlcHRpb24oCiAgICAgICAgICAgICAgICAg - ICAgIm1hbmRhdG9yeSBmbGFnIG5vdCBmb3VuZCwgcGxlYXNlIHNldCB0aGUgJy0tcmJkLWRhdGEt - cG9vbC1uYW1lJyBmbGFnIgogICAgICAgICAgICAgICAgKQogICAgICAgICAgICBpZiBrOHNfY2x1 - c3Rlcl9uYW1lID09ICIiOgogICAgICAgICAgICAgICAgcmFpc2UgRXhlY3V0aW9uRmFpbHVyZUV4 - Y2VwdGlvbigKICAgICAgICAgICAgICAgICAgICAibWFuZGF0b3J5IGZsYWcgbm90IGZvdW5kLCBw - bGVhc2Ugc2V0IHRoZSAnLS1rOHMtY2x1c3Rlci1uYW1lJyBmbGFnIgogICAgICAgICAgICAgICAg - KQogICAgICAgICAgICBlbnRpdHkgPSBzZWxmLmdldF9lbnRpdHkoCiAgICAgICAgICAgICAgICBl - bnRpdHksCiAgICAgICAgICAgICAgICByYmRfcG9vbF9uYW1lLAogICAgICAgICAgICAgICAgYWxp - YXNfcmJkX3Bvb2xfbmFtZSwKICAgICAgICAgICAgICAgIGs4c19jbHVzdGVyX25hbWUsCiAgICAg - ICAgICAgICAgICByYWRvc19uYW1lc3BhY2UsCiAgICAgICAgICAgICkKICAgICAgICAgICAgaWYg - cmFkb3NfbmFtZXNwYWNlICE9ICIiOgogICAgICAgICAgICAgICAgY2Fwc1sib3NkIl0gPSAoCiAg - ICAgICAgICAgICAgICAgICAgZiJwcm9maWxlIHJiZCBwb29sPXtyYmRfcG9vbF9uYW1lfSBuYW1l - c3BhY2U9e3JhZG9zX25hbWVzcGFjZX0iCiAgICAgICAgICAgICAgICApCiAgICAgICAgICAgIGVs - c2U6CiAgICAgICAgICAgICAgICBjYXBzWyJvc2QiXSA9IGYicHJvZmlsZSByYmQgcG9vbD17cmJk - X3Bvb2xfbmFtZX0iCgogICAgICAgIHJldHVybiBjYXBzLCBlbnRpdHkKCiAgICBkZWYgZ2V0X3Ji - ZF9ub2RlX2NhcHNfYW5kX2VudGl0eShzZWxmKToKICAgICAgICBlbnRpdHkgPSAiY2xpZW50LmNz - aS1yYmQtbm9kZSIKICAgICAgICBjYXBzID0gewogICAgICAgICAgICAibW9uIjogInByb2ZpbGUg - cmJkLCBhbGxvdyBjb21tYW5kICdvc2QgYmxvY2tsaXN0JyIsCiAgICAgICAgICAgICJvc2QiOiAi - cHJvZmlsZSByYmQiLAogICAgICAgIH0KICAgICAgICBpZiBzZWxmLl9hcmdfcGFyc2VyLnJlc3Ry - aWN0ZWRfYXV0aF9wZXJtaXNzaW9uOgogICAgICAgICAgICByYmRfcG9vbF9uYW1lID0gc2VsZi5f - YXJnX3BhcnNlci5yYmRfZGF0YV9wb29sX25hbWUKICAgICAgICAgICAgYWxpYXNfcmJkX3Bvb2xf - bmFtZSA9IHNlbGYuX2FyZ19wYXJzZXIuYWxpYXNfcmJkX2RhdGFfcG9vbF9uYW1lCiAgICAgICAg - ICAgIGs4c19jbHVzdGVyX25hbWUgPSBzZWxmLl9hcmdfcGFyc2VyLms4c19jbHVzdGVyX25hbWUK - ICAgICAgICAgICAgcmFkb3NfbmFtZXNwYWNlID0gc2VsZi5fYXJnX3BhcnNlci5yYWRvc19uYW1l - c3BhY2UKICAgICAgICAgICAgaWYgcmJkX3Bvb2xfbmFtZSA9PSAiIjoKICAgICAgICAgICAgICAg - IHJhaXNlIEV4ZWN1dGlvbkZhaWx1cmVFeGNlcHRpb24oCiAgICAgICAgICAgICAgICAgICAgIm1h - bmRhdG9yeSBmbGFnIG5vdCBmb3VuZCwgcGxlYXNlIHNldCB0aGUgJy0tcmJkLWRhdGEtcG9vbC1u - YW1lJyBmbGFnIgogICAgICAgICAgICAgICAgKQogICAgICAgICAgICBpZiBrOHNfY2x1c3Rlcl9u - YW1lID09ICIiOgogICAgICAgICAgICAgICAgcmFpc2UgRXhlY3V0aW9uRmFpbHVyZUV4Y2VwdGlv - bigKICAgICAgICAgICAgICAgICAgICAibWFuZGF0b3J5IGZsYWcgbm90IGZvdW5kLCBwbGVhc2Ug + ICAgZiJQcm92aWRlZCByYmRfZGF0YV9wb29sIG5hbWUsIHtyYmRfcG9vbF9uYW1lfSwgZG9lcyBu + b3QgZXhpc3QiCiAgICAgICAgICAgICAgICApCiAgICAgICAgICAgIHJldHVybiByYmRfbWV0YWRh + dGFfZWNfcG9vbF9uYW1lCgogICAgZGVmIGRyeV9ydW4oc2VsZiwgbXNnKToKICAgICAgICBpZiBz + ZWxmLl9hcmdfcGFyc2VyLmRyeV9ydW46CiAgICAgICAgICAgIHByaW50KCJFeGVjdXRlOiAiICsg + IiciICsgbXNnICsgIiciKQoKICAgIGRlZiB2YWxpZGF0ZV9yZ3dfZW5kcG9pbnRfdGxzX2NlcnQo + c2VsZik6CiAgICAgICAgaWYgc2VsZi5fYXJnX3BhcnNlci5yZ3dfdGxzX2NlcnRfcGF0aDoKICAg + ICAgICAgICAgd2l0aCBvcGVuKHNlbGYuX2FyZ19wYXJzZXIucmd3X3Rsc19jZXJ0X3BhdGgsIGVu + Y29kaW5nPSJ1dGY4IikgYXMgZjoKICAgICAgICAgICAgICAgIGNvbnRlbnRzID0gZi5yZWFkKCkK + ICAgICAgICAgICAgICAgIHJldHVybiBjb250ZW50cy5yc3RyaXAoKQoKICAgIGRlZiBfY2hlY2tf + Y29uZmxpY3Rpbmdfb3B0aW9ucyhzZWxmKToKICAgICAgICBpZiBub3Qgc2VsZi5fYXJnX3BhcnNl + ci51cGdyYWRlIGFuZCBub3Qgc2VsZi5fYXJnX3BhcnNlci5yYmRfZGF0YV9wb29sX25hbWU6CiAg + ICAgICAgICAgIHJhaXNlIEV4ZWN1dGlvbkZhaWx1cmVFeGNlcHRpb24oCiAgICAgICAgICAgICAg + ICAiRWl0aGVyICctLXVwZ3JhZGUnIG9yICctLXJiZC1kYXRhLXBvb2wtbmFtZSA8cG9vbF9uYW1l + Picgc2hvdWxkIGJlIHNwZWNpZmllZCIKICAgICAgICAgICAgKQoKICAgIGRlZiBfaW52YWxpZF9l + bmRwb2ludChzZWxmLCBlbmRwb2ludF9zdHIpOgogICAgICAgICMgZXh0cmFjdCB0aGUgcG9ydCBi + eSBnZXR0aW5nIHRoZSBsYXN0IHNwbGl0IG9uIGA6YCBkZWxpbWl0ZXIKICAgICAgICB0cnk6CiAg + ICAgICAgICAgIGVuZHBvaW50X3N0cl9pcCwgcG9ydCA9IGVuZHBvaW50X3N0ci5yc3BsaXQoIjoi + LCAxKQogICAgICAgIGV4Y2VwdCBWYWx1ZUVycm9yOgogICAgICAgICAgICByYWlzZSBFeGVjdXRp + b25GYWlsdXJlRXhjZXB0aW9uKGYiTm90IGEgcHJvcGVyIGVuZHBvaW50OiB7ZW5kcG9pbnRfc3Ry + fSIpCgogICAgICAgIHRyeToKICAgICAgICAgICAgaWYgZW5kcG9pbnRfc3RyX2lwWzBdID09ICJb + IjoKICAgICAgICAgICAgICAgIGVuZHBvaW50X3N0cl9pcCA9IGVuZHBvaW50X3N0cl9pcFsxIDog + bGVuKGVuZHBvaW50X3N0cl9pcCkgLSAxXQogICAgICAgICAgICBpcF90eXBlID0gKAogICAgICAg + ICAgICAgICAgIklQdjQiIGlmIHR5cGUoaXBfYWRkcmVzcyhlbmRwb2ludF9zdHJfaXApKSBpcyBJ + UHY0QWRkcmVzcyBlbHNlICJJUHY2IgogICAgICAgICAgICApCiAgICAgICAgZXhjZXB0IFZhbHVl + RXJyb3I6CiAgICAgICAgICAgIGlwX3R5cGUgPSAiRlFETiIKICAgICAgICBpZiBub3QgcG9ydC5p + c2RpZ2l0KCk6CiAgICAgICAgICAgIHJhaXNlIEV4ZWN1dGlvbkZhaWx1cmVFeGNlcHRpb24oZiJQ + b3J0IG5vdCB2YWxpZDoge3BvcnR9IikKICAgICAgICBpbnRQb3J0ID0gaW50KHBvcnQpCiAgICAg + ICAgaWYgaW50UG9ydCA8IDEgb3IgaW50UG9ydCA+IDIqKjE2IC0gMToKICAgICAgICAgICAgcmFp + c2UgRXhlY3V0aW9uRmFpbHVyZUV4Y2VwdGlvbihmIk91dCBvZiByYW5nZSBwb3J0IG51bWJlcjog + e3BvcnR9IikKCiAgICAgICAgcmV0dXJuIGlwX3R5cGUKCiAgICBkZWYgZW5kcG9pbnRfZGlhbChz + ZWxmLCBlbmRwb2ludF9zdHIsIGlwX3R5cGUsIHRpbWVvdXQ9MywgY2VydD1Ob25lKToKICAgICAg + ICAjIGlmIHRoZSAnY2x1c3RlcicgaW5zdGFuY2UgaXMgYSBkdW1teSBvbmUsCiAgICAgICAgIyBk + b24ndCB0cnkgdG8gcmVhY2ggb3V0IHRvIHRoZSBlbmRwb2ludAogICAgICAgIGlmIGlzaW5zdGFu + Y2Uoc2VsZi5jbHVzdGVyLCBEdW1teVJhZG9zKToKICAgICAgICAgICAgcmV0dXJuICIiLCAiIiwg + IiIKICAgICAgICBpZiBpcF90eXBlID09ICJJUHY2IjoKICAgICAgICAgICAgdHJ5OgogICAgICAg + ICAgICAgICAgZW5kcG9pbnRfc3RyX2lwLCBlbmRwb2ludF9zdHJfcG9ydCA9IGVuZHBvaW50X3N0 + ci5yc3BsaXQoIjoiLCAxKQogICAgICAgICAgICBleGNlcHQgVmFsdWVFcnJvcjoKICAgICAgICAg + ICAgICAgIHJhaXNlIEV4ZWN1dGlvbkZhaWx1cmVFeGNlcHRpb24oCiAgICAgICAgICAgICAgICAg + ICAgZiJOb3QgYSBwcm9wZXIgZW5kcG9pbnQ6IHtlbmRwb2ludF9zdHJ9IgogICAgICAgICAgICAg + ICAgKQogICAgICAgICAgICBpZiBlbmRwb2ludF9zdHJfaXBbMF0gIT0gIlsiOgogICAgICAgICAg + ICAgICAgZW5kcG9pbnRfc3RyX2lwID0gIlsiICsgZW5kcG9pbnRfc3RyX2lwICsgIl0iCiAgICAg + ICAgICAgIGVuZHBvaW50X3N0ciA9ICI6Ii5qb2luKFtlbmRwb2ludF9zdHJfaXAsIGVuZHBvaW50 + X3N0cl9wb3J0XSkKCiAgICAgICAgcHJvdG9jb2xzID0gWyJodHRwIiwgImh0dHBzIl0KICAgICAg + ICByZXNwb25zZV9lcnJvciA9IE5vbmUKICAgICAgICBmb3IgcHJlZml4IGluIHByb3RvY29sczoK + ICAgICAgICAgICAgdHJ5OgogICAgICAgICAgICAgICAgZXAgPSBmIntwcmVmaXh9Oi8ve2VuZHBv + aW50X3N0cn0iCiAgICAgICAgICAgICAgICB2ZXJpZnkgPSBOb25lCiAgICAgICAgICAgICAgICAj + IElmIHZlcmlmeSBpcyBzZXQgdG8gYSBwYXRoIHRvIGEgZGlyZWN0b3J5LAogICAgICAgICAgICAg + ICAgIyB0aGUgZGlyZWN0b3J5IG11c3QgaGF2ZSBiZWVuIHByb2Nlc3NlZCB1c2luZyB0aGUgY19y + ZWhhc2ggdXRpbGl0eSBzdXBwbGllZCB3aXRoIE9wZW5TU0wuCiAgICAgICAgICAgICAgICBpZiBw + cmVmaXggPT0gImh0dHBzIiBhbmQgc2VsZi5fYXJnX3BhcnNlci5yZ3dfc2tpcF90bHM6CiAgICAg + ICAgICAgICAgICAgICAgdmVyaWZ5ID0gRmFsc2UKICAgICAgICAgICAgICAgICAgICByID0gcmVx + dWVzdHMuaGVhZChlcCwgdGltZW91dD10aW1lb3V0LCB2ZXJpZnk9RmFsc2UpCiAgICAgICAgICAg + ICAgICBlbGlmIHByZWZpeCA9PSAiaHR0cHMiIGFuZCBjZXJ0OgogICAgICAgICAgICAgICAgICAg + IHZlcmlmeSA9IGNlcnQKICAgICAgICAgICAgICAgICAgICByID0gcmVxdWVzdHMuaGVhZChlcCwg + dGltZW91dD10aW1lb3V0LCB2ZXJpZnk9Y2VydCkKICAgICAgICAgICAgICAgIGVsc2U6CiAgICAg + ICAgICAgICAgICAgICAgciA9IHJlcXVlc3RzLmhlYWQoZXAsIHRpbWVvdXQ9dGltZW91dCkKICAg + ICAgICAgICAgICAgIGlmIHIuc3RhdHVzX2NvZGUgPT0gMjAwOgogICAgICAgICAgICAgICAgICAg + IHJldHVybiBwcmVmaXgsIHZlcmlmeSwgIiIKICAgICAgICAgICAgZXhjZXB0IEV4Y2VwdGlvbiBh + cyBlcnI6CiAgICAgICAgICAgICAgICByZXNwb25zZV9lcnJvciA9IGVycgogICAgICAgICAgICAg + ICAgY29udGludWUKICAgICAgICBzeXMuc3RkZXJyLndyaXRlKAogICAgICAgICAgICBmInVuYWJs + ZSB0byBjb25uZWN0IHRvIGVuZHBvaW50OiB7ZW5kcG9pbnRfc3RyfSwgZmFpbGVkIGVycm9yOiB7 + cmVzcG9uc2VfZXJyb3J9IgogICAgICAgICkKICAgICAgICByZXR1cm4gKAogICAgICAgICAgICAi + IiwKICAgICAgICAgICAgIiIsCiAgICAgICAgICAgICgiLTEiKSwKICAgICAgICApCgogICAgZGVm + IF9faW5pdF9fKHNlbGYsIGFyZ19saXN0PU5vbmUpOgogICAgICAgIHNlbGYub3V0X21hcCA9IHt9 + CiAgICAgICAgc2VsZi5fZXhjbHVkZWRfa2V5cyA9IHNldCgpCiAgICAgICAgc2VsZi5fYXJnX3Bh + cnNlciA9IHNlbGYuZ2VuX2FyZ19wYXJzZXIoYXJnc190b19wYXJzZT1hcmdfbGlzdCkKICAgICAg + ICBzZWxmLl9jaGVja19jb25mbGljdGluZ19vcHRpb25zKCkKICAgICAgICBzZWxmLnJ1bl9hc191 + c2VyID0gc2VsZi5fYXJnX3BhcnNlci5ydW5fYXNfdXNlcgogICAgICAgIHNlbGYub3V0cHV0X2Zp + bGUgPSBzZWxmLl9hcmdfcGFyc2VyLm91dHB1dAogICAgICAgIHNlbGYuY2VwaF9jb25mID0gc2Vs + Zi5fYXJnX3BhcnNlci5jZXBoX2NvbmYKICAgICAgICBzZWxmLmNlcGhfa2V5cmluZyA9IHNlbGYu + X2FyZ19wYXJzZXIua2V5cmluZwogICAgICAgICMgaWYgdXNlciBub3QgcHJvdmlkZWQsIGdpdmUg + YSBkZWZhdWx0IHVzZXIKICAgICAgICBpZiBub3Qgc2VsZi5ydW5fYXNfdXNlciBhbmQgbm90IHNl + bGYuX2FyZ19wYXJzZXIudXBncmFkZToKICAgICAgICAgICAgc2VsZi5ydW5fYXNfdXNlciA9IHNl + bGYuRVhURVJOQUxfVVNFUl9OQU1FCiAgICAgICAgaWYgbm90IHNlbGYuX2FyZ19wYXJzZXIucmd3 + X3Bvb2xfcHJlZml4IGFuZCBub3Qgc2VsZi5fYXJnX3BhcnNlci51cGdyYWRlOgogICAgICAgICAg + ICBzZWxmLl9hcmdfcGFyc2VyLnJnd19wb29sX3ByZWZpeCA9IHNlbGYuREVGQVVMVF9SR1dfUE9P + TF9QUkVGSVgKICAgICAgICBpZiBzZWxmLmNlcGhfY29uZjoKICAgICAgICAgICAga3dhcmdzID0g + e30KICAgICAgICAgICAgaWYgc2VsZi5jZXBoX2tleXJpbmc6CiAgICAgICAgICAgICAgICBrd2Fy + Z3NbImNvbmYiXSA9IHsia2V5cmluZyI6IHNlbGYuY2VwaF9rZXlyaW5nfQogICAgICAgICAgICBz + ZWxmLmNsdXN0ZXIgPSByYWRvcy5SYWRvcyhjb25mZmlsZT1zZWxmLmNlcGhfY29uZiwgKiprd2Fy + Z3MpCiAgICAgICAgZWxzZToKICAgICAgICAgICAgc2VsZi5jbHVzdGVyID0gcmFkb3MuUmFkb3Mo + KQogICAgICAgICAgICBzZWxmLmNsdXN0ZXIuY29uZl9yZWFkX2ZpbGUoKQogICAgICAgIHNlbGYu + Y2x1c3Rlci5jb25uZWN0KCkKCiAgICBkZWYgc2h1dGRvd24oc2VsZik6CiAgICAgICAgaWYgc2Vs + Zi5jbHVzdGVyLnN0YXRlID09ICJjb25uZWN0ZWQiOgogICAgICAgICAgICBzZWxmLmNsdXN0ZXIu + c2h1dGRvd24oKQoKICAgIGRlZiBnZXRfZnNpZChzZWxmKToKICAgICAgICBpZiBzZWxmLl9hcmdf + cGFyc2VyLmRyeV9ydW46CiAgICAgICAgICAgIHJldHVybiBzZWxmLmRyeV9ydW4oImNlcGggZnNp + ZCIpCiAgICAgICAgcmV0dXJuIHN0cihzZWxmLmNsdXN0ZXIuZ2V0X2ZzaWQoKSkKCiAgICBkZWYg + X2NvbW1vbl9jbWRfanNvbl9nZW4oc2VsZiwgY21kX2pzb24pOgogICAgICAgIGNtZCA9IGpzb24u + ZHVtcHMoY21kX2pzb24sIHNvcnRfa2V5cz1UcnVlKQogICAgICAgIHJldF92YWwsIGNtZF9vdXQs + IGVycl9tc2cgPSBzZWxmLmNsdXN0ZXIubW9uX2NvbW1hbmQoY21kLCBiIiIpCiAgICAgICAgaWYg + c2VsZi5fYXJnX3BhcnNlci52ZXJib3NlOgogICAgICAgICAgICBwcmludChmIkNvbW1hbmQgSW5w + dXQ6IHtjbWR9IikKICAgICAgICAgICAgcHJpbnQoCiAgICAgICAgICAgICAgICBmIlJldHVybiBW + YWw6IHtyZXRfdmFsfVxuQ29tbWFuZCBPdXRwdXQ6IHtjbWRfb3V0fVxuIgogICAgICAgICAgICAg + ICAgZiJFcnJvciBNZXNzYWdlOiB7ZXJyX21zZ31cbi0tLS0tLS0tLS1cbiIKICAgICAgICAgICAg + KQogICAgICAgIGpzb25fb3V0ID0ge30KICAgICAgICAjIGlmIHRoZXJlIGlzIG5vIGVycm9yIChp + LmU7IHJldF92YWwgaXMgWkVSTykgYW5kICdjbWRfb3V0JyBpcyBub3QgZW1wdHkKICAgICAgICAj + IHRoZW4gY29udmVydCAnY21kX291dCcgdG8gYSBqc29uIG91dHB1dAogICAgICAgIGlmIHJldF92 + YWwgPT0gMCBhbmQgY21kX291dDoKICAgICAgICAgICAganNvbl9vdXQgPSBqc29uLmxvYWRzKGNt + ZF9vdXQpCiAgICAgICAgcmV0dXJuIHJldF92YWwsIGpzb25fb3V0LCBlcnJfbXNnCgogICAgZGVm + IGdldF9jZXBoX2V4dGVybmFsX21vbl9kYXRhKHNlbGYpOgogICAgICAgIGNtZF9qc29uID0geyJw + cmVmaXgiOiAicXVvcnVtX3N0YXR1cyIsICJmb3JtYXQiOiAianNvbiJ9CiAgICAgICAgaWYgc2Vs + Zi5fYXJnX3BhcnNlci5kcnlfcnVuOgogICAgICAgICAgICByZXR1cm4gc2VsZi5kcnlfcnVuKCJj + ZXBoICIgKyBjbWRfanNvblsicHJlZml4Il0pCiAgICAgICAgcmV0X3ZhbCwganNvbl9vdXQsIGVy + cl9tc2cgPSBzZWxmLl9jb21tb25fY21kX2pzb25fZ2VuKGNtZF9qc29uKQogICAgICAgICMgaWYg + dGhlcmUgaXMgYW4gdW5zdWNjZXNzZnVsIGF0dGVtcHQsCiAgICAgICAgaWYgcmV0X3ZhbCAhPSAw + IG9yIGxlbihqc29uX291dCkgPT0gMDoKICAgICAgICAgICAgcmFpc2UgRXhlY3V0aW9uRmFpbHVy + ZUV4Y2VwdGlvbigKICAgICAgICAgICAgICAgICIncXVvcnVtX3N0YXR1cycgY29tbWFuZCBmYWls + ZWQuXG4iCiAgICAgICAgICAgICAgICBmIkVycm9yOiB7ZXJyX21zZyBpZiByZXRfdmFsICE9IDAg + ZWxzZSBzZWxmLkVNUFRZX09VVFBVVF9MSVNUfSIKICAgICAgICAgICAgKQogICAgICAgIHFfbGVh + ZGVyX25hbWUgPSBqc29uX291dFsicXVvcnVtX2xlYWRlcl9uYW1lIl0KICAgICAgICBxX2xlYWRl + cl9kZXRhaWxzID0ge30KICAgICAgICBxX2xlYWRlcl9tYXRjaGluZ19saXN0ID0gWwogICAgICAg + ICAgICBsIGZvciBsIGluIGpzb25fb3V0WyJtb25tYXAiXVsibW9ucyJdIGlmIGxbIm5hbWUiXSA9 + PSBxX2xlYWRlcl9uYW1lCiAgICAgICAgXQogICAgICAgIGlmIGxlbihxX2xlYWRlcl9tYXRjaGlu + Z19saXN0KSA9PSAwOgogICAgICAgICAgICByYWlzZSBFeGVjdXRpb25GYWlsdXJlRXhjZXB0aW9u + KCJObyBtYXRjaGluZyAnbW9uJyBkZXRhaWxzIGZvdW5kIikKICAgICAgICBxX2xlYWRlcl9kZXRh + aWxzID0gcV9sZWFkZXJfbWF0Y2hpbmdfbGlzdFswXQogICAgICAgICMgZ2V0IHRoZSBhZGRyZXNz + IHZlY3RvciBvZiB0aGUgcXVvcnVtLWxlYWRlcgogICAgICAgIHFfbGVhZGVyX2FkZHJ2ZWMgPSBx + X2xlYWRlcl9kZXRhaWxzLmdldCgicHVibGljX2FkZHJzIiwge30pLmdldCgiYWRkcnZlYyIsIFtd + KQogICAgICAgIGlwX2FkZHIgPSBzdHIocV9sZWFkZXJfZGV0YWlsc1sicHVibGljX2FkZHIiXS5z + cGxpdCgiLyIpWzBdKQoKICAgICAgICBpZiBzZWxmLl9hcmdfcGFyc2VyLnYyX3BvcnRfZW5hYmxl + OgogICAgICAgICAgICBpZiBxX2xlYWRlcl9hZGRydmVjWzBdWyJ0eXBlIl0gPT0gInYyIjoKICAg + ICAgICAgICAgICAgIGlwX2FkZHIgPSBxX2xlYWRlcl9hZGRydmVjWzBdWyJhZGRyIl0KICAgICAg + ICAgICAgZWxpZiBsZW4ocV9sZWFkZXJfYWRkcnZlYykgPiAxIGFuZCBxX2xlYWRlcl9hZGRydmVj + WzFdWyJ0eXBlIl0gPT0gInYyIjoKICAgICAgICAgICAgICAgIGlwX2FkZHIgPSBxX2xlYWRlcl9h + ZGRydmVjWzFdWyJhZGRyIl0KICAgICAgICAgICAgZWxzZToKICAgICAgICAgICAgICAgIHN5cy5z + dGRlcnIud3JpdGUoCiAgICAgICAgICAgICAgICAgICAgIid2MicgYWRkcmVzcyB0eXBlIG5vdCBw + cmVzZW50LCBhbmQgJ3YyLXBvcnQtZW5hYmxlJyBmbGFnIGlzIHByb3ZpZGVkIgogICAgICAgICAg + ICAgICAgKQoKICAgICAgICByZXR1cm4gZiJ7c3RyKHFfbGVhZGVyX25hbWUpfT17aXBfYWRkcn0i + CgogICAgZGVmIF9jb252ZXJ0X2hvc3RuYW1lX3RvX2lwKHNlbGYsIGhvc3RfbmFtZSwgcG9ydCwg + aXBfdHlwZSk6CiAgICAgICAgIyBpZiAnY2x1c3RlcicgaW5zdGFuY2UgaXMgYSBkdW1teSB0eXBl + LAogICAgICAgICMgY2FsbCB0aGUgZHVtbXkgaW5zdGFuY2UncyAiY29udmVydCIgbWV0aG9kCiAg + ICAgICAgaWYgbm90IGhvc3RfbmFtZToKICAgICAgICAgICAgcmFpc2UgRXhlY3V0aW9uRmFpbHVy + ZUV4Y2VwdGlvbigiRW1wdHkgaG9zdG5hbWUgcHJvdmlkZWQiKQogICAgICAgIGlmIGlzaW5zdGFu + Y2Uoc2VsZi5jbHVzdGVyLCBEdW1teVJhZG9zKToKICAgICAgICAgICAgcmV0dXJuIHNlbGYuY2x1 + c3Rlci5fY29udmVydF9ob3N0bmFtZV90b19pcChob3N0X25hbWUpCgogICAgICAgIGlmIGlwX3R5 + cGUgPT0gIkZRRE4iOgogICAgICAgICAgICAjIGNoZWNrIHdoaWNoIGlwIEZRRE4gc2hvdWxkIGJl + IGNvbnZlcnRlZCB0bywgSVB2NCBvciBJUHY2CiAgICAgICAgICAgICMgY2hlY2sgdGhlIGhvc3Qg + aXAsIHRoZSBlbmRwb2ludCBpcCB0eXBlIHdvdWxkIGJlIHNpbWlsYXIgdG8gaG9zdCBpcAogICAg + ICAgICAgICBjbWRfanNvbiA9IHsicHJlZml4IjogIm9yY2ggaG9zdCBscyIsICJmb3JtYXQiOiAi + anNvbiJ9CiAgICAgICAgICAgIHJldF92YWwsIGpzb25fb3V0LCBlcnJfbXNnID0gc2VsZi5fY29t + bW9uX2NtZF9qc29uX2dlbihjbWRfanNvbikKICAgICAgICAgICAgIyBpZiB0aGVyZSBpcyBhbiB1 + bnN1Y2Nlc3NmdWwgYXR0ZW1wdCwKICAgICAgICAgICAgaWYgcmV0X3ZhbCAhPSAwIG9yIGxlbihq + c29uX291dCkgPT0gMDoKICAgICAgICAgICAgICAgIHJhaXNlIEV4ZWN1dGlvbkZhaWx1cmVFeGNl + cHRpb24oCiAgICAgICAgICAgICAgICAgICAgIidvcmNoIGhvc3QgbHMnIGNvbW1hbmQgZmFpbGVk + LlxuIgogICAgICAgICAgICAgICAgICAgIGYiRXJyb3I6IHtlcnJfbXNnIGlmIHJldF92YWwgIT0g + MCBlbHNlIHNlbGYuRU1QVFlfT1VUUFVUX0xJU1R9IgogICAgICAgICAgICAgICAgKQogICAgICAg + ICAgICBob3N0X2FkZHIgPSBqc29uX291dFswXVsiYWRkciJdCiAgICAgICAgICAgICMgYWRkIDo4 + MCBzYW1wbGUgcG9ydCBpbiBpcF90eXBlLCBhcyBfaW52YWxpZF9lbmRwb2ludCBhbHNvIHZlcmlm + eSBwb3J0CiAgICAgICAgICAgIGhvc3RfaXBfdHlwZSA9IHNlbGYuX2ludmFsaWRfZW5kcG9pbnQo + aG9zdF9hZGRyICsgIjo4MCIpCiAgICAgICAgICAgIGltcG9ydCBzb2NrZXQKCiAgICAgICAgICAg + IGlwID0gW10KICAgICAgICAgICAgIyBleGFtcGxlIG91dHB1dCBbKDxBZGRyZXNzRmFtaWx5LkFG + X0lORVQ6IDI+LCA8U29ja2V0S2luZC5TT0NLX1NUUkVBTTogMT4sIDYsICcnLCAoJzkzLjE4NC4y + MTYuMzQnLCA4MCkpLCAuLi5dCiAgICAgICAgICAgICMgd2UgbmVlZCB0byBnZXQgOTMuMTg0LjIx + Ni4zNCBzbyBpdCB3b3VsZCBiZSBpcFswXVs0XVswXQogICAgICAgICAgICBpZiBob3N0X2lwX3R5 + cGUgPT0gIklQdjYiOgogICAgICAgICAgICAgICAgaXAgPSBzb2NrZXQuZ2V0YWRkcmluZm8oCiAg + ICAgICAgICAgICAgICAgICAgaG9zdF9uYW1lLCBwb3J0LCBmYW1pbHk9c29ja2V0LkFGX0lORVQ2 + LCBwcm90bz1zb2NrZXQuSVBQUk9UT19UQ1AKICAgICAgICAgICAgICAgICkKICAgICAgICAgICAg + ZWxpZiBob3N0X2lwX3R5cGUgPT0gIklQdjQiOgogICAgICAgICAgICAgICAgaXAgPSBzb2NrZXQu + Z2V0YWRkcmluZm8oCiAgICAgICAgICAgICAgICAgICAgaG9zdF9uYW1lLCBwb3J0LCBmYW1pbHk9 + c29ja2V0LkFGX0lORVQsIHByb3RvPXNvY2tldC5JUFBST1RPX1RDUAogICAgICAgICAgICAgICAg + KQogICAgICAgICAgICBkZWwgc29ja2V0CiAgICAgICAgICAgIHJldHVybiBpcFswXVs0XVswXQog + ICAgICAgIHJldHVybiBob3N0X25hbWUKCiAgICBkZWYgZ2V0X2FjdGl2ZV9hbmRfc3RhbmRieV9t + Z3JzKHNlbGYpOgogICAgICAgIGlmIHNlbGYuX2FyZ19wYXJzZXIuZHJ5X3J1bjoKICAgICAgICAg + ICAgcmV0dXJuICIiLCBzZWxmLmRyeV9ydW4oImNlcGggc3RhdHVzIikKICAgICAgICBtb25pdG9y + aW5nX2VuZHBvaW50X3BvcnQgPSBzZWxmLl9hcmdfcGFyc2VyLm1vbml0b3JpbmdfZW5kcG9pbnRf + cG9ydAogICAgICAgIG1vbml0b3JpbmdfZW5kcG9pbnRfaXBfbGlzdCA9IHNlbGYuX2FyZ19wYXJz + ZXIubW9uaXRvcmluZ19lbmRwb2ludAogICAgICAgIHN0YW5kYnlfbWdycyA9IFtdCiAgICAgICAg + aWYgbm90IG1vbml0b3JpbmdfZW5kcG9pbnRfaXBfbGlzdDoKICAgICAgICAgICAgY21kX2pzb24g + PSB7InByZWZpeCI6ICJzdGF0dXMiLCAiZm9ybWF0IjogImpzb24ifQogICAgICAgICAgICByZXRf + dmFsLCBqc29uX291dCwgZXJyX21zZyA9IHNlbGYuX2NvbW1vbl9jbWRfanNvbl9nZW4oY21kX2pz + b24pCiAgICAgICAgICAgICMgaWYgdGhlcmUgaXMgYW4gdW5zdWNjZXNzZnVsIGF0dGVtcHQsCiAg + ICAgICAgICAgIGlmIHJldF92YWwgIT0gMCBvciBsZW4oanNvbl9vdXQpID09IDA6CiAgICAgICAg + ICAgICAgICByYWlzZSBFeGVjdXRpb25GYWlsdXJlRXhjZXB0aW9uKAogICAgICAgICAgICAgICAg + ICAgICInbWdyIHNlcnZpY2VzJyBjb21tYW5kIGZhaWxlZC5cbiIKICAgICAgICAgICAgICAgICAg + ICBmIkVycm9yOiB7ZXJyX21zZyBpZiByZXRfdmFsICE9IDAgZWxzZSBzZWxmLkVNUFRZX09VVFBV + VF9MSVNUfSIKICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgbW9uaXRvcmluZ19lbmRwb2lu + dCA9ICgKICAgICAgICAgICAgICAgIGpzb25fb3V0LmdldCgibWdybWFwIiwge30pLmdldCgic2Vy + dmljZXMiLCB7fSkuZ2V0KCJwcm9tZXRoZXVzIiwgIiIpCiAgICAgICAgICAgICkKICAgICAgICAg + ICAgaWYgbm90IG1vbml0b3JpbmdfZW5kcG9pbnQ6CiAgICAgICAgICAgICAgICByYWlzZSBFeGVj + dXRpb25GYWlsdXJlRXhjZXB0aW9uKAogICAgICAgICAgICAgICAgICAgICJjYW4ndCBmaW5kIG1v + bml0b3JpbmdfZW5kcG9pbnQsIHByb21ldGhldXMgbW9kdWxlIG1pZ2h0IG5vdCBiZSBlbmFibGVk + LCAiCiAgICAgICAgICAgICAgICAgICAgImVuYWJsZSB0aGUgbW9kdWxlIGJ5IHJ1bm5pbmcgJ2Nl + cGggbWdyIG1vZHVsZSBlbmFibGUgcHJvbWV0aGV1cyciCiAgICAgICAgICAgICAgICApCiAgICAg + ICAgICAgICMgbm93IGNoZWNrIHRoZSBzdGFuZC1ieSBtZ3ItcwogICAgICAgICAgICBzdGFuZGJ5 + X2FyciA9IGpzb25fb3V0LmdldCgibWdybWFwIiwge30pLmdldCgic3RhbmRieXMiLCBbXSkKICAg + ICAgICAgICAgZm9yIGVhY2hfc3RhbmRieSBpbiBzdGFuZGJ5X2FycjoKICAgICAgICAgICAgICAg + IGlmICJuYW1lIiBpbiBlYWNoX3N0YW5kYnkua2V5cygpOgogICAgICAgICAgICAgICAgICAgIHN0 + YW5kYnlfbWdycy5hcHBlbmQoZWFjaF9zdGFuZGJ5WyJuYW1lIl0pCiAgICAgICAgICAgIHRyeToK + ICAgICAgICAgICAgICAgIHBhcnNlZF9lbmRwb2ludCA9IHVybHBhcnNlKG1vbml0b3JpbmdfZW5k + cG9pbnQpCiAgICAgICAgICAgIGV4Y2VwdCBWYWx1ZUVycm9yOgogICAgICAgICAgICAgICAgcmFp + c2UgRXhlY3V0aW9uRmFpbHVyZUV4Y2VwdGlvbigKICAgICAgICAgICAgICAgICAgICBmImludmFs + aWQgZW5kcG9pbnQ6IHttb25pdG9yaW5nX2VuZHBvaW50fSIKICAgICAgICAgICAgICAgICkKICAg + ICAgICAgICAgbW9uaXRvcmluZ19lbmRwb2ludF9pcF9saXN0ID0gcGFyc2VkX2VuZHBvaW50Lmhv + c3RuYW1lCiAgICAgICAgICAgIGlmIG5vdCBtb25pdG9yaW5nX2VuZHBvaW50X3BvcnQ6CiAgICAg + ICAgICAgICAgICBtb25pdG9yaW5nX2VuZHBvaW50X3BvcnQgPSBzdHIocGFyc2VkX2VuZHBvaW50 + LnBvcnQpCgogICAgICAgICMgaWYgbW9uaXRvcmluZyBlbmRwb2ludCBwb3J0IGlzIG5vdCBzZXQs + IHB1dCBhIGRlZmF1bHQgbW9uIHBvcnQKICAgICAgICBpZiBub3QgbW9uaXRvcmluZ19lbmRwb2lu + dF9wb3J0OgogICAgICAgICAgICBtb25pdG9yaW5nX2V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CA9IG1vbml0b3JpbmdfZW5kcG9p + bnRfaXAKCiAgICAgICAgbW9uaXRvcmluZ19lbmRwb2ludCA9ICI6Ii5qb2luKAogICAgICAgICAg + ICBbbW9uaXRvcmluZ19lbmRwb2ludF9pcCwgbW9uaXRvcmluZ19lbmRwb2ludF9wb3J0XQogICAg + ICAgICkKICAgICAgICBpcF90eXBlID0gc2VsZi5faW52YWxpZF9lbmRwb2ludChtb25pdG9yaW5n + X2VuZHBvaW50KQogICAgICAgIHRyeToKICAgICAgICAgICAgbW9uaXRvcmluZ19lbmRwb2ludF9p + cCA9IHNlbGYuX2NvbnZlcnRfaG9zdG5hbWVfdG9faXAoCiAgICAgICAgICAgICAgICBtb25pdG9y + aW5nX2VuZHBvaW50X2lwLCBtb25pdG9yaW5nX2VuZHBvaW50X3BvcnQsIGlwX3R5cGUKICAgICAg + ICAgICAgKQogICAgICAgICAgICAjIGNvbGxlY3QgYWxsIHRoZSAnc3RhbmQtYnknIG1nciBpcHMK + ICAgICAgICAgICAgbWdyX2lwcyA9IFtdCiAgICAgICAgICAgIGZvciBlYWNoX3N0YW5kYnlfbWdy + IGluIHN0YW5kYnlfbWdyczoKICAgICAgICAgICAgICAgIGZhaWxlZF9pcCA9IGVhY2hfc3RhbmRi + eV9tZ3IKICAgICAgICAgICAgICAgIG1ncl9pcHMuYXBwZW5kKAogICAgICAgICAgICAgICAgICAg + IHNlbGYuX2NvbnZlcnRfaG9zdG5hbWVfdG9faXAoCiAgICAgICAgICAgICAgICAgICAgICAgIGVh + Y2hfc3RhbmRieV9tZ3IsIG1vbml0b3JpbmdfZW5kcG9pbnRfcG9ydCwgaXBfdHlwZQogICAgICAg + ICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICkKICAgICAgICBleGNlcHQ6CiAgICAgICAg + ICAgIHJhaXNlIEV4ZWN1dGlvbkZhaWx1cmVFeGNlcHRpb24oCiAgICAgICAgICAgICAgICBmIkNv + bnZlcnNpb24gb2YgaG9zdDoge2ZhaWxlZF9pcH0gdG8gSVAgZmFpbGVkLiAiCiAgICAgICAgICAg + ICAgICAiUGxlYXNlIGVudGVyIHRoZSBJUCBhZGRyZXNzZXMgb2YgYWxsIHRoZSBjZXBoLW1ncnMg + d2l0aCB0aGUgJy0tbW9uaXRvcmluZy1lbmRwb2ludCcgZmxhZyIKICAgICAgICAgICAgKQoKICAg + ICAgICBfLCBfLCBlcnIgPSBzZWxmLmVuZHBvaW50X2RpYWwobW9uaXRvcmluZ19lbmRwb2ludCwg + aXBfdHlwZSkKICAgICAgICBpZiBlcnIgPT0gIi0xIjoKICAgICAgICAgICAgcmFpc2UgRXhlY3V0 + aW9uRmFpbHVyZUV4Y2VwdGlvbihlcnIpCiAgICAgICAgIyBhZGQgdGhlIHZhbGlkYXRlZCBhY3Rp + dmUgbWdyIElQIGludG8gdGhlIGZpcnN0IGluZGV4CiAgICAgICAgbWdyX2lwcy5pbnNlcnQoMCwg + bW9uaXRvcmluZ19lbmRwb2ludF9pcCkKICAgICAgICBhbGxfbWdyX2lwc19zdHIgPSAiLCIuam9p + bihtZ3JfaXBzKQogICAgICAgIHJldHVybiBhbGxfbWdyX2lwc19zdHIsIG1vbml0b3JpbmdfZW5k + cG9pbnRfcG9ydAoKICAgIGRlZiBjaGVja191c2VyX2V4aXN0KHNlbGYsIHVzZXIpOgogICAgICAg + IGNtZF9qc29uID0geyJwcmVmaXgiOiAiYXV0aCBnZXQiLCAiZW50aXR5IjogZiJ7dXNlcn0iLCAi + Zm9ybWF0IjogImpzb24ifQogICAgICAgIHJldF92YWwsIGpzb25fb3V0LCBfID0gc2VsZi5fY29t + bW9uX2NtZF9qc29uX2dlbihjbWRfanNvbikKICAgICAgICBpZiByZXRfdmFsICE9IDAgb3IgbGVu + KGpzb25fb3V0KSA9PSAwOgogICAgICAgICAgICByZXR1cm4gIiIKICAgICAgICByZXR1cm4gc3Ry + KGpzb25fb3V0WzBdWyJrZXkiXSkKCiAgICBkZWYgZ2V0X2NlcGhmc19wcm92aXNpb25lcl9jYXBz + X2FuZF9lbnRpdHkoc2VsZik6CiAgICAgICAgZW50aXR5ID0gImNsaWVudC5jc2ktY2VwaGZzLXBy + b3Zpc2lvbmVyIgogICAgICAgIGNhcHMgPSB7CiAgICAgICAgICAgICJtb24iOiAiYWxsb3cgciwg + YWxsb3cgY29tbWFuZCAnb3NkIGJsb2NrbGlzdCciLAogICAgICAgICAgICAibWdyIjogImFsbG93 + IHJ3IiwKICAgICAgICAgICAgIm9zZCI6ICJhbGxvdyBydyB0YWcgY2VwaGZzIG1ldGFkYXRhPSoi + LAogICAgICAgIH0KICAgICAgICBpZiBzZWxmLl9hcmdfcGFyc2VyLnJlc3RyaWN0ZWRfYXV0aF9w + ZXJtaXNzaW9uOgogICAgICAgICAgICBrOHNfY2x1c3Rlcl9uYW1lID0gc2VsZi5fYXJnX3BhcnNl + ci5rOHNfY2x1c3Rlcl9uYW1lCiAgICAgICAgICAgIGlmIGs4c19jbHVzdGVyX25hbWUgPT0gIiI6 + CiAgICAgICAgICAgICAgICByYWlzZSBFeGVjdXRpb25GYWlsdXJlRXhjZXB0aW9uKAogICAgICAg + ICAgICAgICAgICAgICJrOHNfY2x1c3Rlcl9uYW1lIG5vdCBmb3VuZCwgcGxlYXNlIHNldCB0aGUg + Jy0tazhzLWNsdXN0ZXItbmFtZScgZmxhZyIKICAgICAgICAgICAgICAgICkKICAgICAgICAgICAg + Y2VwaGZzX2ZpbGVzeXN0ZW0gPSBzZWxmLl9hcmdfcGFyc2VyLmNlcGhmc19maWxlc3lzdGVtX25h + bWUKICAgICAgICAgICAgaWYgY2VwaGZzX2ZpbGVzeXN0ZW0gPT0gIiI6CiAgICAgICAgICAgICAg + ICBlbnRpdHkgPSBmIntlbnRpdHl9LXtrOHNfY2x1c3Rlcl9uYW1lfSIKICAgICAgICAgICAgZWxz + ZToKICAgICAgICAgICAgICAgIGVudGl0eSA9IGYie2VudGl0eX0te2s4c19jbHVzdGVyX25hbWV9 + LXtjZXBoZnNfZmlsZXN5c3RlbX0iCiAgICAgICAgICAgICAgICBjYXBzWyJvc2QiXSA9IGYiYWxs + b3cgcncgdGFnIGNlcGhmcyBtZXRhZGF0YT17Y2VwaGZzX2ZpbGVzeXN0ZW19IgoKICAgICAgICBy + ZXR1cm4gY2FwcywgZW50aXR5CgogICAgZGVmIGdldF9jZXBoZnNfbm9kZV9jYXBzX2FuZF9lbnRp + dHkoc2VsZik6CiAgICAgICAgZW50aXR5ID0gImNsaWVudC5jc2ktY2VwaGZzLW5vZGUiCiAgICAg + ICAgY2FwcyA9IHsKICAgICAgICAgICAgIm1vbiI6ICJhbGxvdyByLCBhbGxvdyBjb21tYW5kICdv + c2QgYmxvY2tsaXN0JyIsCiAgICAgICAgICAgICJtZ3IiOiAiYWxsb3cgcnciLAogICAgICAgICAg + ICAib3NkIjogImFsbG93IHJ3IHRhZyBjZXBoZnMgKj0qIiwKICAgICAgICAgICAgIm1kcyI6ICJh + bGxvdyBydyIsCiAgICAgICAgfQogICAgICAgIGlmIHNlbGYuX2FyZ19wYXJzZXIucmVzdHJpY3Rl + ZF9hdXRoX3Blcm1pc3Npb246CiAgICAgICAgICAgIGs4c19jbHVzdGVyX25hbWUgPSBzZWxmLl9h + cmdfcGFyc2VyLms4c19jbHVzdGVyX25hbWUKICAgICAgICAgICAgaWYgazhzX2NsdXN0ZXJfbmFt + ZSA9PSAiIjoKICAgICAgICAgICAgICAgIHJhaXNlIEV4ZWN1dGlvbkZhaWx1cmVFeGNlcHRpb24o + CiAgICAgICAgICAgICAgICAgICAgIms4c19jbHVzdGVyX25hbWUgbm90IGZvdW5kLCBwbGVhc2Ug c2V0IHRoZSAnLS1rOHMtY2x1c3Rlci1uYW1lJyBmbGFnIgogICAgICAgICAgICAgICAgKQogICAg - ICAgICAgICBlbnRpdHkgPSBzZWxmLmdldF9lbnRpdHkoCiAgICAgICAgICAgICAgICBlbnRpdHks - CiAgICAgICAgICAgICAgICByYmRfcG9vbF9uYW1lLAogICAgICAgICAgICAgICAgYWxpYXNfcmJk - X3Bvb2xfbmFtZSwKICAgICAgICAgICAgICAgIGs4c19jbHVzdGVyX25hbWUsCiAgICAgICAgICAg - ICAgICByYWRvc19uYW1lc3BhY2UsCiAgICAgICAgICAgICkKICAgICAgICAgICAgaWYgcmFkb3Nf - bmFtZXNwYWNlICE9ICIiOgogICAgICAgICAgICAgICAgY2Fwc1sib3NkIl0gPSAoCiAgICAgICAg - ICAgICAgICAgICAgZiJwcm9maWxlIHJiZCBwb29sPXtyYmRfcG9vbF9uYW1lfSBuYW1lc3BhY2U9 - e3JhZG9zX25hbWVzcGFjZX0iCiAgICAgICAgICAgICAgICApCiAgICAgICAgICAgIGVsc2U6CiAg - ICAgICAgICAgICAgICBjYXBzWyJvc2QiXSA9IGYicHJvZmlsZSByYmQgcG9vbD17cmJkX3Bvb2xf - bmFtZX0iCgogICAgICAgIHJldHVybiBjYXBzLCBlbnRpdHkKCiAgICBkZWYgZ2V0X2RlZmF1bHRV - c2VyX2NhcHNfYW5kX2VudGl0eShzZWxmKToKICAgICAgICBlbnRpdHkgPSBzZWxmLnJ1bl9hc191 - c2VyCiAgICAgICAgY2FwcyA9IHsKICAgICAgICAgICAgIm1vbiI6ICJhbGxvdyByLCBhbGxvdyBj - b21tYW5kIHF1b3J1bV9zdGF0dXMsIGFsbG93IGNvbW1hbmQgdmVyc2lvbiIsCiAgICAgICAgICAg - ICJtZ3IiOiAiYWxsb3cgY29tbWFuZCBjb25maWciLAogICAgICAgICAgICAib3NkIjogZiJwcm9m - aWxlIHJiZC1yZWFkLW9ubHksIGFsbG93IHJ3eCBwb29sPXtzZWxmLl9hcmdfcGFyc2VyLnJnd19w - b29sX3ByZWZpeH0ucmd3Lm1ldGEsIGFsbG93IHIgcG9vbD0ucmd3LnJvb3QsIGFsbG93IHJ3IHBv - b2w9e3NlbGYuX2FyZ19wYXJzZXIucmd3X3Bvb2xfcHJlZml4fS5yZ3cuY29udHJvbCwgYWxsb3cg - cnggcG9vbD17c2VsZi5fYXJnX3BhcnNlci5yZ3dfcG9vbF9wcmVmaXh9LnJndy5sb2csIGFsbG93 - IHggcG9vbD17c2VsZi5fYXJnX3BhcnNlci5yZ3dfcG9vbF9wcmVmaXh9LnJndy5idWNrZXRzLmlu - ZGV4IiwKICAgICAgICB9CgogICAgICAgIHJldHVybiBjYXBzLCBlbnRpdHkKCiAgICBkZWYgZ2V0 - X2NhcHNfYW5kX2VudGl0eShzZWxmLCB1c2VyX25hbWUpOgogICAgICAgIGlmICJjbGllbnQuY3Np - LWNlcGhmcy1wcm92aXNpb25lciIgaW4gdXNlcl9uYW1lOgogICAgICAgICAgICBpZiAiY2xpZW50 - LmNzaS1jZXBoZnMtcHJvdmlzaW9uZXIiICE9IHVzZXJfbmFtZToKICAgICAgICAgICAgICAgIHNl - bGYuX2FyZ19wYXJzZXIucmVzdHJpY3RlZF9hdXRoX3Blcm1pc3Npb24gPSBUcnVlCiAgICAgICAg - ICAgIHJldHVybiBzZWxmLmdldF9jZXBoZnNfcHJvdmlzaW9uZXJfY2Fwc19hbmRfZW50aXR5KCkK - ICAgICAgICBpZiAiY2xpZW50LmNzaS1jZXBoZnMtbm9kZSIgaW4gdXNlcl9uYW1lOgogICAgICAg - ICAgICBpZiAiY2xpZW50LmNzaS1jZXBoZnMtbm9kZSIgIT0gdXNlcl9uYW1lOgogICAgICAgICAg - ICAgICAgc2VsZi5fYXJnX3BhcnNlci5yZXN0cmljdGVkX2F1dGhfcGVybWlzc2lvbiA9IFRydWUK - ICAgICAgICAgICAgcmV0dXJuIHNlbGYuZ2V0X2NlcGhmc19ub2RlX2NhcHNfYW5kX2VudGl0eSgp - CiAgICAgICAgaWYgImNsaWVudC5jc2ktcmJkLXByb3Zpc2lvbmVyIiBpbiB1c2VyX25hbWU6CiAg - ICAgICAgICAgIGlmICJjbGllbnQuY3NpLXJiZC1wcm92aXNpb25lciIgIT0gdXNlcl9uYW1lOgog - ICAgICAgICAgICAgICAgc2VsZi5fYXJnX3BhcnNlci5yZXN0cmljdGVk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Zz - LXByb3Zpc2lvbmVyIG1vbiAnYWxsb3cgcicgbWdyICdhbGxvdyBydycgb3NkICdhbGxvdyBydyB0 - YWcgY2VwaGZzIG1ldGFkYXRhPSonCiAgICAgICAgIiIiCiAgICAgICAgY2FwcywgZW50aXR5ID0g - c2VsZi5nZXRfY2Fwc19hbmRfZW50aXR5KHVzZXIpCiAgICAgICAgY21kX2pzb24gPSB7CiAgICAg - ICAgICAgICJwcmVmaXgiOiAiYXV0aCBnZXQtb3ItY3JlYXRlIiwKICAgICAgICAgICAgImVudGl0 - eSI6IGVudGl0eSwKICAgICAgICAgICAgImNhcHMiOiBbY2FwIGZvciBjYXBfbGlzdCBpbiBsaXN0 - KGNhcHMuaXRlbXMoKSkgZm9yIGNhcCBpbiBjYXBfbGlzdF0sCiAgICAgICAgICAgICJmb3JtYXQi - OiAianNvbiIsCiAgICAgICAgfQoKICAgICAgICBpZiBzZWxmLl9hcmdfcGFyc2VyLmRyeV9ydW46 - CiAgICAgICAgICAgIHJldHVybiAoCiAgICAgICAgICAgICAgICBzZWxmLmRyeV9ydW4oCiAgICAg - ICAgICAgICAgICAgICAgImNlcGggIgogICAgICAgICAgICAgICAgICAgICsgY21kX2pzb25bInBy - ZWZpeCJdCiAgICAgICAgICAgICAgICAgICAgKyAiICIKICAgICAgICAgICAgICAgICAgICArIGNt - ZF9qc29uWyJlbnRpdHkiXQogICAgICAgICAgICAgICAgICAgICsgIiAiCiAgICAgICAgICAgICAg - ICAgICAgKyAiICIuam9pbihjbWRfanNvblsiY2FwcyJdKQogICAgICAgICAgICAgICAgKSwKICAg - ICAgICAgICAgICAgICIiLAogICAgICAgICAgICApCiAgICAgICAgIyBjaGVjayBpZiB1c2VyIGFs - cmVhZHkgZXhpc3QKICAgICAgICB1c2VyX2tleSA9IHNlbGYuY2hlY2tfdXNlcl9leGlzdChlbnRp - dHkpCiAgICAgICAgaWYgdXNlcl9rZXkgIT0gIiI6CiAgICAgICAgICAgIHJldHVybiB1c2VyX2tl - eSwgZiJ7ZW50aXR5LnNwbGl0KCcuJywgMSlbMV19IgogICAgICAgICAgICAjIGVudGl0eS5zcGxp - dCgnLicsMSlbMV0gdG8gcmVuYW1lIGVudGl0eShjbGllbnQuY3NpLXJiZC1ub2RlKSBhcyBjc2kt - cmJkLW5vZGUKCiAgICAgICAgcmV0X3ZhbCwganNvbl9vdXQsIGVycl9tc2cgPSBzZWxmLl9jb21t - b25fY21kX2pzb25fZ2VuKGNtZF9qc29uKQogICAgICAgICMgaWYgdGhlcmUgaXMgYW4gdW5zdWNj - ZXNzZnVsIGF0dGVtcHQsCiAgICAgICAgaWYgcmV0X3ZhbCAhPSAwIG9yIGxlbihqc29uX291dCkg - PT0gMDoKICAgICAgICAgICAgcmFpc2UgRXhlY3V0aW9uRmFpbHVyZUV4Y2VwdGlvbigKICAgICAg - ICAgICAgICAgIGYiJ2F1dGggZ2V0LW9yLWNyZWF0ZSB7dXNlcn0nIGNvbW1hbmQgZmFpbGVkLlxu - IgogICAgICAgICAgICAgICAgZiJFcnJvcjoge2Vycl9tc2cgaWYgcmV0X3ZhbCAhPSAwIGVsc2Ug - c2VsZi5FTVBUWV9PVVRQVVRfTElTVH0iCiAgICAgICAgICAgICkKICAgICAgICByZXR1cm4gc3Ry - KGpzb25fb3V0WzBdWyJrZXkiXSksIGYie2VudGl0eS5zcGxpdCgnLicsIDEpWzFdfSIKICAgICAg - ICAjIGVudGl0eS5zcGxpdCgnLicsMSlbMV0gdG8gcmVuYW1lIGVudGl0eShjbGllbnQuY3NpLXJi - ZC1ub2RlKSBhcyBjc2ktcmJkLW5vZGUKCiAgICBkZWYgZ2V0X2NlcGhmc19kYXRhX3Bvb2xfZGV0 - YWlscyhzZWxmKToKICAgICAgICBjbWRfanNvbiA9IHsicHJlZml4IjogImZzIGxzIiwgImZvcm1h - dCI6ICJqc29uIn0KICAgICAgICBpZiBzZWxmLl9hcmdfcGFyc2VyLmRyeV9ydW46CiAgICAgICAg - ICAgIHJldHVybiBzZWxmLmRyeV9ydW4oImNlcGggIiArIGNtZF9qc29uWyJwcmVmaXgiXSkKICAg - ICAgICByZXRfdmFsLCBqc29uX291dCwgZXJyX21zZyA9IHNlbGYuX2NvbW1vbl9jbWRfanNvbl9n - ZW4oY21kX2pzb24pCiAgICAgICAgIyBpZiB0aGVyZSBpcyBhbiB1bnN1Y2Nlc3NmdWwgYXR0ZW1w - dCwgcmVwb3J0IGFuIGVycm9yCiAgICAgICAgaWYgcmV0X3ZhbCAhPSAwOgogICAgICAgICAgICAj - IGlmIGZzIGFuZCBkYXRhX3Bvb2wgYXJndW1lbnRzIGFyZSBub3Qgc2V0LCBzaWxlbnRseSByZXR1 - cm4KICAgICAgICAgICAgaWYgKAogICAgICAgICAgICAgICAgc2VsZi5fYXJnX3BhcnNlci5jZXBo - ZnNfZmlsZXN5c3RlbV9uYW1lID09ICIiCiAgICAgICAgICAgICAgICBhbmQgc2VsZi5fYXJnX3Bh - cnNlci5jZXBoZnNfZGF0YV9wb29sX25hbWUgPT0gIiIKICAgICAgICAgICAgKToKICAgICAgICAg - ICAgICAgIHJldHVybgogICAgICAgICAgICAjIGlmIHVzZXIgaGFzIHByb3ZpZGVkIGFueSBvZiB0 - aGUKICAgICAgICAgICAgIyAnLS1jZXBoZnMtZmlsZXN5c3RlbS1uYW1lJyBvciAnLS1jZXBoZnMt - ZGF0YS1wb29sLW5hbWUnIGFyZ3VtZW50cywKICAgICAgICAgICAgIyByYWlzZSBhbiBleGNlcHRp - b24gYXMgd2UgYXJlIHVuYWJsZSB0byB2ZXJpZnkgdGhlIGFyZ3MKICAgICAgICAgICAgcmFpc2Ug - RXhlY3V0aW9uRmFpbHVyZUV4Y2VwdGlvbigKICAgICAgICAgICAgICAgIGYiJ2ZzIGxzJyBjZXBo - IGNhbGwgZmFpbGVkIHdpdGggZXJyb3I6IHtlcnJfbXNnfSIKICAgICAgICAgICAgKQoKICAgICAg - ICBtYXRjaGluZ19qc29uX291dCA9IHt9CiAgICAgICAgIyBpZiAnLS1jZXBoZnMtZmlsZXN5c3Rl - bS1uYW1lJyBhcmd1bWVudCBpcyBwcm92aWRlZCwKICAgICAgICAjIGNoZWNrIHdoZXRoZXIgdGhl - IHByb3ZpZGVkIGZpbGVzeXN0ZW0tbmFtZSBleGlzdHMgb3Igbm90CiAgICAgICAgaWYgc2VsZi5f - YXJnX3BhcnNlci5jZXBoZnNfZmlsZXN5c3RlbV9uYW1lOgogICAgICAgICAgICAjIGdldCB0aGUg - bWF0Y2hpbmcgbGlzdAogICAgICAgICAgICBtYXRjaGluZ19qc29uX291dF9saXN0ID0gWwogICAg - ICAgICAgICAgICAgbWF0Y2hlZAogICAgICAgICAgICAgICAgZm9yIG1hdGNoZWQgaW4ganNvbl9v - dXQKICAgICAgICAgICAgICAgIGlmIHN0cihtYXRjaGVkWyJuYW1lIl0pID09IHNlbGYuX2FyZ19w - YXJzZXIuY2VwaGZzX2ZpbGVzeXN0ZW1fbmFtZQogICAgICAgICAgICBdCiAgICAgICAgICAgICMg - dW5hYmxlIHRvIGZpbmQgYSBtYXRjaGluZyBmcy1uYW1lLCByYWlzZSBhbiBlcnJvcgogICAgICAg - ICAgICBpZiBsZW4obWF0Y2hpbmdfanNvbl9vdXRfbGlzdCkgPT0gMDoKICAgICAgICAgICAgICAg - IHJhaXNlIEV4ZWN1dGlvbkZhaWx1cmVFeGNlcHRpb24oCiAgICAgICAgICAgICAgICAgICAgZiJG - aWxlc3lzdGVtIHByb3ZpZGVkLCAne3NlbGYuX2FyZ19wYXJzZXIuY2VwaGZzX2ZpbGVzeXN0ZW1f - bmFtZX0nLCAiCiAgICAgICAgICAgICAgICAgICAgZiJpcyBub3QgZm91bmQgaW4gdGhlIGZzLWxp - c3Q6IHtbc3RyKHhbJ25hbWUnXSkgZm9yIHggaW4ganNvbl9vdXRdfSIKICAgICAgICAgICAgICAg - ICkKICAgICAgICAgICAgbWF0Y2hpbmdfanNvbl9vdXQgPSBtYXRjaGluZ19qc29uX291dF9saXN0 - WzBdCiAgICAgICAgIyBpZiBjZXBoZnMgZmlsZXN5c3RlbSBuYW1lIGlzIG5vdCBwcm92aWRlZCwK - ICAgICAgICAjIHRyeSB0byBnZXQgYSBkZWZhdWx0IGZzIG5hbWUgYnkgZG9pbmcgdGhlIGZvbGxv - d2luZwogICAgICAgIGVsc2U6CiAgICAgICAgICAgICMgYS4gY2hlY2sgaWYgdGhlcmUgaXMgb25s - eSBvbmUgZmlsZXN5c3RlbSBpcyBwcmVzZW50CiAgICAgICAgICAgIGlmIGxlbihqc29uX291dCkg - PT0gMToKICAgICAgICAgICAgICAgIG1hdGNoaW5nX2pzb25fb3V0ID0ganNvbl9vdXRbMF0KICAg - ICAgICAgICAgIyBiLiBvciBlbHNlLCBjaGVjayBpZiBkYXRhX3Bvb2wgbmFtZSBpcyBwcm92aWRl - ZAogICAgICAgICAgICBlbGlmIHNlbGYuX2FyZ19wYXJzZXIuY2VwaGZzX2RhdGFfcG9vbF9uYW1l - OgogICAgICAgICAgICAgICAgIyBhbmQgaWYgcHJlc2VudCwgY2hlY2sgd2hldGhlciB0aGVyZSBl - eGlzdHMgYSBmcyB3aGljaCBoYXMgdGhlIGRhdGFfcG9vbAogICAgICAgICAgICAgICAgZm9yIGVh - Y2hKIGluIGpzb25fb3V0OgogICAgICAgICAgICAgICAgICAgIGlmIHNlbGYuX2FyZ19wYXJzZXIu - Y2VwaGZzX2RhdGFfcG9vbF9uYW1lIGluIGVhY2hKWyJkYXRhX3Bvb2xzIl06CiAgICAgICAgICAg - ICAgICAgICAgICAgIG1hdGNoaW5nX2pzb25fb3V0ID0gZWFjaEoKICAgICAgICAgICAgICAgICAg - ICAgICAgYnJlYWsKICAgICAgICAgICAgICAgICMgaWYgdGhlcmUgaXMgbm8gbWF0Y2hpbmcgZnMg - ZXhpc3RzLCB0aGF0IG1lYW5zIHByb3ZpZGVkIGRhdGFfcG9vbCBuYW1lIGlzIGludmFsaWQKICAg - ICAgICAgICAgICAgIGlmIG5vdCBtYXRjaGluZ19qc29uX291dDoKICAgICAgICAgICAgICAgICAg - ICByYWlzZSBFeGVjdXRpb25GYWlsdXJlRXhjZXB0aW9uKAogICAgICAgICAgICAgICAgICAgICAg - ICBmIlByb3ZpZGVkIGRhdGFfcG9vbCBuYW1lLCB7c2VsZi5fYXJnX3BhcnNlci5jZXBoZnNfZGF0 - YV9wb29sX25hbWV9LCIKICAgICAgICAgICAgICAgICAgICAgICAgIiBkb2VzIG5vdCBleGlzdHMi - CiAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAjIGMuIGlmIG5vdGhpbmcgaXMgc2V0 - IGFuZCBjb3VsZG4ndCBmaW5kIGEgZGVmYXVsdCwKICAgICAgICAgICAgZWxzZToKICAgICAgICAg - ICAgICAgICMganVzdCByZXR1cm4gc2lsZW50bHkKICAgICAgICAgICAgICAgIHJldHVybgoKICAg - ICAgICBpZiBtYXRjaGluZ19qc29uX291dDoKICAgICAgICAgICAgc2VsZi5fYXJnX3BhcnNlci5j - ZXBoZnNfZmlsZXN5c3RlbV9uYW1lID0gc3RyKG1hdGNoaW5nX2pzb25fb3V0WyJuYW1lIl0pCiAg - ICAgICAgICAgIHNlbGYuX2FyZ19wYXJzZXIuY2VwaGZzX21ldGFkYXRhX3Bvb2xfbmFtZSA9IHN0 - cigKICAgICAgICAgICAgICAgIG1hdGNoaW5nX2pzb25fb3V0WyJtZXRhZGF0YV9wb29sIl0KICAg - ICAgICAgICAgKQoKICAgICAgICBpZiBpc2luc3RhbmNlKG1hdGNoaW5nX2pzb25fb3V0WyJkYXRh - X3Bvb2xzIl0sIGxpc3QpOgogICAgICAgICAgICAjIGlmIHRoZSB1c2VyIGhhcyBhbHJlYWR5IHBy - b3ZpZGVkIGRhdGEtcG9vbC1uYW1lLAogICAgICAgICAgICAjIHRocm91Z2ggLS1jZXBoZnMtZGF0 - YS1wb29sLW5hbWUKICAgICAgICAgICAgaWYgc2VsZi5fYXJnX3BhcnNlci5jZXBoZnNfZGF0YV9w - b29sX25hbWU6CiAgICAgICAgICAgICAgICAjIGlmIHRoZSBwcm92aWRlZCBuYW1lIGlzIG5vdCBt - YXRjaGluZyB3aXRoIHRoZSBvbmUgaW4gdGhlIGxpc3QKICAgICAgICAgICAgICAgIGlmICgKICAg - ICAgICAgICAgICAgICAgICBzZWxmLl9hcmdfcGFyc2VyLmNlcGhmc19kYXRhX3Bvb2xfbmFtZQog - ICAgICAgICAgICAgICAgICAgIG5vdCBpbiBtYXRjaGluZ19qc29uX291dFsiZGF0YV9wb29scyJd - CiAgICAgICAgICAgICAgICApOgogICAgICAgICAgICAgICAgICAgIHJhaXNlIEV4ZWN1dGlvbkZh - aWx1cmVFeGNlcHRpb24oCiAgICAgICAgICAgICAgICAgICAgICAgIGYiUHJvdmlkZWQgZGF0YS1w - b29sLW5hbWU6ICd7c2VsZi5fYXJnX3BhcnNlci5jZXBoZnNfZGF0YV9wb29sX25hbWV9JywgIgog - ICAgICAgICAgICAgICAgICAgICAgICAiZG9lc24ndCBtYXRjaCBmcm9tIHRoZSBkYXRhLXBvb2xz - IGxpc3Q6ICIKICAgICAgICAgICAgICAgICAgICAgICAgZiJ7W3N0cih4KSBmb3IgeCBpbiBtYXRj - aGluZ19qc29uX291dFsnZGF0YV9wb29scyddXX0iCiAgICAgICAgICAgICAgICAgICAgKQogICAg - ICAgICAgICAjIGlmIGRhdGFfcG9vbCBuYW1lIGlzIG5vdCBwcm92aWRlZCwKICAgICAgICAgICAg - IyB0aGVuIHRyeSB0byBmaW5kIGEgZGVmYXVsdCBkYXRhIHBvb2wgbmFtZQogICAgICAgICAgICBl - bHNlOgogICAgICAgICAgICAgICAgIyBpZiBubyBkYXRhX3Bvb2xzIGV4aXN0LCBzaWxlbnRseSBy - ZXR1cm4KICAgICAgICAgICAgICAgIGlmIGxlbihtYXRjaGluZ19qc29uX291dFsiZGF0YV9wb29s - cyJdKSA9PSAwOgogICAgICAgICAgICAgICAgICAgIHJldHVybgogICAgICAgICAgICAgICAgc2Vs - Zi5fYXJnX3BhcnNlci5jZXBoZnNfZGF0YV9wb29sX25hbWUgPSBzdHIoCiAgICAgICAgICAgICAg - ICAgICAgbWF0Y2hpbmdfanNvbl9vdXRbImRhdGFfcG9vbHMiXVswXQogICAgICAgICAgICAgICAg - KQogICAgICAgICAgICAjIGlmIHRoZXJlIGFyZSBtb3JlIHRoYW4gb25lICdkYXRhX3Bvb2xzJyBl - eGlzdCwKICAgICAgICAgICAgIyB0aGVuIHdhcm4gdGhlIHVzZXIgdGhhdCB3ZSBhcmUgdXNpbmcg - dGhlIHNlbGVjdGVkIG5hbWUKICAgICAgICAgICAgaWYgbGVuKG1hdGNoaW5nX2pzb25fb3V0WyJk - YXRhX3Bvb2xzIl0pID4gMToKICAgICAgICAgICAgICAgIHByaW50KAogICAgICAgICAgICAgICAg - ICAgICJXQVJOSU5HOiBNdWx0aXBsZSBkYXRhIHBvb2xzIGRldGVjdGVkOiAiCiAgICAgICAgICAg - ICAgICAgICAgZiJ7W3N0cih4KSBmb3IgeCBpbiBtYXRjaGluZ19qc29uX291dFsnZGF0YV9wb29s - cyddXX1cbiIKICAgICAgICAgICAgICAgICAgICBmIlVzaW5nIHRoZSBkYXRhLXBvb2w6ICd7c2Vs - Zi5fYXJnX3BhcnNlci5jZXBoZnNfZGF0YV9wb29sX25hbWV9J1xuIgogICAgICAgICAgICAgICAg - KQoKICAgIGRlZiBjcmVhdGVfY2hlY2tlcktleShzZWxmLCB1c2VyKToKICAgICAgICBjYXBzLCBl - bnRpdHkgPSBzZWxmLmdldF9jYXBzX2FuZF9lbnRpdHkodXNlcikKICAgICAgICBjbWRfanNvbiA9 - IHsKICAgICAgICAgICAgInByZWZpeCI6ICJhdXRoIGdldC1vci1jcmVhdGUiLAogICAgICAgICAg - ICAiZW50aXR5IjogZW50aXR5LAogICAgICAgICAgICAiY2FwcyI6IFtjYXAgZm9yIGNhcF9saXN0 - IGluIGxpc3QoY2Fwcy5pdGVtcygpKSBmb3IgY2FwIGluIGNhcF9saXN0XSwKICAgICAgICAgICAg - ImZvcm1hdCI6ICJqc29uIiwKICAgICAgICB9CgogICAgICAgIGlmIHNlbGYuX2FyZ19wYXJzZXIu - ZHJ5X3J1bjoKICAgICAgICAgICAgcmV0dXJuIHNlbGYuZHJ5X3J1bigKICAgICAgICAgICAgICAg - ICJjZXBoICIKICAgICAgICAgICAgICAgICsgY21kX2pzb25bInByZWZpeCJdCiAgICAgICAgICAg - ICAgICArICIgIgogICAgICAgICAgICAgICAgKyBjbWRfanNvblsiZW50aXR5Il0KICAgICAgICAg - ICAgICAgICsgIiAiCiAgICAgICAgICAgICAgICArICIgIi5qb2luKGNtZF9qc29uWyJjYXBzIl0p - CiAgICAgICAgICAgICkKICAgICAgICAjIGNoZWNrIGlmIHVzZXIgYWxyZWFkeSBleGlzdAogICAg - ICAgIHVzZXJfa2V5ID0gc2VsZi5jaGVja191c2VyX2V4aXN0KGVudGl0eSkKICAgICAgICBpZiB1 - c2VyX2tleSAhPSAiIjoKICAgICAgICAgICAgcmV0dXJuIHVzZXJfa2V5CgogICAgICAgIHJldF92 - YWwsIGpzb25fb3V0LCBlcnJfbXNnID0gc2VsZi5fY29tbW9uX2NtZF9qc29uX2dlbihjbWRfanNv - bikKICAgICAgICAjIGlmIHRoZXJlIGlzIGFuIHVuc3VjY2Vzc2Z1bCBhdHRlbXB0LAogICAgICAg - IGlmIHJldF92YWwgIT0gMCBvciBsZW4oanNvbl9vdXQpID09IDA6CiAgICAgICAgICAgIHJhaXNl - IEV4ZWN1dGlvbkZhaWx1cmVFeGNlcHRpb24oCiAgICAgICAgICAgICAgICBmIidhdXRoIGdldC1v - ci1jcmVhdGUge3NlbGYucnVuX2FzX3VzZXJ9JyBjb21tYW5kIGZhaWxlZFxuIgogICAgICAgICAg - ICAgICAgZiJFcnJvcjoge2Vycl9tc2cgaWYgcmV0X3ZhbCAhPSAwIGVsc2Ugc2VsZi5FTVBUWV9P - VVRQVVRfTElTVH0iCiAgICAgICAgICAgICkKICAgICAgICByZXR1cm4gc3RyKGpzb25fb3V0WzBd - WyJrZXkiXSkKCiAgICBkZWYgZ2V0X2NlcGhfZGFzaGJvYXJkX2xpbmsoc2VsZik6CiAgICAgICAg - Y21kX2pzb24gPSB7InByZWZpeCI6ICJtZ3Igc2VydmljZXMiLCAiZm9ybWF0IjogImpzb24ifQog - ICAgICAgIGlmIHNlbGYuX2FyZ19wYXJzZXIuZHJ5X3J1bjoKICAgICAgICAgICAgcmV0dXJuIHNl - bGYuZHJ5X3J1bigiY2VwaCAiICsgY21kX2pzb25bInByZWZpeCJdKQogICAgICAgIHJldF92YWws - IGpzb25fb3V0LCBfID0gc2VsZi5fY29tbW9uX2NtZF9qc29uX2dlbihjbWRfanNvbikKICAgICAg - ICAjIGlmIHRoZXJlIGlzIGFuIHVuc3VjY2Vzc2Z1bCBhdHRlbXB0LAogICAgICAgIGlmIHJldF92 - YWwgIT0gMCBvciBsZW4oanNvbl9vdXQpID09IDA6CiAgICAgICAgICAgIHJldHVybiBOb25lCiAg - ICAgICAgaWYgImRhc2hib2FyZCIgbm90IGluIGpzb25fb3V0OgogICAgICAgICAgICByZXR1cm4g - Tm9uZQogICAgICAgIHJldHVybiBqc29uX291dFsiZGFzaGJvYXJkIl0KCiAgICBkZWYgY3JlYXRl - X3Jnd19hZG1pbl9vcHNfdXNlcihzZWxmKToKICAgICAgICBjbWQgPSBbCiAgICAgICAgICAgICJy - YWRvc2d3LWFkbWluIiwKICAgICAgICAgICAgInVzZXIiLAogICAgICAgICAgICAiY3JlYXRlIiwK - ICAgICAgICAgICAgIi0tdWlkIiwKICAgICAgICAgICAgc2VsZi5FWFRFUk5BTF9SR1dfQURNSU5f - T1BTX1VTRVJfTkFNRSwKICAgICAgICAgICAgIi0tZGlzcGxheS1uYW1lIiwKICAgICAgICAgICAg - IlJvb2sgUkdXIEFkbWluIE9wcyB1c2VyIiwKICAgICAgICAgICAgIi0tY2FwcyIsCiAgICAgICAg - ICAgICJidWNrZXRzPSo7dXNlcnM9Kjt1c2FnZT1yZWFkO21ldGFkYXRhPXJlYWQ7em9uZT1yZWFk - IiwKICAgICAgICAgICAgIi0tcmd3LXJlYWxtIiwKICAgICAgICAgICAgc2VsZi5fYXJnX3BhcnNl - ci5yZ3dfcmVhbG1fbmFtZSwKICAgICAgICAgICAgIi0tcmd3LXpvbmVncm91cCIsCiAgICAgICAg - ICAgIHNlbGYuX2FyZ19wYXJzZXIucmd3X3pvbmVncm91cF9uYW1lLAogICAgICAgICAgICAiLS1y - Z3ctem9uZSIsCiAgICAgICAgICAgIHNlbGYuX2FyZ19wYXJzZXIucmd3X3pvbmVfbmFtZSwKICAg - ICAgICBdCiAgICAgICAgaWYgc2VsZi5fYXJnX3BhcnNlci5kcnlfcnVuOgogICAgICAgICAgICBy - ZXR1cm4gc2VsZi5kcnlfcnVuKCJjZXBoICIgKyAiICIuam9pbihjbWQpKQogICAgICAgIHRyeToK - ICAgICAgICAgICAgb3V0cHV0ID0gc3VicHJvY2Vzcy5jaGVja19vdXRwdXQoY21kLCBzdGRlcnI9 - c3VicHJvY2Vzcy5QSVBFKQogICAgICAgIGV4Y2VwdCBzdWJwcm9jZXNzLkNhbGxlZFByb2Nlc3NF - cnJvciBhcyBleGVjRXJyOgogICAgICAgICAgICAjIGlmIHRoZSB1c2VyIGFscmVhZHkgZXhpc3Rz - LCB3ZSBqdXN0IHF1ZXJ5IGl0CiAgICAgICAgICAgIGlmIGV4ZWNFcnIucmV0dXJuY29kZSA9PSBl - cnJuby5FRVhJU1Q6CiAgICAgICAgICAgICAgICBjbWQgPSBbCiAgICAgICAgICAgICAgICAgICAg - InJhZG9zZ3ctYWRtaW4iLAogICAgICAgICAgICAgICAgICAgICJ1c2VyIiwKICAgICAgICAgICAg - ICAgICAgICAiaW5mbyIsCiAgICAgICAgICAgICAgICAgICAgIi0tdWlkIiwKICAgICAgICAgICAg - ICAgICAgICBzZWxmLkVYVEVSTkFMX1JHV19BRE1JTl9PUFNfVVNFUl9OQU1FLAogICAgICAgICAg - ICAgICAgICAgICItLXJndy1yZWFsbSIsCiAgICAgICAgICAgICAgICAgICAgc2VsZi5fYXJnX3Bh - cnNlci5yZ3dfcmVhbG1fbmFtZSwKICAgICAgICAgICAgICAgICAgICAiLS1yZ3ctem9uZWdyb3Vw - IiwKICAgICAgICAgICAgICAgICAgICBzZWxmLl9hcmdfcGFyc2VyLnJnd196b25lZ3JvdXBfbmFt - ZSwKICAgICAgICAgICAgICAgICAgICAiLS1yZ3ctem9uZSIsCiAgICAgICAgICAgICAgICAgICAg - c2VsZi5fYXJnX3BhcnNlci5yZ3dfem9uZV9uYW1lLAogICAgICAgICAgICAgICAgXQogICAgICAg - ICAgICAgICAgdHJ5OgogICAgICAgICAgICAgICAgICAgIG91dHB1dCA9IHN1YnByb2Nlc3MuY2hl - Y2tfb3V0cHV0KGNtZCwgc3RkZXJyPXN1YnByb2Nlc3MuUElQRSkKICAgICAgICAgICAgICAgIGV4 - Y2VwdCBzdWJwcm9jZXNzLkNhbGxlZFByb2Nlc3NFcnJvciBhcyBleGVjRXJyOgogICAgICAgICAg - ICAgICAgICAgIGVycl9tc2cgPSAoCiAgICAgICAgICAgICAgICAgICAgICAgIGYiZmFpbGVkIHRv - IGV4ZWN1dGUgY29tbWFuZCB7Y21kfS4gT3V0cHV0OiB7ZXhlY0Vyci5vdXRwdXR9LiAiCiAgICAg - ICAgICAgICAgICAgICAgICAgIGYiQ29kZToge2V4ZWNFcnIucmV0dXJuY29kZX0uIEVycm9yOiB7 - ZXhlY0Vyci5zdGRlcnJ9IgogICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICAg - ICBzeXMuc3RkZXJyLndyaXRlKGVycl9tc2cpCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIE5v - bmUsIE5vbmUsIEZhbHNlLCAiLTEiCiAgICAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICAgICBl - cnJfbXNnID0gKAogICAgICAgICAgICAgICAgICAgIGYiZmFpbGVkIHRvIGV4ZWN1dGUgY29tbWFu - ZCB7Y21kfS4gT3V0cHV0OiB7ZXhlY0Vyci5vdXRwdXR9LiAiCiAgICAgICAgICAgICAgICAgICAg - ZiJDb2RlOiB7ZXhlY0Vyci5yZXR1cm5jb2RlfS4gRXJyb3I6IHtleGVjRXJyLnN0ZGVycn0iCiAg - ICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICBzeXMuc3RkZXJyLndyaXRlKGVycl9tc2cp - CiAgICAgICAgICAgICAgICByZXR1cm4gTm9uZSwgTm9uZSwgRmFsc2UsICItMSIKCiAgICAgICAg - IyBpZiBpdCBpcyBweXRob24yLCBkb24ndCBjaGVjayBmb3IgY2VwaCB2ZXJzaW9uIGZvciBhZGRp - bmcgYGluZm89cmVhZGAgY2FwKHJnd192YWxpZGF0aW9uKQogICAgICAgIGlmIHN5cy52ZXJzaW9u - X2luZm8ubWFqb3IgPCAzOgogICAgICAgICAgICBqc29ub3V0cHV0ID0ganNvbi5sb2FkcyhvdXRw - dXQpCiAgICAgICAgICAgIHJldHVybiAoCiAgICAgICAgICAgICAgICBqc29ub3V0cHV0WyJrZXlz - Il1bMF1bImFjY2Vzc19rZXkiXSwKICAgICAgICAgICAgICAgIGpzb25vdXRwdXRbImtleXMiXVsw - XVsic2VjcmV0X2tleSJdLAogICAgICAgICAgICAgICAgRmFsc2UsCiAgICAgICAgICAgICAgICAi - IiwKICAgICAgICAgICAgKQoKICAgICAgICAjIHNlcGFyYXRlbHkgYWRkIGluZm89cmVhZCBjYXBz - IGZvciByZ3ctZW5kcG9pbnQgaXAgdmFsaWRhdGlvbgogICAgICAgIGluZm9fY2FwX3N1cHBvcnRl - ZCA9IFRydWUKICAgICAgICBjbWQgPSBbCiAgICAgICAgICAgICJyYWRvc2d3LWFkbWluIiwKICAg - ICAgICAgICAgImNhcHMiLAogICAgICAgICAgICAiYWRkIiwKICAgICAgICAgICAgIi0tdWlkIiwK - ICAgICAgICAgICAgc2VsZi5FWFRFUk5BTF9SR1dfQURNSU5fT1BTX1VTRVJfTkFNRSwKICAgICAg - ICAgICAgIi0tY2FwcyIsCiAgICAgICAgICAgICJpbmZvPXJlYWQiLAogICAgICAgICAgICAiLS1y - Z3ctcmVhbG0iLAogICAgICAgICAgICBzZWxmLl9hcmdfcGFyc2VyLnJnd19yZWFsbV9uYW1lLAog - ICAgICAgICAgICAiLS1yZ3ctem9uZWdyb3VwIiwKICAgICAgICAgICAgc2VsZi5fYXJnX3BhcnNl - ci5yZ3dfem9uZWdyb3VwX25hbWUsCiAgICAgICAgICAgICItLXJndy16b25lIiwKICAgICAgICAg - ICAgc2VsZi5fYXJnX3BhcnNlci5yZ3dfem9uZV9uYW1lLAogICAgICAgIF0KICAgICAgICB0cnk6 - CiAgICAgICAgICAgIG91dHB1dCA9IHN1YnByb2Nlc3MuY2hlY2tfb3V0cHV0KGNtZCwgc3RkZXJy - PXN1YnByb2Nlc3MuUElQRSkKICAgICAgICBleGNlcHQgc3VicHJvY2Vzcy5DYWxsZWRQcm9jZXNz - RXJyb3IgYXMgZXhlY0VycjoKICAgICAgICAgICAgIyBpZiB0aGUgY2VwaCB2ZXJzaW9uIG5vdCBz - dXBwb3J0ZWQgZm9yIGFkZGluZyBgaW5mbz1yZWFkYCBjYXAocmd3X3ZhbGlkYXRpb24pCiAgICAg - ICAgICAgIGlmICgKICAgICAgICAgICAgICAgICJjb3VsZCBub3QgYWRkIGNhcHM6IHVuYWJsZSB0 - byBhZGQgY2FwczogaW5mbz1yZWFkXG4iCiAgICAgICAgICAgICAgICBpbiBleGVjRXJyLnN0ZGVy - ci5kZWNvZGUoInV0Zi04IikKICAgICAgICAgICAgICAgIGFuZCBleGVjRXJyLnJldHVybmNvZGUg - PT0gMjQ0CiAgICAgICAgICAgICk6CiAgICAgICAgICAgICAgICBpbmZvX2NhcF9zdXBwb3J0ZWQg - PSBGYWxzZQogICAgICAgICAgICBlbHNlOgogICAgICAgICAgICAgICAgZXJyX21zZyA9ICgKICAg - ICAgICAgICAgICAgICAgICBmImZhaWxlZCB0byBleGVjdXRlIGNvbW1hbmQge2NtZH0uIE91dHB1 - dDoge2V4ZWNFcnIub3V0cHV0fS4gIgogICAgICAgICAgICAgICAgICAgIGYiQ29kZToge2V4ZWNF - cnIucmV0dXJuY29kZX0uIEVycm9yOiB7ZXhlY0Vyci5zdGRlcnJ9IgogICAgICAgICAgICAgICAg - KQogICAgICAgICAgICAgICAgc3lzLnN0ZGVyci53cml0ZShlcnJfbXNnKQogICAgICAgICAgICAg - ICAgcmV0dXJuIE5vbmUsIE5vbmUsIEZhbHNlLCAiLTEiCgogICAgICAgIGpzb25vdXRwdXQgPSBq - c29uLmxvYWRzKG91dHB1dCkKICAgICAgICByZXR1cm4gKAogICAgICAgICAgICBqc29ub3V0cHV0 - WyJrZXlzIl1bMF1bImFjY2Vzc19rZXkiXSwKICAgICAgICAgICAganNvbm91dHB1dFsia2V5cyJd - WzBdWyJzZWNyZXRfa2V5Il0sCiAgICAgICAgICAgIGluZm9fY2FwX3N1cHBvcnRlZCwKICAgICAg - ICAgICAgIiIsCiAgICAgICAgKQoKICAgIGRlZiB2YWxpZGF0ZV9yYmRfcG9vbChzZWxmLCBwb29s - X25hbWUpOgogICAgICAgIGlmIG5vdCBzZWxmLmNsdXN0ZXIucG9vbF9leGlzdHMocG9vbF9uYW1l - KToKICAgICAgICAgICAgcmFpc2UgRXhlY3V0aW9uRmFpbHVyZUV4Y2VwdGlvbigKICAgICAgICAg - ICAgICAgIGYiVGhlIHByb3ZpZGVkIHBvb2wsICd7cG9vbF9uYW1lfScsIGRvZXMgbm90IGV4aXN0 - IgogICAgICAgICAgICApCgogICAgZGVmIGluaXRfcmJkX3Bvb2woc2VsZiwgcmJkX3Bvb2xfbmFt - ZSk6CiAgICAgICAgaWYgaXNpbnN0YW5jZShzZWxmLmNsdXN0ZXIsIER1bW15UmFkb3MpOgogICAg - ICAgICAgICByZXR1cm4KICAgICAgICBpb2N0eCA9IHNlbGYuY2x1c3Rlci5vcGVuX2lvY3R4KHJi - ZF9wb29sX25hbWUpCiAgICAgICAgcmJkX2luc3QgPSByYmQuUkJEKCkKICAgICAgICByYmRfaW5z - dC5wb29sX2luaXQoaW9jdHgsIFRydWUpCgogICAgZGVmIHZhbGlkYXRlX3JhZG9zX25hbWVzcGFj - ZShzZWxmKToKICAgICAgICByYmRfcG9vbF9uYW1lID0gc2VsZi5fYXJnX3BhcnNlci5yYmRfZGF0 - YV9wb29sX25hbWUKICAgICAgICBpZiBzZWxmLl9hcmdfcGFyc2VyLnJiZF9tZXRhZGF0YV9lY19w - b29sX25hbWU6CiAgICAgICAgICAgIHJiZF9wb29sX25hbWUgPSBzZWxmLl9hcmdfcGFyc2VyLnJi - ZF9tZXRhZGF0YV9lY19wb29sX25hbWUKICAgICAgICByYWRvc19uYW1lc3BhY2UgPSBzZWxmLl9h - cmdfcGFyc2VyLnJhZG9zX25hbWVzcGFjZQogICAgICAgIGlmIHJhZG9zX25hbWVzcGFjZSA9PSAi - IjoKICAgICAgICAgICAgcmV0dXJuCiAgICAgICAgaWYgcmFkb3NfbmFtZXNwYWNlLmlzbG93ZXIo - KSA9PSBGYWxzZToKICAgICAgICAgICAgcmFpc2UgRXhlY3V0aW9uRmFpbHVyZUV4Y2VwdGlvbigK - ICAgICAgICAgICAgICAgIGYiVGhlIHByb3ZpZGVkIHJhZG9zIE5hbWVzcGFjZSwgJ3tyYWRvc19u - YW1lc3BhY2V9JywgIgogICAgICAgICAgICAgICAgZiJjb250YWlucyB1cHBlciBjYXNlIgogICAg - ICAgICAgICApCiAgICAgICAgcmJkX2luc3QgPSByYmQuUkJEKCkKICAgICAgICBpb2N0eCA9IHNl - bGYuY2x1c3Rlci5vcGVuX2lvY3R4KHJiZF9wb29sX25hbWUpCiAgICAgICAgaWYgcmJkX2luc3Qu - bmFtZXNwYWNlX2V4aXN0cyhpb2N0eCwgcmFkb3NfbmFtZXNwYWNlKSBpcyBGYWxzZToKICAgICAg - ICAgICAgcmFpc2UgRXhlY3V0aW9uRmFpbHVyZUV4Y2VwdGlvbigKICAgICAgICAgICAgICAgIGYi - VGhlIHByb3ZpZGVkIHJhZG9zIE5hbWVzcGFjZSwgJ3tyYWRvc19uYW1lc3BhY2V9JywgIgogICAg - ICAgICAgICAgICAgZiJpcyBub3QgZm91bmQgaW4gdGhlIHBvb2wgJ3tyYmRfcG9vbF9uYW1lfSci - CiAgICAgICAgICAgICkKCiAgICBkZWYgZ2V0X29yX2NyZWF0ZV9zdWJ2b2x1bWVfZ3JvdXAoc2Vs - Ziwgc3Vidm9sdW1lX2dyb3VwLCBjZXBoZnNfZmlsZXN5c3RlbV9uYW1lKToKICAgICAgICBjbWQg - PSBbCiAgICAgICAgICAgICJjZXBoIiwKICAgICAgICAgICAgImZzIiwKICAgICAgICAgICAgInN1 - YnZvbHVtZWdyb3VwIiwKICAgICAgICAgICAgImdldHBhdGgiLAogICAgICAgICAgICBjZXBoZnNf - ZmlsZXN5c3RlbV9uYW1lLAogICAgICAgICAgICBzdWJ2b2x1bWVfZ3JvdXAsCiAgICAgICAgXQog - ICAgICAgIHRyeToKICAgICAgICAgICAgXyA9IHN1YnByb2Nlc3MuY2hlY2tfb3V0cHV0KGNtZCwg - c3RkZXJyPXN1YnByb2Nlc3MuUElQRSkKICAgICAgICBleGNlcHQgc3VicHJvY2Vzcy5DYWxsZWRQ - cm9jZXNzRXJyb3I6CiAgICAgICAgICAgIGNtZCA9IFsKICAgICAgICAgICAgICAgICJjZXBoIiwK - ICAgICAgICAgICAgICAgICJmcyIsCiAgICAgICAgICAgICAgICAic3Vidm9sdW1lZ3JvdXAiLAog - ICAgICAgICAgICAgICAgImNyZWF0ZSIsCiAgICAgICAgICAgICAgICBjZXBoZnNfZmlsZXN5c3Rl - bV9uYW1lLAogICAgICAgICAgICAgICAgc3Vidm9sdW1lX2dyb3VwLAogICAgICAgICAgICBdCiAg - ICAgICAgICAgIHRyeToKICAgICAgICAgICAgICAgIF8gPSBzdWJwcm9jZXNzLmNoZWNrX291dHB1 - dChjbWQsIHN0ZGVycj1zdWJwcm9jZXNzLlBJUEUpCiAgICAgICAgICAgIGV4Y2VwdCBzdWJwcm9j - ZXNzLkNhbGxlZFByb2Nlc3NFcnJvcjoKICAgICAgICAgICAgICAgIHJhaXNlIEV4ZWN1dGlvbkZh - aWx1cmVFeGNlcHRpb24oCiAgICAgICAgICAgICAgICAgICAgZiJzdWJ2b2x1bWUgZ3JvdXAge3N1 - YnZvbHVtZV9ncm91cH0gaXMgbm90IGFibGUgdG8gZ2V0IGNyZWF0ZWQiCiAgICAgICAgICAgICAg - ICApCgogICAgZGVmIHBpbl9zdWJ2b2x1bWUoCiAgICAgICAgc2VsZiwgc3Vidm9sdW1lX2dyb3Vw - LCBjZXBoZnNfZmlsZXN5c3RlbV9uYW1lLCBwaW5fdHlwZSwgcGluX3NldHRpbmcKICAgICk6CiAg - ICAgICAgY21kID0gWwogICAgICAgICAgICAiY2VwaCIsCiAgICAgICAgICAgICJmcyIsCiAgICAg - ICAgICAgICJzdWJ2b2x1bWVncm91cCIsCiAgICAgICAgICAgICJwaW4iLAogICAgICAgICAgICBj - ZXBoZnNfZmlsZXN5c3RlbV9uYW1lLAogICAgICAgICAgICBzdWJ2b2x1bWVfZ3JvdXAsCiAgICAg - ICAgICAgIHBpbl90eXBlLAogICAgICAgICAgICBwaW5fc2V0dGluZywKICAgICAgICBdCiAgICAg - ICAgdHJ5OgogICAgICAgICAgICBfID0gc3VicHJvY2Vzcy5jaGVja19vdXRwdXQoY21kLCBzdGRl - cnI9c3VicHJvY2Vzcy5QSVBFKQogICAgICAgIGV4Y2VwdCBzdWJwcm9jZXNzLkNhbGxlZFByb2Nl - c3NFcnJvcjoKICAgICAgICAgICAgcmFpc2UgRXhlY3V0aW9uRmFpbHVyZUV4Y2VwdGlvbigKICAg - ICAgICAgICAgICAgIGYic3Vidm9sdW1lIGdyb3VwIHtzdWJ2b2x1bWVfZ3JvdXB9IGlzIG5vdCBh - YmxlIHRvIGdldCBwaW5uZWQiCiAgICAgICAgICAgICkKCiAgICBkZWYgZ2V0X3Jnd19mc2lkKHNl - bGYsIGJhc2VfdXJsLCB2ZXJpZnkpOgogICAgICAgIGFjY2Vzc19rZXkgPSBzZWxmLm91dF9tYXBb - IlJHV19BRE1JTl9PUFNfVVNFUl9BQ0NFU1NfS0VZIl0KICAgICAgICBzZWNyZXRfa2V5ID0gc2Vs - Zi5vdXRfbWFwWyJSR1dfQURNSU5fT1BTX1VTRVJfU0VDUkVUX0tFWSJdCiAgICAgICAgcmd3X2Vu - ZHBvaW50ID0gc2VsZi5fYXJnX3BhcnNlci5yZ3dfZW5kcG9pbnQKICAgICAgICBiYXNlX3VybCA9 - IGJhc2VfdXJsICsgIjovLyIgKyByZ3dfZW5kcG9pbnQgKyAiL2FkbWluL2luZm8/IgogICAgICAg - IHBhcmFtcyA9IHsiZm9ybWF0IjogImpzb24ifQogICAgICAgIHJlcXVlc3RfdXJsID0gYmFzZV91 - cmwgKyB1cmxlbmNvZGUocGFyYW1zKQoKICAgICAgICB0cnk6CiAgICAgICAgICAgIHIgPSByZXF1 - ZXN0cy5nZXQoCiAgICAgICAgICAgICAgICByZXF1ZXN0X3VybCwKICAgICAgICAgICAgICAgIGF1 - dGg9UzNBdXRoKGFjY2Vzc19rZXksIHNlY3JldF9rZXksIHJnd19lbmRwb2ludCksCiAgICAgICAg - ICAgICAgICB2ZXJpZnk9dmVyaWZ5LAogICAgICAgICAgICApCiAgICAgICAgZXhjZXB0IHJlcXVl - c3RzLmV4Y2VwdGlvbnMuVGltZW91dDoKICAgICAgICAgICAgc3lzLnN0ZGVyci53cml0ZSgKICAg - ICAgICAgICAgICAgIGYiaW52YWxpZCBlbmRwb2ludDosIG5vdCBhYmxlIHRvIGNhbGwgYWRtaW4t - b3BzIGFwaXtyZ3dfZW5kcG9pbnR9IgogICAgICAgICAgICApCiAgICAgICAgICAgIHJldHVybiAi - IiwgIi0xIgogICAgICAgIHIxID0gci5qc29uKCkKICAgICAgICBpZiByMSBpcyBOb25lIG9yIHIx - LmdldCgiaW5mbyIpIGlzIE5vbmU6CiAgICAgICAgICAgIHN5cy5zdGRlcnIud3JpdGUoCiAgICAg - ICAgICAgICAgICBmIlRoZSBwcm92aWRlZCByZ3cgRW5kcG9pbnQsICd7c2VsZi5fYXJnX3BhcnNl - ci5yZ3dfZW5kcG9pbnR9JywgaXMgaW52YWxpZC4iCiAgICAgICAgICAgICkKICAgICAgICAgICAg - cmV0dXJuICgKICAgICAgICAgICAgICAgICIiLAogICAgICAgICAgICAgICAgIi0xIiwKICAgICAg - ICAgICAgKQoKICAgICAgICByZXR1cm4gcjFbImluZm8iXVsic3RvcmFnZV9iYWNrZW5kcyJdWzBd - WyJjbHVzdGVyX2lkIl0sICIiCgogICAgZGVmIHZhbGlkYXRlX3Jnd19lbmRwb2ludChzZWxmLCBp - bmZvX2NhcF9zdXBwb3J0ZWQpOgogICAgICAgICMgaWYgdGhlICdjbHVzdGVyJyBpbnN0YW5jZSBp - cyBhIGR1bW15IG9uZSwKICAgICAgICAjIGRvbid0IHRyeSB0byByZWFjaCBvdXQgdG8gdGhlIGVu - ZHBvaW50CiAgICAgICAgaWYgaXNpbnN0YW5jZShzZWxmLmNsdXN0ZXIsIER1bW15UmFkb3MpOgog - ICAgICAgICAgICByZXR1cm4KCiAgICAgICAgcmd3X2VuZHBvaW50ID0gc2VsZi5fYXJnX3BhcnNl - ci5yZ3dfZW5kcG9pbnQKCiAgICAgICAgIyB2YWxpZGF0ZSByZ3cgZW5kcG9pbnQgb25seSBpZiBp - cCBhZGRyZXNzIGlzIHBhc3NlZAogICAgICAgIGlwX3R5cGUgPSBzZWxmLl9pbnZhbGlkX2VuZHBv - aW50KHJnd19lbmRwb2ludCkKCiAgICAgICAgIyBjaGVjayBpZiB0aGUgcmd3IGVuZHBvaW50IGlz - IHJlYWNoYWJsZQogICAgICAgIGNlcnQgPSBOb25lCiAgICAgICAgaWYgbm90IHNlbGYuX2FyZ19w - YXJzZXIucmd3X3NraXBfdGxzIGFuZCBzZWxmLnZhbGlkYXRlX3Jnd19lbmRwb2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ICd7 - ZnNpZH0nIgogICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgcmV0dXJuICItMSIKCiAg - ICAgICAgIyBjaGVjayBpZiB0aGUgcmd3IGVuZHBvaW50IHBvb2wgZXhpc3QKICAgICAgICAjIG9u - bHkgdmFsaWRhdGUgaWYgcmd3X3Bvb2xfcHJlZml4IGlzIHBhc3NlZCBlbHNlIGl0IHdpbGwgdGFr - ZSBkZWZhdWx0IHZhbHVlIGFuZCB3ZSBkb24ndCBjcmVhdGUgdGhlc2UgZGVmYXVsdCBwb29scwog - ICAgICAgIGlmIHNlbGYuX2FyZ19wYXJzZXIucmd3X3Bvb2xfcHJlZml4ICE9ICJkZWZhdWx0IjoK - ICAgICAgICAgICAgcmd3X3Bvb2xzX3RvX3ZhbGlkYXRlID0gWwogICAgICAgICAgICAgICAgZiJ7 - c2VsZi5fYXJnX3BhcnNlci5yZ3dfcG9vbF9wcmVmaXh9LnJndy5tZXRhIiwKICAgICAgICAgICAg - ICAgICIucmd3LnJvb3QiLAogICAgICAgICAgICAgICAgZiJ7c2VsZi5fYXJnX3BhcnNlci5yZ3df - cG9vbF9wcmVmaXh9LnJndy5jb250cm9sIiwKICAgICAgICAgICAgICAgIGYie3NlbGYuX2FyZ19w - YXJzZXIucmd3X3Bvb2xfcHJlZml4fS5yZ3cubG9nIiwKICAgICAgICAgICAgXQogICAgICAgICAg - ICBmb3IgX3Jnd19wb29sX3RvX3ZhbGlkYXRlIGluIHJnd19wb29sc190b192YWxpZGF0ZToKICAg - ICAgICAgICAgICAgIGlmIG5vdCBzZWxmLmNsdXN0ZXIucG9vbF9leGlzdHMoX3Jnd19wb29sX3Rv - X3ZhbGlkYXRlKToKICAgICAgICAgICAgICAgICAgICBzeXMuc3RkZXJyLndyaXRlKAogICAgICAg - ICAgICAgICAgICAgICAgICBmIlRoZSBwcm92aWRlZCBwb29sLCAne19yZ3dfcG9vbF90b192YWxp - ZGF0ZX0nLCBkb2VzIG5vdCBleGlzdCIKICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAg - ICAgICAgICAgcmV0dXJuICItMSIKCiAgICAgICAgcmV0dXJuICIiCgogICAgZGVmIHZhbGlkYXRl - X3Jnd19tdWx0aXNpdGUoc2VsZiwgcmd3X211bHRpc2l0ZV9jb25maWdfbmFtZSwgcmd3X211bHRp - c2l0ZV9jb25maWcpOgogICAgICAgIGlmIHJnd19tdWx0aXNpdGVfY29uZmlnICE9ICIiOgogICAg - ICAgICAgICBjbWQgPSBbCiAgICAgICAgICAgICAgICAicmFkb3Nndy1hZG1pbiIsCiAgICAgICAg - ICAgICAgICByZ3dfbXVsdGlzaXRlX2NvbmZpZywKICAgICAgICAgICAgICAgICJnZXQiLAogICAg - ICAgICAgICAgICAgIi0tcmd3LSIgKyByZ3dfbXVsdGlzaXRlX2NvbmZpZywKICAgICAgICAgICAg - ICAgIHJnd19tdWx0aXNpdGVfY29uZmlnX25hbWUsCiAgICAgICAgICAgIF0KICAgICAgICAgICAg - dHJ5OgogICAgICAgICAgICAgICAgXyA9IHN1YnByb2Nlc3MuY2hlY2tfb3V0cHV0KGNtZCwgc3Rk - ZXJyPXN1YnByb2Nlc3MuUElQRSkKICAgICAgICAgICAgZXhjZXB0IHN1YnByb2Nlc3MuQ2FsbGVk - UHJvY2Vzc0Vycm9yIGFzIGV4ZWNFcnI6CiAgICAgICAgICAgICAgICBlcnJfbXNnID0gKAogICAg - ICAgICAgICAgICAgICAgIGYiZmFpbGVkIHRvIGV4ZWN1dGUgY29tbWFuZCB7Y21kfS4gT3V0cHV0 - OiB7ZXhlY0Vyci5vdXRwdXR9LiAiCiAgICAgICAgICAgICAgICAgICAgZiJDb2RlOiB7ZXhlY0Vy - ci5yZXR1cm5jb2RlfS4gRXJyb3I6IHtleGVjRXJyLnN0ZGVycn0iCiAgICAgICAgICAgICAgICAp - CiAgICAgICAgICAgICAgICBzeXMuc3RkZXJyLndyaXRlKGVycl9tc2cpCiAgICAgICAgICAgICAg - ICByZXR1cm4gIi0xIgogICAgICAgIHJldHVybiAiIgoKICAgIGRlZiBjb252ZXJ0X2NvbW1hX3Nl - cGFyYXRlZF90b19hcnJheShzZWxmLCB2YWx1ZSk6CiAgICAgICAgcmV0dXJuIHZhbHVlLnNwbGl0 - KCIsIikKCiAgICBkZWYgcmFpc2VfZXhjZXB0aW9uX2lmX2FueV90b3BvbG9neV9mbGFnX2lzX21p - c3Npbmcoc2VsZik6CiAgICAgICAgaWYgKAogICAgICAgICAgICAoCiAgICAgICAgICAgICAgICBz - ZWxmLl9hcmdfcGFyc2VyLnRvcG9sb2d5X3Bvb2xzICE9ICIiCiAgICAgICAgICAgICAgICBhbmQg - KAogICAgICAgICAgICAgICAgICAgIHNlbGYuX2FyZ19wYXJzZXIudG9wb2xvZ3lfZmFpbHVyZV9k - b21haW5fbGFiZWwgPT0gIiIKICAgICAgICAgICAgICAgICAgICBvciBzZWxmLl9hcmdfcGFyc2Vy - LnRvcG9sb2d5X2ZhaWx1cmVfZG9tYWluX3ZhbHVlcyA9PSAiIgogICAgICAgICAgICAgICAgKQog - ICAgICAgICAgICApCiAgICAgICAgICAgIG9yICgKICAgICAgICAgICAgICAgIHNlbGYuX2FyZ19w - YXJzZXIudG9wb2xvZ3lfZmFpbHVyZV9kb21haW5fbGFiZWwgIT0gIiIKICAgICAgICAgICAgICAg - IGFuZCAoCiAgICAgICAgICAgICAgICAgICAgc2VsZi5fYXJnX3BhcnNlci50b3BvbG9neV9wb29s - cyA9PSAiIgogICAgICAgICAgICAgICAgICAgIG9yIHNlbGYuX2FyZ19wYXJzZXIudG9wb2xvZ3lf - ZmFpbHVyZV9kb21haW5fdmFsdWVzID09ICIiCiAgICAgICAgICAgICAgICApCiAgICAgICAgICAg - ICkKICAgICAgICAgICAgb3IgKAogICAgICAgICAgICAgICAgc2VsZi5fYXJnX3BhcnNlci50b3Bv - bG9neV9mYWlsdXJlX2RvbWFpbl92YWx1ZXMgIT0gIiIKICAgICAgICAgICAgICAgIGFuZCAoCiAg - ICAgICAgICAgICAgICAgICAgc2VsZi5fYXJnX3BhcnNlci50b3BvbG9neV9wb29scyA9PSAiIgog - ICAgICAgICAgICAgICAgICAgIG9yIHNlbGYuX2FyZ19wYXJzZXIudG9wb2xvZ3lfZmFpbHVyZV9k - b21haW5fbGFiZWwgPT0gIiIKICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgKQogICAgICAg - ICk6CiAgICAgICAgICAgIHJhaXNlIEV4ZWN1dGlvbkZhaWx1cmVFeGNlcHRpb24oCiAgICAgICAg - ICAgICAgICAicHJvdmlkZSBhbGwgdGhlIHRvcG9sb2d5IGZsYWdzIC0tdG9wb2xvZ3ktcG9vbHMs - IC0tdG9wb2xvZ3ktZmFpbHVyZS1kb21haW4tbGFiZWwsIC0tdG9wb2xvZ3ktZmFpbHVyZS1kb21h - aW4tdmFsdWVzIgogICAgICAgICAgICApCgogICAgZGVmIHZhbGlkYXRlX3RvcG9sb2d5X3ZhbHVl - cyhzZWxmLCB0b3BvbG9neV9wb29scywgdG9wb2xvZ3lfZmQpOgogICAgICAgIGlmIGxlbih0b3Bv - bG9neV9wb29scykgIT0gbGVuKHRvcG9sb2d5X2ZkKToKICAgICAgICAgICAgcmFpc2UgRXhlY3V0 - aW9uRmFpbHVyZUV4Y2VwdGlvbigKICAgICAgICAgICAgICAgIGYiVGhlIHByb3ZpZGVkIHRvcG9s - b2d5IHBvb2xzLCAne3RvcG9sb2d5X3Bvb2xzfScsIGFuZCAiCiAgICAgICAgICAgICAgICBmInRv - cG9sb2d5IGZhaWx1cmUgZG9tYWluLCAne3RvcG9sb2d5X2ZkfScsIgogICAgICAgICAgICAgICAg - ZiJhcmUgb2YgZGlmZmVyZW50IGxlbmd0aCwgJ3tsZW4odG9wb2xvZ3lfcG9vbHMpfScgYW5kICd7 - bGVuKHRvcG9sb2d5X2ZkKX0nIHJlc3BjdGl2ZWx5IgogICAgICAgICAgICApCiAgICAgICAgcmV0 - dXJuCgogICAgZGVmIHZhbGlkYXRlX3RvcG9sb2d5X3JiZF9wb29scyhzZWxmLCB0b3BvbG9neV9y - YmRfcG9vbHMpOgogICAgICAgIGZvciBwb29sIGluIHRvcG9sb2d5X3JiZF9wb29sczoKICAgICAg - ICAgICAgc2VsZi52YWxpZGF0ZV9yYmRfcG9vbChwb29sKQoKICAgIGRlZiBpbml0X3RvcG9sb2d5 - X3JiZF9wb29scyhzZWxmLCB0b3BvbG9neV9yYmRfcG9vbHMpOgogICAgICAgIGZvciBwb29sIGlu - IHRvcG9sb2d5X3JiZF9wb29sczoKICAgICAgICAgICAgc2VsZi5pbml0X3JiZF9wb29sKHBvb2wp - CgogICAgZGVmIF9nZW5fb3V0cHV0X21hcChzZWxmKToKICAgICAgICBpZiBzZWxmLm91dF9tYXA6 - CiAgICAgICAgICAgIHJldHVybgogICAgICAgICMgc3VwcG9ydCBsZWdhY3kgZmxhZyB3aXRoIHVw - Z3JhZGVzCiAgICAgICAgaWYgc2VsZi5fYXJnX3BhcnNlci5jbHVzdGVyX25hbWU6CiAgICAgICAg - ICAgIHNlbGYuX2FyZ19wYXJzZXIuazhzX2NsdXN0ZXJfbmFtZSA9IHNlbGYuX2FyZ19wYXJzZXIu - Y2x1c3Rlcl9uYW1lCiAgICAgICAgc2VsZi5fYXJnX3BhcnNlci5rOHNfY2x1c3Rlcl9uYW1lID0g - KAogICAgICAgICAgICBzZWxmLl9hcmdfcGFyc2VyLms4c19jbHVzdGVyX25hbWUubG93ZXIoKQog - ICAgICAgICkgICMgYWx3YXlzIGNvbnZlcnQgY2x1c3RlciBuYW1lIHRvIGxvd2VyY2FzZSBjaGFy - YWN0ZXJzCiAgICAgICAgc2VsZi52YWxpZGF0ZV9yYmRfcG9vbChzZWxmLl9hcmdfcGFyc2VyLnJi - ZF9kYXRhX3Bvb2xfbmFtZSkKICAgICAgICBzZWxmLmluaXRfcmJkX3Bvb2woc2VsZi5fYXJnX3Bh - cnNlci5yYmRfZGF0YV9wb29sX25hbWUpCiAgICAgICAgc2VsZi52YWxpZGF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ICAgICAgICAgICAgICAiY3NpIiwgc2VsZi5fYXJnX3BhcnNlci5jZXBoZnNfZmlsZXN5 - c3RlbV9uYW1lCiAgICAgICAgICAgICkKICAgICAgICAgICAgIyBwaW4gdGhlIGRlZmF1bHQgImNz - aSIgc3Vidm9sdW1lZ3JvdXAKICAgICAgICAgICAgc2VsZi5waW5fc3Vidm9sdW1lKAogICAgICAg - ICAgICAgICAgImNzaSIsIHNlbGYuX2FyZ19wYXJzZXIuY2VwaGZzX2ZpbGVzeXN0ZW1fbmFtZSwg - ImRpc3RyaWJ1dGVkIiwgIjEiCiAgICAgICAgICAgICkKICAgICAgICAgICAgaWYgc2VsZi5vdXRf - bWFwWyJTVUJWT0xVTUVfR1JPVVAiXToKICAgICAgICAgICAgICAgIHNlbGYuZ2V0X29yX2NyZWF0 - ZV9zdWJ2b2x1bWVfZ3JvdXAoCiAgICAgICAgICAgICAgICAgICAgc2VsZi5fYXJnX3BhcnNlci5z - dWJ2b2x1bWVfZ3JvdXAsCiAgICAgICAgICAgICAgICAgICAgc2VsZi5fYXJnX3BhcnNlci5jZXBo - ZnNfZmlsZXN5c3RlbV9uYW1lLAogICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgc2Vs - Zi5waW5fc3Vidm9sdW1lKAogICAgICAgICAgICAgICAgICAgIHNlbGYuX2FyZ19wYXJzZXIuc3Vi - dm9sdW1lX2dyb3VwLAogICAgICAgICAgICAgICAgICAgIHNlbGYuX2FyZ19wYXJzZXIuY2VwaGZz - X2ZpbGVzeXN0ZW1fbmFtZSwKICAgICAgICAgICAgICAgICAgICAiZGlzdHJpYnV0ZWQiLAogICAg - ICAgICAgICAgICAgICAgICIxIiwKICAgICAgICAgICAgICAgICkKICAgICAgICBzZWxmLm91dF9t - YXBbIlJHV19UTFNfQ0VSVCJdID0gIiIKICAgICAgICBzZWxmLm91dF9tYXBbIk1PTklUT1JJTkdf - RU5EUE9JTlQiXSA9ICIiCiAgICAgICAgc2VsZi5vdXRfbWFwWyJNT05JVE9SSU5HX0VORFBPSU5U - X1BPUlQiXSA9ICIiCiAgICAgICAgaWYgbm90IHNlbGYuX2FyZ19wYXJzZXIuc2tpcF9tb25pdG9y - aW5nX2VuZHBvaW50OgogICAgICAgICAgICAoCiAgICAgICAgICAgICAgICBzZWxmLm91dF9tYXBb - Ik1PTklUT1JJTkdfRU5EUE9JTlQiXSwKICAgICAgICAgICAgICAgIHNlbGYub3V0X21hcFsiTU9O - SVRPUklOR19FTkRQT0lOVF9QT1JUIl0sCiAgICAgICAgICAgICkgPSBzZWxmLmdldF9hY3RpdmVf - YW5kX3N0YW5kYnlfbWdycygpCiAgICAgICAgc2VsZi5vdXRfbWFwWyJSQkRfUE9PTF9OQU1FIl0g - PSBzZWxmLl9hcmdfcGFyc2VyLnJiZF9kYXRhX3Bvb2xfbmFtZQogICAgICAgIHNlbGYub3V0X21h - cFsiUkJEX01FVEFEQVRBX0VDX1BPT0xfTkFNRSJdID0gKAogICAgICAgICAgICBzZWxmLnZhbGlk - YXRlX3JiZF9tZXRhZGF0YV9lY19wb29sX25hbWUoKQogICAgICAgICkKICAgICAgICBzZWxmLm91 - dF9tYXBbIlRPUE9MT0dZX1BPT0xTIl0gPSBzZWxmLl9hcmdfcGFyc2VyLnRvcG9sb2d5X3Bvb2xz - CiAgICAgICAgc2VsZi5vdXRfbWFwWyJUT1BPTE9HWV9GQUlMVVJFX0RPTUFJTl9MQUJFTCJdID0g - KAogICAgICAgICAgICBzZWxmLl9hcmdfcGFyc2VyLnRvcG9sb2d5X2ZhaWx1cmVfZG9tYWluX2xh - YmVsCiAgICAgICAgKQogICAgICAgIHNlbGYub3V0X21hcFsiVE9QT0xPR1lfRkFJTFVSRV9ET01B - SU5fVkFMVUVTIl0gPSAoCiAgICAgICAgICAgIHNlbGYuX2FyZ19wYXJzZXIudG9wb2xvZ3lfZmFp - bHVyZV9kb21haW5fdmFsdWVzCiAgICAgICAgKQogICAgICAgIGlmICgKICAgICAgICAgICAgc2Vs - Zi5fYXJnX3BhcnNlci50b3BvbG9neV9wb29scyAhPSAiIgogICAgICAgICAgICBhbmQgc2VsZi5f - YXJnX3BhcnNlci50b3BvbG9neV9mYWlsdXJlX2RvbWFpbl9sYWJlbCAhPSAiIgogICAgICAgICAg - ICBhbmQgc2VsZi5fYXJnX3BhcnNlci50b3BvbG9neV9mYWlsdXJlX2RvbWFpbl92YWx1ZXMgIT0g - IiIKICAgICAgICApOgogICAgICAgICAgICBzZWxmLnZhbGlkYXRlX3RvcG9sb2d5X3ZhbHVlcygK - ICAgICAgICAgICAgICAgIHNlbGYuY29udmVydF9jb21tYV9zZXBhcmF0ZWRfdG9fYXJyYXkoc2Vs - Zi5vdXRfbWFwWyJUT1BPTE9HWV9QT09MUyJdKSwKICAgICAgICAgICAgICAgIHNlbGYuY29udmVy - dF9jb21tYV9zZXBhcmF0ZWRfdG9fYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgc2VsZi5vdXRf - bWFwWyJUT1BPTE9HWV9GQUlMVVJFX0RPTUFJTl9WQUxVRVMiXQogICAgICAgICAgICAgICAgKSwK - ICAgICAgICAgICAgKQogICAgICAgICAgICBzZWxmLnZhbGlkYXRlX3RvcG9sb2d5X3JiZF9wb29s - cygKICAgICAgICAgICAgICAgIHNlbGYuY29udmVydF9jb21tYV9zZXBhcmF0ZWRfdG9fYXJyYXko - c2VsZi5vdXRfbWFwWyJUT1BPTE9HWV9QT09MUyJdKQogICAgICAgICAgICApCiAgICAgICAgICAg - IHNlbGYuaW5pdF90b3BvbG9neV9yYmRfcG9vbHMoCiAgICAgICAgICAgICAgICBzZWxmLmNvbnZl - cnRfY29tbWFfc2VwYXJhdGVkX3RvX2FycmF5KHNlbGYub3V0X21hcFsiVE9QT0xPR1lfUE9PTFMi - XSkKICAgICAgICAgICAgKQogICAgICAgIGVsc2U6CiAgICAgICAgICAgIHNlbGYucmFpc2VfZXhj - ZXB0aW9uX2lmX2FueV90b3BvbG9neV9mbGFnX2lzX21pc3NpbmcoKQoKICAgICAgICBzZWxmLm91 - dF9tYXBbIlJHV19QT09MX1BSRUZJWCJdID0gc2VsZi5fYXJnX3BhcnNlci5yZ3dfcG9vbF9wcmVm - aXgKICAgICAgICBzZWxmLm91dF9tYXBbIlJHV19FTkRQT0lOVCJdID0gIiIKICAgICAgICBpZiBz - ZWxmLl9hcmdfcGFyc2VyLnJnd19lbmRwb2ludDoKICAgICAgICAgICAgaWYgc2VsZi5fYXJnX3Bh - cnNlci5kcnlfcnVuOgogICAgICAgICAgICAgICAgc2VsZi5jcmVhdGVfcmd3X2FkbWluX29wc191 - c2VyKCkKICAgICAgICAgICAgZWxzZToKICAgICAgICAgICAgICAgIGlmICgKICAgICAgICAgICAg - ICAgICAgICBzZWxmLl9hcmdfcGFyc2VyLnJnd19yZWFsbV9uYW1lICE9ICIiCiAgICAgICAgICAg - ICAgICAgICAgYW5kIHNlbGYuX2FyZ19wYXJzZXIucmd3X3pvbmVncm91cF9uYW1lICE9ICIiCiAg - ICAgICAgICAgICAgICAgICAgYW5kIHNlbGYuX2FyZ19wYXJzZXIucmd3X3pvbmVfbmFtZSAhPSAi - IgogICAgICAgICAgICAgICAgKToKICAgICAgICAgICAgICAgICAgICBlcnIgPSBzZWxmLnZhbGlk - YXRlX3Jnd19tdWx0aXNpdGUoCiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuX2FyZ19wYXJz - ZXIucmd3X3JlYWxtX25hbWUsICJyZWFsbSIKICAgICAgICAgICAgICAgICAgICApCiAgICAgICAg - ICAgICAgICAgICAgZXJyID0gc2VsZi52YWxpZGF0ZV9yZ3dfbXVsdGlzaXRlKAogICAgICAgICAg - ICAgICAgICAgICAgICBzZWxmLl9hcmdfcGFyc2VyLnJnd196b25lZ3JvdXBfbmFtZSwgInpvbmVn - cm91cCIKICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICAgICAgZXJyID0gc2Vs - Zi52YWxpZGF0ZV9yZ3dfbXVsdGlzaXRlKAogICAgICAgICAgICAgICAgICAgICAgICBzZWxmLl9h - cmdfcGFyc2VyLnJnd196b25lX25hbWUsICJ6b25lIgogICAgICAgICAgICAgICAgICAgICkKCiAg - ICAgICAgICAgICAgICBpZiAoCiAgICAgICAgICAgICAgICAgICAgc2VsZi5fYXJnX3BhcnNlci5y - Z3dfcmVhbG1fbmFtZSA9PSAiIgogICAgICAgICAgICAgICAgICAgIGFuZCBzZWxmLl9hcmdfcGFy - c2VyLnJnd196b25lZ3JvdXBfbmFtZSA9PSAiIgogICAgICAgICAgICAgICAgICAgIGFuZCBzZWxm - Ll9hcmdfcGFyc2VyLnJnd196b25lX25hbWUgPT0gIiIKICAgICAgICAgICAgICAgICkgb3IgKAog - ICAgICAgICAgICAgICAgICAgIHNlbGYuX2FyZ19wYXJzZXIucmd3X3JlYWxtX25hbWUgIT0gIiIK - ICAgICAgICAgICAgICAgICAgICBhbmQgc2VsZi5fYXJnX3BhcnNlci5yZ3dfem9uZWdyb3VwX25h - bWUgIT0gIiIKICAgICAgICAgICAgICAgICAgICBhbmQgc2VsZi5fYXJnX3BhcnNlci5yZ3dfem9u - ZV9uYW1lICE9ICIiCiAgICAgICAgICAgICAgICApOgogICAgICAgICAgICAgICAgICAgICgKICAg - ICAgICAgICAgICAgICAgICAgICAgc2VsZi5vdXRfbWFwWyJSR1dfQURNSU5fT1BTX1VTRVJfQUND - RVNTX0tFWSJdLAogICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm91dF9tYXBbIlJHV19BRE1J - Tl9PUFNfVVNFUl9TRUNSRVRfS0VZIl0sCiAgICAgICAgICAgICAgICAgICAgICAgIGluZm9fY2Fw - X3N1cHBvcnRlZCwKICAgICAgICAgICAgICAgICAgICAgICAgZXJyLAogICAgICAgICAgICAgICAg - ICAgICkgPSBzZWxmLmNyZWF0ZV9yZ3dfYWRtaW5fb3BzX3VzZXIoKQogICAgICAgICAgICAgICAg - ICAgIGVyciA9IHNlbGYudmFsaWRhdGVfcmd3X2VuZHBvaW50KGluZm9fY2FwX3N1cHBvcnRlZCkK - ICAgICAgICAgICAgICAgICAgICBpZiBzZWxmLl9hcmdfcGFyc2VyLnJnd190bHNfY2VydF9wYXRo - OgogICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm91dF9tYXBbIlJHV19UTFNfQ0VSVCJdID0g - KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi52YWxpZGF0ZV9yZ3dfZW5kcG9pbnRf - dGxzX2NlcnQoKQogICAgICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICAgICAg - IyBpZiB0aGVyZSBpcyBubyBlcnJvciwgc2V0IHRoZSBSR1dfRU5EUE9JTlQKICAgICAgICAgICAg - ICAgICAgICBpZiBlcnIgIT0gIi0xIjoKICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5vdXRf - bWFwWyJSR1dfRU5EUE9JTlQiXSA9IHNlbGYuX2FyZ19wYXJzZXIucmd3X2VuZHBvaW50CiAgICAg - ICAgICAgICAgICBlbHNlOgogICAgICAgICAgICAgICAgICAgIGVyciA9ICJQbGVhc2UgcHJvdmlk - ZSBhbGwgdGhlIFJHVyBtdWx0aXNpdGUgcGFyYW1ldGVycyBvciBub25lIG9mIHRoZW0iCiAgICAg - ICAgICAgICAgICAgICAgc3lzLnN0ZGVyci53cml0ZShlcnIpCgogICAgZGVmIGdlbl9zaGVsbF9v - dXQoc2VsZik6CiAgICAgICAgc2VsZi5fZ2VuX291dHB1dF9tYXAoKQogICAgICAgIHNoT3V0SU8g - PSBTdHJpbmdJTygpCiAgICAgICAgZm9yIGssIHYgaW4gc2VsZi5vdXRfbWFwLml0ZW1zKCk6CiAg - ICAgICAgICAgIGlmIHYgYW5kIGsgbm90IGluIHNlbGYuX2V4Y2x1ZGVkX2tleXM6CiAgICAgICAg - ICAgICAgICBzaE91dElPLndyaXRlKGYiZXhwb3J0IHtrfT17dn17TElORVNFUH0iKQogICAgICAg - IHNoT3V0ID0gc2hPdXRJTy5nZXR2YWx1ZSgpCiAgICAgICAgc2hPdXRJTy5jbG9zZSgpCiAgICAg - ICAgcmV0dXJuIHNoT3V0CgogICAgZGVmIGdlbl9qc29uX291dChzZWxmKToKICAgICAgICBzZWxm - Ll9nZW5fb3V0cHV0X21hcCgpCiAgICAgICAgaWYgc2VsZi5fYXJnX3BhcnNlci5kcnlfcnVuOgog - ICAgICAgICAgICByZXR1cm4gIiIKICAgICAgICBqc29uX291dCA9IFsKICAgICAgICAgICAgewog - ICAgICAgICAgICAgICAgIm5hbWUiOiAicm9vay1jZXBoLW1vbi1lbmRwb2ludHMiLAogICAgICAg - ICAgICAgICAgImtpbmQiOiAiQ29uZmlnTWFwIiwKICAgICAgICAgICAgICAgICJkYXRhIjogewog - ICAgICAgICAgICAgICAgICAgICJkYXRhIjogc2VsZi5vdXRfbWFwWyJST09LX0VYVEVSTkFMX0NF - UEhfTU9OX0RBVEEiXSwKICAgICAgICAgICAgICAgICAgICAibWF4TW9uSWQiOiAiMCIsCiAgICAg - ICAgICAgICAgICAgICAgIm1hcHBpbmciOiAie30iLAogICAgICAgICAgICAgICAgfSwKICAgICAg - ICAgICAgfSwKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgIm5hbWUiOiAicm9vay1jZXBo - LW1vbiIsCiAgICAgICAgICAgICAgICAia2luZCI6ICJTZWNyZXQiLAogICAgICAgICAgICAgICAg - ImRhdGEiOiB7CiAgICAgICAgICAgICAgICAgICAgImFkbWluLXNlY3JldCI6ICJhZG1pbi1zZWNy - ZXQiLAogICAgICAgICAgICAgICAgICAgICJmc2lkIjogc2VsZi5vdXRfbWFwWyJST09LX0VYVEVS - TkFMX0ZTSUQiXSwKICAgICAgICAgICAgICAgICAgICAibW9uLXNlY3JldCI6ICJtb24tc2VjcmV0 - IiwKICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIHsKICAgICAg - ICAgICAgICAgICJuYW1lIjogInJvb2stY2VwaC1vcGVyYXRvci1jcmVkcyIsCiAgICAgICAgICAg - ICAgICAia2luZCI6ICJTZWNyZXQiLAogICAgICAgICAgICAgICAgImRhdGEiOiB7CiAgICAgICAg - ICAgICAgICAgICAgInVzZXJJRCI6IHNlbGYub3V0X21hcFsiUk9PS19FWFRFUk5BTF9VU0VSTkFN - RSJdLAogICAgICAgICAgICAgICAgICAgICJ1c2VyS2V5Ijogc2VsZi5vdXRfbWFwWyJST09LX0VY - VEVSTkFMX1VTRVJfU0VDUkVUIl0sCiAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICB9LAog - ICAgICAgIF0KCiAgICAgICAgIyBpZiAnTU9OSVRPUklOR19FTkRQT0lOVCcgZXhpc3RzLCB0aGVu - IG9ubHkgYWRkICdtb25pdG9yaW5nLWVuZHBvaW50JyB0byBDbHVzdGVyCiAgICAgICAgaWYgKAog - ICAgICAgICAgICBzZWxmLm91dF9tYXBbIk1PTklUT1JJTkdfRU5EUE9JTlQiXQogICAgICAgICAg - ICBhbmQgc2VsZi5vdXRfbWFwWyJNT05JVE9SSU5HX0VORFBPSU5UX1BPUlQiXQogICAgICAgICk6 - CiAgICAgICAgICAgIGpzb25fb3V0LmFwcGVuZCgKICAgICAgICAgICAgICAgIHsKICAgICAgICAg - ICAgICAgICAgICAibmFtZSI6ICJtb25pdG9yaW5nLWVuZHBvaW50IiwKICAgICAgICAgICAgICAg - ICAgICAia2luZCI6ICJDZXBoQ2x1c3RlciIsCiAgICAgICAgICAgICAgICAgICAgImRhdGEiOiB7 - CiAgICAgICAgICAgICAgICAgICAgICAgICJNb25pdG9yaW5nRW5kcG9pbnQiOiBzZWxmLm91dF9t - YXBbIk1PTklUT1JJTkdfRU5EUE9JTlQiXSwKICAgICAgICAgICAgICAgICAgICAgICAgIk1vbml0 - b3JpbmdQb3J0Ijogc2VsZi5vdXRfbWFwWyJNT05JVE9SSU5HX0VORFBPSU5UX1BPUlQiXSwKICAg - ICAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICAgICAgfQogICAgICAgICAgICApCgogICAg - ICAgICMgaWYgJ0NTSV9SQkRfTk9ERV9TRUNSRVQnIGV4aXN0cywgdGhlbiBvbmx5IGFkZCAncm9v - ay1jc2ktcmJkLXByb3Zpc2lvbmVyJyBTZWNyZXQKICAgICAgICBpZiAoCiAgICAgICAgICAgIHNl - bGYub3V0X21hcFsiQ1NJX1JCRF9OT0RFX1NFQ1JFVCJdCiAgICAgICAgICAgIGFuZCBzZWxmLm91 - dF9tYXBbIkNTSV9SQkRfTk9ERV9TRUNSRVRfTkFNRSJdCiAgICAgICAgKToKICAgICAgICAgICAg - anNvbl9vdXQuYXBwZW5kKAogICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICJu - YW1lIjogZiJyb29rLXtzZWxmLm91dF9tYXBbJ0NTSV9SQkRfTk9ERV9TRUNSRVRfTkFNRSddfSIs - CiAgICAgICAgICAgICAgICAgICAgImtpbmQiOiAiU2VjcmV0IiwKICAgICAgICAgICAgICAgICAg - ICAiZGF0YSI6IHsKICAgICAgICAgICAgICAgICAgICAgICAgInVzZXJJRCI6IHNlbGYub3V0X21h - cFsiQ1NJX1JCRF9OT0RFX1NFQ1JFVF9OQU1FIl0sCiAgICAgICAgICAgICAgICAgICAgICAgICJ1 - c2VyS2V5Ijogc2VsZi5vdXRfbWFwWyJDU0lfUkJEX05PREVfU0VDUkVUIl0sCiAgICAgICAgICAg - ICAgICAgICAgfSwKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgKQogICAgICAgICMgaWYg - J0NTSV9SQkRfUFJPVklTSU9ORVJfU0VDUkVUJyBleGlzdHMsIHRoZW4gb25seSBhZGQgJ3Jvb2st - Y3NpLXJiZC1wcm92aXNpb25lcicgU2VjcmV0CiAgICAgICAgaWYgKAogICAgICAgICAgICBzZWxm - Lm91dF9tYXBbIkNTSV9SQkRfUFJPVklTSU9ORVJfU0VDUkVUIl0KICAgICAgICAgICAgYW5kIHNl - bGYub3V0X21hcFsiQ1NJX1JCRF9QUk9WSVNJT05FUl9TRUNSRVRfTkFNRSJdCiAgICAgICAgKToK - ICAgICAgICAgICAganNvbl9vdXQuYXBwZW5kKAogICAgICAgICAgICAgICAgewogICAgICAgICAg - ICAgICAgICAgICJuYW1lIjogZiJyb29rLXtzZWxmLm91dF9tYXBbJ0NTSV9SQkRfUFJPVklTSU9O - RVJfU0VDUkVUX05BTUUnXX0iLAogICAgICAgICAgICAgICAgICAgICJraW5kIjogIlNlY3JldCIs - CiAgICAgICAgICAgICAgICAgICAgImRhdGEiOiB7CiAgICAgICAgICAgICAgICAgICAgICAgICJ1 - c2VySUQiOiBzZWxmLm91dF9tYXBbIkNTSV9SQkRfUFJPVklTSU9ORVJfU0VDUkVUX05BTUUiXSwK - ICAgICAgICAgICAgICAgICAgICAgICAgInVzZXJLZXkiOiBzZWxmLm91dF9tYXBbIkNTSV9SQkRf - UFJPVklTSU9ORVJfU0VDUkVUIl0sCiAgICAgICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAg - ICAgIH0KICAgICAgICAgICAgKQogICAgICAgICMgaWYgJ0NTSV9DRVBIRlNfUFJPVklTSU9ORVJf - U0VDUkVUJyBleGlzdHMsIHRoZW4gb25seSBhZGQgJ3Jvb2stY3NpLWNlcGhmcy1wcm92aXNpb25l - cicgU2VjcmV0CiAgICAgICAgaWYgKAogICAgICAgICAgICBzZWxmLm91dF9tYXBbIkNTSV9DRVBI - RlNfUFJPVklTSU9ORVJfU0VDUkVUIl0KICAgICAgICAgICAgYW5kIHNlbGYub3V0X21hcFsiQ1NJ - X0NFUEhGU19QUk9WSVNJT05FUl9TRUNSRVRfTkFNRSJdCiAgICAgICAgKToKICAgICAgICAgICAg - anNvbl9vdXQuYXBwZW5kKAogICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICJu - YW1lIjogZiJyb29rLXtzZWxmLm91dF9tYXBbJ0NTSV9DRVBIRlNfUFJPVklTSU9ORVJfU0VDUkVU - X05BTUUnXX0iLAogICAgICAgICAgICAgICAgICAgICJraW5kIjogIlNlY3JldCIsCiAgICAgICAg - ICAgICAgICAgICAgImRhdGEiOiB7CiAgICAgICAgICAgICAgICAgICAgICAgICJhZG1pbklEIjog + ICAgICAgICBjZXBoZnNfZmlsZXN5c3RlbSA9IHNlbGYuX2FyZ19wYXJzZXIuY2VwaGZzX2ZpbGVz + eXN0ZW1fbmFtZQogICAgICAgICAgICBpZiBjZXBoZnNfZmlsZXN5c3RlbSA9PSAiIjoKICAgICAg + ICAgICAgICAgIGVudGl0eSA9IGYie2VudGl0eX0te2s4c19jbHVzdGVyX25hbWV9IgogICAgICAg + ICAgICBlbHNlOgogICAgICAgICAgICAgICAgZW50aXR5ID0gZiJ7ZW50aXR5fS17azhzX2NsdXN0 + ZXJfbmFtZX0te2NlcGhmc19maWxlc3lzdGVtfSIKICAgICAgICAgICAgICAgIGNhcHNbIm9zZCJd + ID0gZiJhbGxvdyBydyB0YWcgY2VwaGZzICo9e2NlcGhmc19maWxlc3lzdGVtfSIKCiAgICAgICAg + cmV0dXJuIGNhcHMsIGVudGl0eQoKICAgIGRlZiBnZXRfZW50aXR5KAogICAgICAgIHNlbGYsCiAg + ICAgICAgZW50aXR5LAogICAgICAgIHJiZF9wb29sX25hbWUsCiAgICAgICAgYWxpYXNfcmJkX3Bv + b2xfbmFtZSwKICAgICAgICBrOHNfY2x1c3Rlcl9uYW1lLAogICAgICAgIHJhZG9zX25hbWVzcGFj + ZSwKICAgICk6CiAgICAgICAgaWYgKAogICAgICAgICAgICByYmRfcG9vbF9uYW1lLmNvdW50KCIu + IikgIT0gMAogICAgICAgICAgICBvciByYmRfcG9vbF9uYW1lLmNvdW50KCJfIikgIT0gMAogICAg + ICAgICAgICBvciBhbGlhc19yYmRfcG9vbF9uYW1lICE9ICIiCiAgICAgICAgICAgICMgY2hlY2tp + bmcgYWxpYXNfcmJkX3Bvb2xfbmFtZSBpcyBub3QgZW1wdHkgYXMgdGhlcmUgbWF5YmUgYSBzcGVj + aWFsIGNoYXJhY3RlciB1c2VkIG90aGVyIHRoYW4gLiBvciBfCiAgICAgICAgKToKICAgICAgICAg + ICAgaWYgYWxpYXNfcmJkX3Bvb2xfbmFtZSA9PSAiIjoKICAgICAgICAgICAgICAgIHJhaXNlIEV4 + ZWN1dGlvbkZhaWx1cmVFeGNlcHRpb24oCiAgICAgICAgICAgICAgICAgICAgInBsZWFzZSBzZXQg + dGhlICctLWFsaWFzLXJiZC1kYXRhLXBvb2wtbmFtZScgZmxhZyBhcyB0aGUgcmJkIGRhdGEgcG9v + bCBuYW1lIGNvbnRhaW5zICcuJyBvciAnXyciCiAgICAgICAgICAgICAgICApCiAgICAgICAgICAg + IGlmICgKICAgICAgICAgICAgICAgIGFsaWFzX3JiZF9wb29sX25hbWUuY291bnQoIi4iKSAhPSAw + CiAgICAgICAgICAgICAgICBvciBhbGlhc19yYmRfcG9vbF9uYW1lLmNvdW50KCJfIikgIT0gMAog + ICAgICAgICAgICApOgogICAgICAgICAgICAgICAgcmFpc2UgRXhlY3V0aW9uRmFpbHVyZUV4Y2Vw + dGlvbigKICAgICAgICAgICAgICAgICAgICAiJy0tYWxpYXMtcmJkLWRhdGEtcG9vbC1uYW1lJyBm + bGFnIHZhbHVlIHNob3VsZCBub3QgY29udGFpbiAnLicgb3IgJ18nIgogICAgICAgICAgICAgICAg + KQogICAgICAgICAgICBlbnRpdHkgPSBmIntlbnRpdHl9LXtrOHNfY2x1c3Rlcl9uYW1lfS17YWxp + YXNfcmJkX3Bvb2xfbmFtZX0iCiAgICAgICAgZWxzZToKICAgICAgICAgICAgZW50aXR5ID0gZiJ7 + ZW50aXR5fS17azhzX2NsdXN0ZXJfbmFtZX0te3JiZF9wb29sX25hbWV9IgoKICAgICAgICBpZiBy + YWRvc19uYW1lc3BhY2U6CiAgICAgICAgICAgIGVudGl0eSA9IGYie2VudGl0eX0te3JhZG9zX25h + bWVzcGFjZX0iCiAgICAgICAgcmV0dXJuIGVudGl0eQoKICAgIGRlZiBnZXRfcmJkX3Byb3Zpc2lv + bmVyX2NhcHNfYW5kX2VudGl0eShzZWxmKToKICAgICAgICBlbnRpdHkgPSAiY2xpZW50LmNzaS1y + YmQtcHJvdmlzaW9uZXIiCiAgICAgICAgY2FwcyA9IHsKICAgICAgICAgICAgIm1vbiI6ICJwcm9m + aWxlIHJiZCwgYWxsb3cgY29tbWFuZCAnb3NkIGJsb2NrbGlzdCciLAogICAgICAgICAgICAibWdy + IjogImFsbG93IHJ3IiwKICAgICAgICAgICAgIm9zZCI6ICJwcm9maWxlIHJiZCIsCiAgICAgICAg + fQogICAgICAgIGlmIHNlbGYuX2FyZ19wYXJzZXIucmVzdHJpY3RlZF9hdXRoX3Blcm1pc3Npb246 + CiAgICAgICAgICAgIHJiZF9wb29sX25hbWUgPSBzZWxmLl9hcmdfcGFyc2VyLnJiZF9kYXRhX3Bv + b2xfbmFtZQogICAgICAgICAgICBhbGlhc19yYmRfcG9vbF9uYW1lID0gc2VsZi5fYXJnX3BhcnNl + ci5hbGlhc19yYmRfZGF0YV9wb29sX25hbWUKICAgICAgICAgICAgazhzX2NsdXN0ZXJfbmFtZSA9 + IHNlbGYuX2FyZ19wYXJzZXIuazhzX2NsdXN0ZXJfbmFtZQogICAgICAgICAgICByYWRvc19uYW1l + c3BhY2UgPSBzZWxmLl9hcmdfcGFyc2VyLnJhZG9zX25hbWVzcGFjZQogICAgICAgICAgICBpZiBy + YmRfcG9vbF9uYW1lID09ICIiOgogICAgICAgICAgICAgICAgcmFpc2UgRXhlY3V0aW9uRmFpbHVy + ZUV4Y2VwdGlvbigKICAgICAgICAgICAgICAgICAgICAibWFuZGF0b3J5IGZsYWcgbm90IGZvdW5k + LCBwbGVhc2Ugc2V0IHRoZSAnLS1yYmQtZGF0YS1wb29sLW5hbWUnIGZsYWciCiAgICAgICAgICAg + ICAgICApCiAgICAgICAgICAgIGlmIGs4c19jbHVzdGVyX25hbWUgPT0gIiI6CiAgICAgICAgICAg + ICAgICByYWlzZSBFeGVjdXRpb25GYWlsdXJlRXhjZXB0aW9uKAogICAgICAgICAgICAgICAgICAg + ICJtYW5kYXRvcnkgZmxhZyBub3QgZm91bmQsIHBsZWFzZSBzZXQgdGhlICctLWs4cy1jbHVzdGVy + LW5hbWUnIGZsYWciCiAgICAgICAgICAgICAgICApCiAgICAgICAgICAgIGVudGl0eSA9IHNlbGYu + Z2V0X2VudGl0eSgKICAgICAgICAgICAgICAgIGVudGl0eSwKICAgICAgICAgICAgICAgIHJiZF9w + b29sX25hbWUsCiAgICAgICAgICAgICAgICBhbGlhc19yYmRfcG9vbF9uYW1lLAogICAgICAgICAg + ICAgICAgazhzX2NsdXN0ZXJfbmFtZSwKICAgICAgICAgICAgICAgIHJhZG9zX25hbWVzcGFjZSwK + ICAgICAgICAgICAgKQogICAgICAgICAgICBpZiByYWRvc19uYW1lc3BhY2UgIT0gIiI6CiAgICAg + ICAgICAgICAgICBjYXBzWyJvc2QiXSA9ICgKICAgICAgICAgICAgICAgICAgICBmInByb2ZpbGUg + cmJkIHBvb2w9e3JiZF9wb29sX25hbWV9IG5hbWVzcGFjZT17cmFkb3NfbmFtZXNwYWNlfSIKICAg + ICAgICAgICAgICAgICkKICAgICAgICAgICAgZWxzZToKICAgICAgICAgICAgICAgIGNhcHNbIm9z + ZCJdID0gZiJwcm9maWxlIHJiZCBwb29sPXtyYmRfcG9vbF9uYW1lfSIKCiAgICAgICAgcmV0dXJu + IGNhcHMsIGVudGl0eQoKICAgIGRlZiBnZXRfcmJkX25vZGVfY2Fwc19hbmRfZW50aXR5KHNlbGYp + OgogICAgICAgIGVudGl0eSA9ICJjbGllbnQuY3NpLXJiZC1ub2RlIgogICAgICAgIGNhcHMgPSB7 + CiAgICAgICAgICAgICJtb24iOiAicHJvZmlsZSByYmQsIGFsbG93IGNvbW1hbmQgJ29zZCBibG9j + a2xpc3QnIiwKICAgICAgICAgICAgIm9zZCI6ICJwcm9maWxlIHJiZCIsCiAgICAgICAgfQogICAg + ICAgIGlmIHNlbGYuX2FyZ19wYXJzZXIucmVzdHJpY3RlZF9hdXRoX3Blcm1pc3Npb246CiAgICAg + ICAgICAgIHJiZF9wb29sX25hbWUgPSBzZWxmLl9hcmdfcGFyc2VyLnJiZF9kYXRhX3Bvb2xfbmFt + ZQogICAgICAgICAgICBhbGlhc19yYmRfcG9vbF9uYW1lID0gc2VsZi5fYXJnX3BhcnNlci5hbGlh + c19yYmRfZGF0YV9wb29sX25hbWUKICAgICAgICAgICAgazhzX2NsdXN0ZXJfbmFtZSA9IHNlbGYu + X2FyZ19wYXJzZXIuazhzX2NsdXN0ZXJfbmFtZQogICAgICAgICAgICByYWRvc19uYW1lc3BhY2Ug + PSBzZWxmLl9hcmdfcGFyc2VyLnJhZG9zX25hbWVzcGFjZQogICAgICAgICAgICBpZiByYmRfcG9v + bF9uYW1lID09ICIiOgogICAgICAgICAgICAgICAgcmFpc2UgRXhlY3V0aW9uRmFpbHVyZUV4Y2Vw + dGlvbigKICAgICAgICAgICAgICAgICAgICAibWFuZGF0b3J5IGZsYWcgbm90IGZvdW5kLCBwbGVh + c2Ugc2V0IHRoZSAnLS1yYmQtZGF0YS1wb29sLW5hbWUnIGZsYWciCiAgICAgICAgICAgICAgICAp + CiAgICAgICAgICAgIGlmIGs4c19jbHVzdGVyX25hbWUgPT0gIiI6CiAgICAgICAgICAgICAgICBy + YWlzZSBFeGVjdXRpb25GYWlsdXJlRXhjZXB0aW9uKAogICAgICAgICAgICAgICAgICAgICJtYW5k + YXRvcnkgZmxhZyBub3QgZm91bmQsIHBsZWFzZSBzZXQgdGhlICctLWs4cy1jbHVzdGVyLW5hbWUn + IGZsYWciCiAgICAgICAgICAgICAgICApCiAgICAgICAgICAgIGVudGl0eSA9IHNlbGYuZ2V0X2Vu + dGl0eSgKICAgICAgICAgICAgICAgIGVudGl0eSwKICAgICAgICAgICAgICAgIHJiZF9wb29sX25h + bWUsCiAgICAgICAgICAgICAgICBhbGlhc19yYmRfcG9vbF9uYW1lLAogICAgICAgICAgICAgICAg + azhzX2NsdXN0ZXJfbmFtZSwKICAgICAgICAgICAgICAgIHJhZG9zX25hbWVzcGFjZSwKICAgICAg + ICAgICAgKQogICAgICAgICAgICBpZiByYWRvc19uYW1lc3BhY2UgIT0gIiI6CiAgICAgICAgICAg + ICAgICBjYXBzWyJvc2QiXSA9ICgKICAgICAgICAgICAgICAgICAgICBmInByb2ZpbGUgcmJkIHBv + b2w9e3JiZF9wb29sX25hbWV9IG5hbWVzcGFjZT17cmFkb3NfbmFtZXNwYWNlfSIKICAgICAgICAg + ICAgICAgICkKICAgICAgICAgICAgZWxzZToKICAgICAgICAgICAgICAgIGNhcHNbIm9zZCJdID0g + ZiJwcm9maWxlIHJiZCBwb29sPXtyYmRfcG9vbF9uYW1lfSIKCiAgICAgICAgcmV0dXJuIGNhcHMs + IGVudGl0eQoKICAgIGRlZiBnZXRfZGVmYXVsdFVzZXJfY2Fwc19hbmRfZW50aXR5KHNlbGYpOgog + ICAgICAgIGVudGl0eSA9IHNlbGYucnVuX2FzX3VzZXIKICAgICAgICBjYXBzID0gewogICAgICAg + ICAgICAibW9uIjogImFsbG93IHIsIGFsbG93IGNvbW1hbmQgcXVvcnVtX3N0YXR1cywgYWxsb3cg + Y29tbWFuZCB2ZXJzaW9uIiwKICAgICAgICAgICAgIm1nciI6ICJhbGxvdyBjb21tYW5kIGNvbmZp + ZyIsCiAgICAgICAgICAgICJvc2QiOiBmInByb2ZpbGUgcmJkLXJlYWQtb25seSwgYWxsb3cgcnd4 + IHBvb2w9e3NlbGYuX2FyZ19wYXJzZXIucmd3X3Bvb2xfcHJlZml4fS5yZ3cubWV0YSwgYWxsb3cg + ciBwb29sPS5yZ3cucm9vdCwgYWxsb3cgcncgcG9vbD17c2VsZi5fYXJnX3BhcnNlci5yZ3dfcG9v + bF9wcmVmaXh9LnJndy5jb250cm9sLCBhbGxvdyByeCBwb29sPXtzZWxmLl9hcmdfcGFyc2VyLnJn + d19wb29sX3ByZWZpeH0ucmd3LmxvZywgYWxsb3cgeCBwb29sPXtzZWxmLl9hcmdfcGFyc2VyLnJn + d19wb29sX3ByZWZpeH0ucmd3LmJ1Y2tldHMuaW5kZXgiLAogICAgICAgIH0KCiAgICAgICAgcmV0 + dXJuIGNhcHMsIGVudGl0eQoKICAgIGRlZiBnZXRfY2Fwc19hbmRfZW50aXR5KHNlbGYsIHVzZXJf + bmFtZSk6CiAgICAgICAgaWYgImNsaWVudC5jc2ktY2VwaGZzLXByb3Zpc2lvbmVyIiBpbiB1c2Vy + X25hbWU6CiAgICAgICAgICAgIGlmICJjbGllbnQuY3NpLWNlcGhmcy1wcm92aXNpb25lciIgIT0g + dXNlcl9uYW1lOgogICAgICAgICAgICAgICAgc2VsZi5fYXJnX3BhcnNlci5yZXN0cmljdGVkX2F1 + dGhfcGVybWlzc2lvbiA9IFRydWUKICAgICAgICAgICAgcmV0dXJuIHNlbGYuZ2V0X2NlcGhmc19w + cm92aXNpb25lcl9jYXBzX2FuZF9lbnRpdHkoKQogICAgICAgIGlmICJjbGllbnQuY3NpLWNlcGhm + cy1ub2RlIiBpbiB1c2VyX25hbWU6CiAgICAgICAgICAgIGlmICJjbGllbnQuY3NpLWNlcGhmcy1u + b2RlIiAhPSB1c2VyX25hbWU6CiAgICAgICAgICAgICAgICBzZWxmLl9hcmdfcGFyc2VyLnJlc3Ry + aWN0ZWRfYXV0aF9wZXJtaXNzaW9uID0gVHJ1ZQogICAgICAgICAgICByZXR1cm4gc2VsZi5nZXRf + Y2VwaGZzX25vZGVfY2Fwc19hbmRfZW50aXR5KCkKICAgICAgICBpZiAiY2xpZW50LmNzaS1yYmQt + cHJvdmlzaW9uZXIiIGluIHVzZXJfbmFtZToKICAgICAgICAgICAgaWYgImNsaWVudC5jc2ktcmJk + LXByb3Zpc2lvbmVyIiAhPSB1c2VyX25hbWU6CiAgICAgICAgICAgICAgICBzZWxmLl9hcmdfcGFy + c2VyLnJlc3RyaWN0ZWRfYXV0aF9wZXJtaXNzaW9uID0gVHJ1ZQogICAgICAgICAgICByZXR1cm4g + c2VsZi5nZXRfcmJkX3Byb3Zpc2lvbmVyX2NhcHNfYW5kX2VudGl0eSgpCiAgICAgICAgaWYgImNs + aWVudC5jc2ktcmJkLW5vZGUiIGluIHVzZXJfbmFtZToKICAgICAgICAgICAgaWYgImNsaWVudC5j + c2ktcmJkLW5vZGUiICE9IHVzZXJfbmFtZToKICAgICAgICAgICAgICAgIHNlbGYuX2FyZ19wYXJz + ZXIucmVzdHJpY3RlZF9hdXRoX3Blcm1pc3Npb24gPSBUcnVlCiAgICAgICAgICAgIHJldHVybiBz + ZWxmLmdldF9yYmRfbm9kZV9jYXBzX2FuZF9lbnRpdHkoKQogICAgICAgIGlmICJjbGllbnQuaGVh + bHRoY2hlY2tlciIgaW4gdXNlcl9uYW1lOgogICAgICAgICAgICBpZiAiY2xpZW50LmhlYWx0aGNo + ZWNrZXIiICE9IHVzZXJfbmFtZToKICAgICAgICAgICAgICAgIHNlbGYuX2FyZ19wYXJzZXIucmVz + dHJpY3RlZF9hdXRoX3Blcm1pc3Npb24gPSBUcnVlCiAgICAgICAgICAgIHJldHVybiBzZWxmLmdl + dF9kZWZhdWx0VXNlcl9jYXBzX2FuZF9lbnRpdHkoKQoKICAgICAgICByYWlzZSBFeGVjdXRpb25G + YWlsdXJlRXhjZXB0aW9uKAogICAgICAgICAgICBmIm5vIHVzZXIgZm91bmQgd2l0aCB1c2VyX25h + bWU6IHt1c2VyX25hbWV9LCAiCiAgICAgICAgICAgICJnZXRfY2Fwc19hbmRfZW50aXR5IGNvbW1h + bmQgZmFpbGVkLlxuIgogICAgICAgICkKCiAgICBkZWYgY3JlYXRlX2NlcGhDU0lLZXlyaW5nX3Vz + ZXIoc2VsZiwgdXNlcik6CiAgICAgICAgIiIiCiAgICAgICAgY29tbWFuZDogY2VwaCBhdXRoIGdl + dC1vci1jcmVhdGUgY2xpZW50LmNzaS1jZXBoZnMtcHJvdmlzaW9uZXIgbW9uICdhbGxvdyByJyBt + Z3IgJ2FsbG93IHJ3JyBvc2QgJ2FsbG93IHJ3IHRhZyBjZXBoZnMgbWV0YWRhdGE9KicKICAgICAg + ICAiIiIKICAgICAgICBjYXBzLCBlbnRpdHkgPSBzZWxmLmdldF9jYXBzX2FuZF9lbnRpdHkodXNl + cikKICAgICAgICBjbWRfanNvbiA9IHsKICAgICAgICAgICAgInByZWZpeCI6ICJhdXRoIGdldC1v + ci1jcmVhdGUiLAogICAgICAgICAgICAiZW50aXR5IjogZW50aXR5LAogICAgICAgICAgICAiY2Fw + cyI6IFtjYXAgZm9yIGNhcF9saXN0IGluIGxpc3QoY2Fwcy5pdGVtcygpKSBmb3IgY2FwIGluIGNh + cF9saXN0XSwKICAgICAgICAgICAgImZvcm1hdCI6ICJqc29uIiwKICAgICAgICB9CgogICAgICAg + IGlmIHNlbGYuX2FyZ19wYXJzZXIuZHJ5X3J1bjoKICAgICAgICAgICAgcmV0dXJuICgKICAgICAg + ICAgICAgICAgIHNlbGYuZHJ5X3J1bigKICAgICAgICAgICAgICAgICAgICAiY2VwaCAiCiAgICAg + ICAgICAgICAgICAgICAgKyBjbWRfanNvblsicHJlZml4Il0KICAgICAgICAgICAgICAgICAgICAr + ICIgIgogICAgICAgICAgICAgICAgICAgICsgY21kX2pzb25bImVudGl0eSJdCiAgICAgICAgICAg + ICAgICAgICAgKyAiICIKICAgICAgICAgICAgICAgICAgICArICIgIi5qb2luKGNtZF9qc29uWyJj + YXBzIl0pCiAgICAgICAgICAgICAgICApLAogICAgICAgICAgICAgICAgIiIsCiAgICAgICAgICAg + ICkKICAgICAgICAjIGNoZWNrIGlmIHVzZXIgYWxyZWFkeSBleGlzdAogICAgICAgIHVzZXJfa2V5 + ID0gc2VsZi5jaGVja191c2VyX2V4aXN0KGVudGl0eSkKICAgICAgICBpZiB1c2VyX2tleSAhPSAi + IjoKICAgICAgICAgICAgcmV0dXJuIHVzZXJfa2V5LCBmIntlbnRpdHkuc3BsaXQoJy4nLCAxKVsx + XX0iCiAgICAgICAgICAgICMgZW50aXR5LnNwbGl0KCcuJywxKVsxXSB0byByZW5hbWUgZW50aXR5 + KGNsaWVudC5jc2ktcmJkLW5vZGUpIGFzIGNzaS1yYmQtbm9kZQoKICAgICAgICByZXRfdmFsLCBq + c29uX291dCwgZXJyX21zZyA9IHNlbGYuX2NvbW1vbl9jbWRfanNvbl9nZW4oY21kX2pzb24pCiAg + ICAgICAgIyBpZiB0aGVyZSBpcyBhbiB1bnN1Y2Nlc3NmdWwgYXR0ZW1wdCwKICAgICAgICBpZiBy + ZXRfdmFsICE9IDAgb3IgbGVuKGpzb25fb3V0KSA9PSAwOgogICAgICAgICAgICByYWlzZSBFeGVj + dXRpb25GYWlsdXJlRXhjZXB0aW9uKAogICAgICAgICAgICAgICAgZiInYXV0aCBnZXQtb3ItY3Jl + YXRlIHt1c2VyfScgY29tbWFuZCBmYWlsZWQuXG4iCiAgICAgICAgICAgICAgICBmIkVycm9yOiB7 + ZXJyX21zZyBpZiByZXRfdmFsICE9IDAgZWxzZSBzZWxmLkVNUFRZX09VVFBVVF9MSVNUfSIKICAg + ICAgICAgICAgKQogICAgICAgIHJldHVybiBzdHIoanNvbl9vdXRbMF1bImtleSJdKSwgZiJ7ZW50 + aXR5LnNwbGl0KCcuJywgMSlbMV19IgogICAgICAgICMgZW50aXR5LnNwbGl0KCcuJywxKVsxXSB0 + byByZW5hbWUgZW50aXR5KGNsaWVudC5jc2ktcmJkLW5vZGUpIGFzIGNzaS1yYmQtbm9kZQoKICAg + IGRlZiBnZXRfY2VwaGZzX2RhdGFfcG9vbF9kZXRhaWxzKHNlbGYpOgogICAgICAgIGNtZF9qc29u + ID0geyJwcmVmaXgiOiAiZnMgbHMiLCAiZm9ybWF0IjogImpzb24ifQogICAgICAgIGlmIHNlbGYu + X2FyZ19wYXJzZXIuZHJ5X3J1bjoKICAgICAgICAgICAgcmV0dXJuIHNlbGYuZHJ5X3J1bigiY2Vw + aCAiICsgY21kX2pzb25bInByZWZpeCJdKQogICAgICAgIHJldF92YWwsIGpzb25fb3V0LCBlcnJf + bXNnID0gc2VsZi5fY29tbW9uX2NtZF9qc29uX2dlbihjbWRfanNvbikKICAgICAgICAjIGlmIHRo + ZXJlIGlzIGFuIHVuc3VjY2Vzc2Z1bCBhdHRlbXB0LCByZXBvcnQgYW4gZXJyb3IKICAgICAgICBp + ZiByZXRfdmFsICE9IDA6CiAgICAgICAgICAgICMgaWYgZnMgYW5kIGRhdGFfcG9vbCBhcmd1bWVu + dHMgYXJlIG5vdCBzZXQsIHNpbGVudGx5IHJldHVybgogICAgICAgICAgICBpZiAoCiAgICAgICAg + ICAgICAgICBzZWxmLl9hcmdfcGFyc2VyLmNlcGhmc19maWxlc3lzdGVtX25hbWUgPT0gIiIKICAg + ICAgICAgICAgICAgIGFuZCBzZWxmLl9hcmdfcGFyc2VyLmNlcGhmc19kYXRhX3Bvb2xfbmFtZSA9 + PSAiIgogICAgICAgICAgICApOgogICAgICAgICAgICAgICAgcmV0dXJuCiAgICAgICAgICAgICMg + aWYgdXNlciBoYXMgcHJvdmlkZWQgYW55IG9mIHRoZQogICAgICAgICAgICAjICctLWNlcGhmcy1m + aWxlc3lzdGVtLW5hbWUnIG9yICctLWNlcGhmcy1kYXRhLXBvb2wtbmFtZScgYXJndW1lbnRzLAog + ICAgICAgICAgICAjIHJhaXNlIGFuIGV4Y2VwdGlvbiBhcyB3ZSBhcmUgdW5hYmxlIHRvIHZlcmlm + eSB0aGUgYXJncwogICAgICAgICAgICByYWlzZSBFeGVjdXRpb25GYWlsdXJlRXhjZXB0aW9uKAog + ICAgICAgICAgICAgICAgZiInZnMgbHMnIGNlcGggY2FsbCBmYWlsZWQgd2l0aCBlcnJvcjoge2Vy + cl9tc2d9IgogICAgICAgICAgICApCgogICAgICAgIG1hdGNoaW5nX2pzb25fb3V0ID0ge30KICAg + ICAgICAjIGlmICctLWNlcGhmcy1maWxlc3lzdGVtLW5hbWUnIGFyZ3VtZW50IGlzIHByb3ZpZGVk + LAogICAgICAgICMgY2hlY2sgd2hldGhlciB0aGUgcHJvdmlkZWQgZmlsZXN5c3RlbS1uYW1lIGV4 + aXN0cyBvciBub3QKICAgICAgICBpZiBzZWxmLl9hcmdfcGFyc2VyLmNlcGhmc19maWxlc3lzdGVt + X25hbWU6CiAgICAgICAgICAgICMgZ2V0IHRoZSBtYXRjaGluZyBsaXN0CiAgICAgICAgICAgIG1h + dGNoaW5nX2pzb25fb3V0X2xpc3QgPSBbCiAgICAgICAgICAgICAgICBtYXRjaGVkCiAgICAgICAg + ICAgICAgICBmb3IgbWF0Y2hlZCBpbiBqc29uX291dAogICAgICAgICAgICAgICAgaWYgc3RyKG1h + dGNoZWRbIm5hbWUiXSkgPT0gc2VsZi5fYXJnX3BhcnNlci5jZXBoZnNfZmlsZXN5c3RlbV9uYW1l + CiAgICAgICAgICAgIF0KICAgICAgICAgICAgIyB1bmFibGUgdG8gZmluZCBhIG1hdGNoaW5nIGZz + LW5hbWUsIHJhaXNlIGFuIGVycm9yCiAgICAgICAgICAgIGlmIGxlbihtYXRjaGluZ19qc29uX291 + dF9saXN0KSA9PSAwOgogICAgICAgICAgICAgICAgcmFpc2UgRXhlY3V0aW9uRmFpbHVyZUV4Y2Vw + dGlvbigKICAgICAgICAgICAgICAgICAgICBmIkZpbGVzeXN0ZW0gcHJvdmlkZWQsICd7c2VsZi5f + YXJnX3BhcnNlci5jZXBoZnNfZmlsZXN5c3RlbV9uYW1lfScsICIKICAgICAgICAgICAgICAgICAg + ICBmImlzIG5vdCBmb3VuZCBpbiB0aGUgZnMtbGlzdDoge1tzdHIoeFsnbmFtZSddKSBmb3IgeCBp + biBqc29uX291dF19IgogICAgICAgICAgICAgICAgKQogICAgICAgICAgICBtYXRjaGluZ19qc29u + X291dCA9IG1hdGNoaW5nX2pzb25fb3V0X2xpc3RbMF0KICAgICAgICAjIGlmIGNlcGhmcyBmaWxl + c3lzdGVtIG5hbWUgaXMgbm90IHByb3ZpZGVkLAogICAgICAgICMgdHJ5IHRvIGdldCBhIGRlZmF1 + bHQgZnMgbmFtZSBieSBkb2luZyB0aGUgZm9sbG93aW5nCiAgICAgICAgZWxzZToKICAgICAgICAg + ICAgIyBhLiBjaGVjayBpZiB0aGVyZSBpcyBvbmx5IG9uZSBmaWxlc3lzdGVtIGlzIHByZXNlbnQK + ICAgICAgICAgICAgaWYgbGVuKGpzb25fb3V0KSA9PSAxOgogICAgICAgICAgICAgICAgbWF0Y2hp + bmdfanNvbl9vdXQgPSBqc29uX291dFswXQogICAgICAgICAgICAjIGIuIG9yIGVsc2UsIGNoZWNr + IGlmIGRhdGFfcG9vbCBuYW1lIGlzIHByb3ZpZGVkCiAgICAgICAgICAgIGVsaWYgc2VsZi5fYXJn + X3BhcnNlci5jZXBoZnNfZGF0YV9wb29sX25hbWU6CiAgICAgICAgICAgICAgICAjIGFuZCBpZiBw + cmVzZW50LCBjaGVjayB3aGV0aGVyIHRoZXJlIGV4aXN0cyBhIGZzIHdoaWNoIGhhcyB0aGUgZGF0 + YV9wb29sCiAgICAgICAgICAgICAgICBmb3IgZWFjaEogaW4ganNvbl9vdXQ6CiAgICAgICAgICAg + ICAgICAgICAgaWYgc2VsZi5fYXJnX3BhcnNlci5jZXBoZnNfZGF0YV9wb29sX25hbWUgaW4gZWFj + aEpbImRhdGFfcG9vbHMiXToKICAgICAgICAgICAgICAgICAgICAgICAgbWF0Y2hpbmdfanNvbl9v + dXQgPSBlYWNoSgogICAgICAgICAgICAgICAgICAgICAgICBicmVhawogICAgICAgICAgICAgICAg + IyBpZiB0aGVyZSBpcyBubyBtYXRjaGluZyBmcyBleGlzdHMsIHRoYXQgbWVhbnMgcHJvdmlkZWQg + ZGF0YV9wb29sIG5hbWUgaXMgaW52YWxpZAogICAgICAgICAgICAgICAgaWYgbm90IG1hdGNoaW5n + X2pzb25fb3V0OgogICAgICAgICAgICAgICAgICAgIHJhaXNlIEV4ZWN1dGlvbkZhaWx1cmVFeGNl + cHRpb24oCiAgICAgICAgICAgICAgICAgICAgICAgIGYiUHJvdmlkZWQgZGF0YV9wb29sIG5hbWUs + IHtzZWxmLl9hcmdfcGFyc2VyLmNlcGhmc19kYXRhX3Bvb2xfbmFtZX0sIgogICAgICAgICAgICAg + ICAgICAgICAgICAiIGRvZXMgbm90IGV4aXN0cyIKICAgICAgICAgICAgICAgICAgICApCiAgICAg + ICAgICAgICMgYy4gaWYgbm90aGluZyBpcyBzZXQgYW5kIGNvdWxkbid0IGZpbmQgYSBkZWZhdWx0 + LAogICAgICAgICAgICBlbHNlOgogICAgICAgICAgICAgICAgIyBqdXN0IHJldHVybiBzaWxlbnRs + eQogICAgICAgICAgICAgICAgcmV0dXJuCgogICAgICAgIGlmIG1hdGNoaW5nX2pzb25fb3V0Ogog + ICAgICAgICAgICBzZWxmLl9hcmdfcGFyc2VyLmNlcGhmc19maWxlc3lzdGVtX25hbWUgPSBzdHIo + bWF0Y2hpbmdfanNvbl9vdXRbIm5hbWUiXSkKICAgICAgICAgICAgc2VsZi5fYXJnX3BhcnNlci5j + ZXBoZnNfbWV0YWRhdGFfcG9vbF9uYW1lID0gc3RyKAogICAgICAgICAgICAgICAgbWF0Y2hpbmdf + anNvbl9vdXRbIm1ldGFkYXRhX3Bvb2wiXQogICAgICAgICAgICApCgogICAgICAgIGlmIGlzaW5z + dGFuY2UobWF0Y2hpbmdfanNvbl9vdXRbImRhdGFfcG9vbHMiXSwgbGlzdCk6CiAgICAgICAgICAg + ICMgaWYgdGhlIHVzZXIgaGFzIGFscmVhZHkgcHJvdmlkZWQgZGF0YS1wb29sLW5hbWUsCiAgICAg + ICAgICAgICMgdGhyb3VnaCAtLWNlcGhmcy1kYXRhLXBvb2wtbmFtZQogICAgICAgICAgICBpZiBz + ZWxmLl9hcmdfcGFyc2VyLmNlcGhmc19kYXRhX3Bvb2xfbmFtZToKICAgICAgICAgICAgICAgICMg + aWYgdGhlIHByb3ZpZGVkIG5hbWUgaXMgbm90IG1hdGNoaW5nIHdpdGggdGhlIG9uZSBpbiB0aGUg + bGlzdAogICAgICAgICAgICAgICAgaWYgKAogICAgICAgICAgICAgICAgICAgIHNlbGYuX2FyZ19w + YXJzZXIuY2VwaGZzX2RhdGFfcG9vbF9uYW1lCiAgICAgICAgICAgICAgICAgICAgbm90IGluIG1h + dGNoaW5nX2pzb25fb3V0WyJkYXRhX3Bvb2xzIl0KICAgICAgICAgICAgICAgICk6CiAgICAgICAg + ICAgICAgICAgICAgcmFpc2UgRXhlY3V0aW9uRmFpbHVyZUV4Y2VwdGlvbigKICAgICAgICAgICAg + ICAgICAgICAgICAgZiJQcm92aWRlZCBkYXRhLXBvb2wtbmFtZTogJ3tzZWxmLl9hcmdfcGFyc2Vy + LmNlcGhmc19kYXRhX3Bvb2xfbmFtZX0nLCAiCiAgICAgICAgICAgICAgICAgICAgICAgICJkb2Vz + bid0IG1hdGNoIGZyb20gdGhlIGRhdGEtcG9vbHMgbGlzdDogIgogICAgICAgICAgICAgICAgICAg + ICAgICBmIntbc3RyKHgpIGZvciB4IGluIG1hdGNoaW5nX2pzb25fb3V0WydkYXRhX3Bvb2xzJ11d + fSIKICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICMgaWYgZGF0YV9wb29sIG5hbWUg + aXMgbm90IHByb3ZpZGVkLAogICAgICAgICAgICAjIHRoZW4gdHJ5IHRvIGZpbmQgYSBkZWZhdWx0 + IGRhdGEgcG9vbCBuYW1lCiAgICAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICAgICAjIGlmIG5v + IGRhdGFfcG9vbHMgZXhpc3QsIHNpbGVudGx5IHJldHVybgogICAgICAgICAgICAgICAgaWYgbGVu + KG1hdGNoaW5nX2pzb25fb3V0WyJkYXRhX3Bvb2xzIl0pID09IDA6CiAgICAgICAgICAgICAgICAg + ICAgcmV0dXJuCiAgICAgICAgICAgICAgICBzZWxmLl9hcmdfcGFyc2VyLmNlcGhmc19kYXRhX3Bv + b2xfbmFtZSA9IHN0cigKICAgICAgICAgICAgICAgICAgICBtYXRjaGluZ19qc29uX291dFsiZGF0 + YV9wb29scyJdWzBdCiAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICMgaWYgdGhlcmUgYXJl + IG1vcmUgdGhhbiBvbmUgJ2RhdGFfcG9vbHMnIGV4aXN0LAogICAgICAgICAgICAjIHRoZW4gd2Fy + biB0aGUgdXNlciB0aGF0IHdlIGFyZSB1c2luZyB0aGUgc2VsZWN0ZWQgbmFtZQogICAgICAgICAg + ICBpZiBsZW4obWF0Y2hpbmdfanNvbl9vdXRbImRhdGFfcG9vbHMiXSkgPiAxOgogICAgICAgICAg + ICAgICAgcHJpbnQoCiAgICAgICAgICAgICAgICAgICAgIldBUk5JTkc6IE11bHRpcGxlIGRhdGEg + cG9vbHMgZGV0ZWN0ZWQ6ICIKICAgICAgICAgICAgICAgICAgICBmIntbc3RyKHgpIGZvciB4IGlu + IG1hdGNoaW5nX2pzb25fb3V0WydkYXRhX3Bvb2xzJ11dfVxuIgogICAgICAgICAgICAgICAgICAg + IGYiVXNpbmcgdGhlIGRhdGEtcG9vbDogJ3tzZWxmLl9hcmdfcGFyc2VyLmNlcGhmc19kYXRhX3Bv + b2xfbmFtZX0nXG4iCiAgICAgICAgICAgICAgICApCgogICAgZGVmIGNyZWF0ZV9jaGVja2VyS2V5 + KHNlbGYsIHVzZXIpOgogICAgICAgIGNhcHMsIGVudGl0eSA9IHNlbGYuZ2V0X2NhcHNfYW5kX2Vu + dGl0eSh1c2VyKQogICAgICAgIGNtZF9qc29uID0gewogICAgICAgICAgICAicHJlZml4IjogImF1 + dGggZ2V0LW9yLWNyZWF0ZSIsCiAgICAgICAgICAgICJlbnRpdHkiOiBlbnRpdHksCiAgICAgICAg + ICAgICJjYXBzIjogW2NhcCBmb3IgY2FwX2xpc3QgaW4gbGlzdChjYXBzLml0ZW1zKCkpIGZvciBj + YXAgaW4gY2FwX2xpc3RdLAogICAgICAgICAgICAiZm9ybWF0IjogImpzb24iLAogICAgICAgIH0K + CiAgICAgICAgaWYgc2VsZi5fYXJnX3BhcnNlci5kcnlfcnVuOgogICAgICAgICAgICByZXR1cm4g + c2VsZi5kcnlfcnVuKAogICAgICAgICAgICAgICAgImNlcGggIgogICAgICAgICAgICAgICAgKyBj + bWRfanNvblsicHJlZml4Il0KICAgICAgICAgICAgICAgICsgIiAiCiAgICAgICAgICAgICAgICAr + IGNtZF9qc29uWyJlbnRpdHkiXQogICAgICAgICAgICAgICAgKyAiICIKICAgICAgICAgICAgICAg + ICsgIiAiLmpvaW4oY21kX2pzb25bImNhcHMiXSkKICAgICAgICAgICAgKQogICAgICAgICMgY2hl + Y2sgaWYgdXNlciBhbHJlYWR5IGV4aXN0CiAgICAgICAgdXNlcl9rZXkgPSBzZWxmLmNoZWNrX3Vz + ZXJfZXhpc3QoZW50aXR5KQogICAgICAgIGlmIHVzZXJfa2V5ICE9ICIiOgogICAgICAgICAgICBy + ZXR1cm4gdXNlcl9rZXkKCiAgICAgICAgcmV0X3ZhbCwganNvbl9vdXQsIGVycl9tc2cgPSBzZWxm + Ll9jb21tb25fY21kX2pzb25fZ2VuKGNtZF9qc29uKQogICAgICAgICMgaWYgdGhlcmUgaXMgYW4g + dW5zdWNjZXNzZnVsIGF0dGVtcHQsCiAgICAgICAgaWYgcmV0X3ZhbCAhPSAwIG9yIGxlbihqc29u + X291dCkgPT0gMDoKICAgICAgICAgICAgcmFpc2UgRXhlY3V0aW9uRmFpbHVyZUV4Y2VwdGlvbigK + ICAgICAgICAgICAgICAgIGYiJ2F1dGggZ2V0LW9yLWNyZWF0ZSB7c2VsZi5ydW5fYXNfdXNlcn0n + IGNvbW1hbmQgZmFpbGVkXG4iCiAgICAgICAgICAgICAgICBmIkVycm9yOiB7ZXJyX21zZyBpZiBy + ZXRfdmFsICE9IDAgZWxzZSBzZWxmLkVNUFRZX09VVFBVVF9MSVNUfSIKICAgICAgICAgICAgKQog + ICAgICAgIHJldHVybiBzdHIoanNvbl9vdXRbMF1bImtleSJdKQoKICAgIGRlZiBnZXRfY2VwaF9k + YXNoYm9hcmRfbGluayhzZWxmKToKICAgICAgICBjbWRfanNvbiA9IHsicHJlZml4IjogIm1nciBz + ZXJ2aWNlcyIsICJmb3JtYXQiOiAianNvbiJ9CiAgICAgICAgaWYgc2VsZi5fYXJnX3BhcnNlci5k + cnlfcnVuOgogICAgICAgICAgICByZXR1cm4gc2VsZi5kcnlfcnVuKCJjZXBoICIgKyBjbWRfanNv + blsicHJlZml4Il0pCiAgICAgICAgcmV0X3ZhbCwganNvbl9vdXQsIF8gPSBzZWxmLl9jb21tb25f + Y21kX2pzb25fZ2VuKGNtZF9qc29uKQogICAgICAgICMgaWYgdGhlcmUgaXMgYW4gdW5zdWNjZXNz + ZnVsIGF0dGVtcHQsCiAgICAgICAgaWYgcmV0X3ZhbCAhPSAwIG9yIGxlbihqc29uX291dCkgPT0g + MDoKICAgICAgICAgICAgcmV0dXJuIE5vbmUKICAgICAgICBpZiAiZGFzaGJvYXJkIiBub3QgaW4g + anNvbl9vdXQ6CiAgICAgICAgICAgIHJldHVybiBOb25lCiAgICAgICAgcmV0dXJuIGpzb25fb3V0 + WyJkYXNoYm9hcmQiXQoKICAgIGRlZiBjcmVhdGVfcmd3X2FkbWluX29wc191c2VyKHNlbGYpOgog + ICAgICAgIGNtZCA9IFsKICAgICAgICAgICAgInJhZG9zZ3ctYWRtaW4iLAogICAgICAgICAgICAi + dXNlciIsCiAgICAgICAgICAgICJjcmVhdGUiLAogICAgICAgICAgICAiLS11aWQiLAogICAgICAg + ICAgICBzZWxmLkVYVEVSTkFMX1JHV19BRE1JTl9PUFNfVVNFUl9OQU1FLAogICAgICAgICAgICAi + LS1kaXNwbGF5LW5hbWUiLAogICAgICAgICAgICAiUm9vayBSR1cgQWRtaW4gT3BzIHVzZXIiLAog + ICAgICAgICAgICAiLS1jYXBzIiwKICAgICAgICAgICAgImJ1Y2tldHM9Kjt1c2Vycz0qO3VzYWdl + PXJlYWQ7bWV0YWRhdGE9cmVhZDt6b25lPXJlYWQiLAogICAgICAgICAgICAiLS1yZ3ctcmVhbG0i + LAogICAgICAgICAgICBzZWxmLl9hcmdfcGFyc2VyLnJnd19yZWFsbV9uYW1lLAogICAgICAgICAg + ICAiLS1yZ3ctem9uZWdyb3VwIiwKICAgICAgICAgICAgc2VsZi5fYXJnX3BhcnNlci5yZ3dfem9u + ZWdyb3VwX25hbWUsCiAgICAgICAgICAgICItLXJndy16b25lIiwKICAgICAgICAgICAgc2VsZi5f + YXJnX3BhcnNlci5yZ3dfem9uZV9uYW1lLAogICAgICAgIF0KICAgICAgICBpZiBzZWxmLl9hcmdf + cGFyc2VyLmRyeV9ydW46CiAgICAgICAgICAgIHJldHVybiBzZWxmLmRyeV9ydW4oImNlcGggIiAr + ICIgIi5qb2luKGNtZCkpCiAgICAgICAgdHJ5OgogICAgICAgICAgICBvdXRwdXQgPSBzdWJwcm9j + ZXNzLmNoZWNrX291dHB1dChjbWQsIHN0ZGVycj1zdWJwcm9jZXNzLlBJUEUpCiAgICAgICAgZXhj + ZXB0IHN1YnByb2Nlc3MuQ2FsbGVkUHJvY2Vzc0Vycm9yIGFzIGV4ZWNFcnI6CiAgICAgICAgICAg + ICMgaWYgdGhlIHVzZXIgYWxyZWFkeSBleGlzdHMsIHdlIGp1c3QgcXVlcnkgaXQKICAgICAgICAg + ICAgaWYgZXhlY0Vyci5yZXR1cm5jb2RlID09IGVycm5vLkVFWElTVDoKICAgICAgICAgICAgICAg + IGNtZCA9IFsKICAgICAgICAgICAgICAgICAgICAicmFkb3Nndy1hZG1pbiIsCiAgICAgICAgICAg + ICAgICAgICAgInVzZXIiLAogICAgICAgICAgICAgICAgICAgICJpbmZvIiwKICAgICAgICAgICAg + ICAgICAgICAiLS11aWQiLAogICAgICAgICAgICAgICAgICAgIHNlbGYuRVhURVJOQUxfUkdXX0FE + TUlOX09QU19VU0VSX05BTUUsCiAgICAgICAgICAgICAgICAgICAgIi0tcmd3LXJlYWxtIiwKICAg + ICAgICAgICAgICAgICAgICBzZWxmLl9hcmdfcGFyc2VyLnJnd19yZWFsbV9uYW1lLAogICAgICAg + ICAgICAgICAgICAgICItLXJndy16b25lZ3JvdXAiLAogICAgICAgICAgICAgICAgICAgIHNlbGYu + X2FyZ19wYXJzZXIucmd3X3pvbmVncm91cF9uYW1lLAogICAgICAgICAgICAgICAgICAgICItLXJn + dy16b25lIiwKICAgICAgICAgICAgICAgICAgICBzZWxmLl9hcmdfcGFyc2VyLnJnd196b25lX25h + bWUsCiAgICAgICAgICAgICAgICBdCiAgICAgICAgICAgICAgICB0cnk6CiAgICAgICAgICAgICAg + ICAgICAgb3V0cHV0ID0gc3VicHJvY2Vzcy5jaGVja19vdXRwdXQoY21kLCBzdGRlcnI9c3VicHJv + Y2Vzcy5QSVBFKQogICAgICAgICAgICAgICAgZXhjZXB0IHN1YnByb2Nlc3MuQ2FsbGVkUHJvY2Vz + c0Vycm9yIGFzIGV4ZWNFcnI6CiAgICAgICAgICAgICAgICAgICAgZXJyX21zZyA9ICgKICAgICAg + ICAgICAgICAgICAgICAgICAgZiJmYWlsZWQgdG8gZXhlY3V0ZSBjb21tYW5kIHtjbWR9LiBPdXRw + dXQ6IHtleGVjRXJyLm91dHB1dH0uICIKICAgICAgICAgICAgICAgICAgICAgICAgZiJDb2RlOiB7 + ZXhlY0Vyci5yZXR1cm5jb2RlfS4gRXJyb3I6IHtleGVjRXJyLnN0ZGVycn0iCiAgICAgICAgICAg + ICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgIHN5cy5zdGRlcnIud3JpdGUoZXJyX21zZykK + ICAgICAgICAgICAgICAgICAgICByZXR1cm4gTm9uZSwgTm9uZSwgRmFsc2UsICItMSIKICAgICAg + ICAgICAgZWxzZToKICAgICAgICAgICAgICAgIGVycl9tc2cgPSAoCiAgICAgICAgICAgICAgICAg + ICAgZiJmYWlsZWQgdG8gZXhlY3V0ZSBjb21tYW5kIHtjbWR9LiBPdXRwdXQ6IHtleGVjRXJyLm91 + dHB1dH0uICIKICAgICAgICAgICAgICAgICAgICBmIkNvZGU6IHtleGVjRXJyLnJldHVybmNvZGV9 + LiBFcnJvcjoge2V4ZWNFcnIuc3RkZXJyfSIKICAgICAgICAgICAgICAgICkKICAgICAgICAgICAg + ICAgIHN5cy5zdGRlcnIud3JpdGUoZXJyX21zZykKICAgICAgICAgICAgICAgIHJldHVybiBOb25l + LCBOb25lLCBGYWxzZSwgIi0xIgoKICAgICAgICAjIHNlcGFyYXRlbHkgYWRkIGluZm89cmVhZCBj + YXBzIGZvciByZ3ctZW5kcG9pbnQgaXAgdmFsaWRhdGlvbgogICAgICAgIGluZm9fY2FwX3N1cHBv + cnRlZCA9IFRydWUKICAgICAgICBjbWQgPSBbCiAgICAgICAgICAgICJyYWRvc2d3LWFkbWluIiwK + ICAgICAgICAgICAgImNhcHMiLAogICAgICAgICAgICAiYWRkIiwKICAgICAgICAgICAgIi0tdWlk + IiwKICAgICAgICAgICAgc2VsZi5FWFRFUk5BTF9SR1dfQURNSU5fT1BTX1VTRVJfTkFNRSwKICAg + ICAgICAgICAgIi0tY2FwcyIsCiAgICAgICAgICAgICJpbmZvPXJlYWQiLAogICAgICAgICAgICAi + LS1yZ3ctcmVhbG0iLAogICAgICAgICAgICBzZWxmLl9hcmdfcGFyc2VyLnJnd19yZWFsbV9uYW1l + LAogICAgICAgICAgICAiLS1yZ3ctem9uZWdyb3VwIiwKICAgICAgICAgICAgc2VsZi5fYXJnX3Bh + cnNlci5yZ3dfem9uZWdyb3VwX25hbWUsCiAgICAgICAgICAgICItLXJndy16b25lIiwKICAgICAg + ICAgICAgc2VsZi5fYXJnX3BhcnNlci5yZ3dfem9uZV9uYW1lLAogICAgICAgIF0KICAgICAgICB0 + cnk6CiAgICAgICAgICAgIG91dHB1dCA9IHN1YnByb2Nlc3MuY2hlY2tfb3V0cHV0KGNtZCwgc3Rk + ZXJyPXN1YnByb2Nlc3MuUElQRSkKICAgICAgICBleGNlcHQgc3VicHJvY2Vzcy5DYWxsZWRQcm9j + ZXNzRXJyb3IgYXMgZXhlY0VycjoKICAgICAgICAgICAgIyBpZiB0aGUgY2VwaCB2ZXJzaW9uIG5v + dCBzdXBwb3J0ZWQgZm9yIGFkZGluZyBgaW5mbz1yZWFkYCBjYXAocmd3X3ZhbGlkYXRpb24pCiAg + ICAgICAgICAgIGlmICgKICAgICAgICAgICAgICAgICJjb3VsZCBub3QgYWRkIGNhcHM6IHVuYWJs + ZSB0byBhZGQgY2FwczogaW5mbz1yZWFkXG4iCiAgICAgICAgICAgICAgICBpbiBleGVjRXJyLnN0 + ZGVyci5kZWNvZGUoInV0Zi04IikKICAgICAgICAgICAgICAgIGFuZCBleGVjRXJyLnJldHVybmNv + ZGUgPT0gMjQ0CiAgICAgICAgICAgICk6CiAgICAgICAgICAgICAgICBpbmZvX2NhcF9zdXBwb3J0 + ZWQgPSBGYWxzZQogICAgICAgICAgICBlbHNlOgogICAgICAgICAgICAgICAgZXJyX21zZyA9ICgK + ICAgICAgICAgICAgICAgICAgICBmImZhaWxlZCB0byBleGVjdXRlIGNvbW1hbmQge2NtZH0uIE91 + dHB1dDoge2V4ZWNFcnIub3V0cHV0fS4gIgogICAgICAgICAgICAgICAgICAgIGYiQ29kZToge2V4 + ZWNFcnIucmV0dXJuY29kZX0uIEVycm9yOiB7ZXhlY0Vyci5zdGRlcnJ9IgogICAgICAgICAgICAg + ICAgKQogICAgICAgICAgICAgICAgc3lzLnN0ZGVyci53cml0ZShlcnJfbXNnKQogICAgICAgICAg + ICAgICAgcmV0dXJuIE5vbmUsIE5vbmUsIEZhbHNlLCAiLTEiCgogICAgICAgIGpzb25vdXRwdXQg + PSBqc29uLmxvYWRzKG91dHB1dCkKICAgICAgICByZXR1cm4gKAogICAgICAgICAgICBqc29ub3V0 + cHV0WyJrZXlzIl1bMF1bImFjY2Vzc19rZXkiXSwKICAgICAgICAgICAganNvbm91dHB1dFsia2V5 + cyJdWzBdWyJzZWNyZXRfa2V5Il0sCiAgICAgICAgICAgIGluZm9fY2FwX3N1cHBvcnRlZCwKICAg + ICAgICAgICAgIiIsCiAgICAgICAgKQoKICAgIGRlZiB2YWxpZGF0ZV9yYmRfcG9vbChzZWxmLCBw + b29sX25hbWUpOgogICAgICAgIGlmIG5vdCBzZWxmLmNsdXN0ZXIucG9vbF9leGlzdHMocG9vbF9u + YW1lKToKICAgICAgICAgICAgcmFpc2UgRXhlY3V0aW9uRmFpbHVyZUV4Y2VwdGlvbigKICAgICAg + ICAgICAgICAgIGYiVGhlIHByb3ZpZGVkIHBvb2wsICd7cG9vbF9uYW1lfScsIGRvZXMgbm90IGV4 + aXN0IgogICAgICAgICAgICApCgogICAgZGVmIGluaXRfcmJkX3Bvb2woc2VsZiwgcmJkX3Bvb2xf + bmFtZSk6CiAgICAgICAgaWYgaXNpbnN0YW5jZShzZWxmLmNsdXN0ZXIsIER1bW15UmFkb3MpOgog + ICAgICAgICAgICByZXR1cm4KICAgICAgICBpb2N0eCA9IHNlbGYuY2x1c3Rlci5vcGVuX2lvY3R4 + KHJiZF9wb29sX25hbWUpCiAgICAgICAgcmJkX2luc3QgPSByYmQuUkJEKCkKICAgICAgICByYmRf + aW5zdC5wb29sX2luaXQoaW9jdHgsIFRydWUpCgogICAgZGVmIHZhbGlkYXRlX3JhZG9zX25hbWVz + cGFjZShzZWxmKToKICAgICAgICByYmRfcG9vbF9uYW1lID0gc2VsZi5fYXJnX3BhcnNlci5yYmRf + ZGF0YV9wb29sX25hbWUKICAgICAgICBpZiBzZWxmLl9hcmdfcGFyc2VyLnJiZF9tZXRhZGF0YV9l + Y19wb29sX25hbWU6CiAgICAgICAgICAgIHJiZF9wb29sX25hbWUgPSBzZWxmLl9hcmdfcGFyc2Vy + LnJiZF9tZXRhZGF0YV9lY19wb29sX25hbWUKICAgICAgICByYWRvc19uYW1lc3BhY2UgPSBzZWxm + Ll9hcmdfcGFyc2VyLnJhZG9zX25hbWVzcGFjZQogICAgICAgIGlmIHJhZG9zX25hbWVzcGFjZSA9 + PSAiIjoKICAgICAgICAgICAgcmV0dXJuCiAgICAgICAgaWYgcmFkb3NfbmFtZXNwYWNlLmlzbG93 + ZXIoKSA9PSBGYWxzZToKICAgICAgICAgICAgcmFpc2UgRXhlY3V0aW9uRmFpbHVyZUV4Y2VwdGlv + bigKICAgICAgICAgICAgICAgIGYiVGhlIHByb3ZpZGVkIHJhZG9zIE5hbWVzcGFjZSwgJ3tyYWRv + c19uYW1lc3BhY2V9JywgIgogICAgICAgICAgICAgICAgZiJjb250YWlucyB1cHBlciBjYXNlIgog + ICAgICAgICAgICApCiAgICAgICAgcmJkX2luc3QgPSByYmQuUkJEKCkKICAgICAgICBpb2N0eCA9 + IHNlbGYuY2x1c3Rlci5vcGVuX2lvY3R4KHJiZF9wb29sX25hbWUpCiAgICAgICAgaWYgcmJkX2lu + c3QubmFtZXNwYWNlX2V4aXN0cyhpb2N0eCwgcmFkb3NfbmFtZXNwYWNlKSBpcyBGYWxzZToKICAg + ICAgICAgICAgcmFpc2UgRXhlY3V0aW9uRmFpbHVyZUV4Y2VwdGlvbigKICAgICAgICAgICAgICAg + IGYiVGhlIHByb3ZpZGVkIHJhZG9zIE5hbWVzcGFjZSwgJ3tyYWRvc19uYW1lc3BhY2V9JywgIgog + ICAgICAgICAgICAgICAgZiJpcyBub3QgZm91bmQgaW4gdGhlIHBvb2wgJ3tyYmRfcG9vbF9uYW1l + fSciCiAgICAgICAgICAgICkKCiAgICBkZWYgZ2V0X29yX2NyZWF0ZV9zdWJ2b2x1bWVfZ3JvdXAo + c2VsZiwgc3Vidm9sdW1lX2dyb3VwLCBjZXBoZnNfZmlsZXN5c3RlbV9uYW1lKToKICAgICAgICBj + bWQgPSBbCiAgICAgICAgICAgICJjZXBoIiwKICAgICAgICAgICAgImZzIiwKICAgICAgICAgICAg + InN1YnZvbHVtZWdyb3VwIiwKICAgICAgICAgICAgImdldHBhdGgiLAogICAgICAgICAgICBjZXBo + ZnNfZmlsZXN5c3RlbV9uYW1lLAogICAgICAgICAgICBzdWJ2b2x1bWVfZ3JvdXAsCiAgICAgICAg + XQogICAgICAgIHRyeToKICAgICAgICAgICAgXyA9IHN1YnByb2Nlc3MuY2hlY2tfb3V0cHV0KGNt + ZCwgc3RkZXJyPXN1YnByb2Nlc3MuUElQRSkKICAgICAgICBleGNlcHQgc3VicHJvY2Vzcy5DYWxs + ZWRQcm9jZXNzRXJyb3I6CiAgICAgICAgICAgIGNtZCA9IFsKICAgICAgICAgICAgICAgICJjZXBo + IiwKICAgICAgICAgICAgICAgICJmcyIsCiAgICAgICAgICAgICAgICAic3Vidm9sdW1lZ3JvdXAi + LAogICAgICAgICAgICAgICAgImNyZWF0ZSIsCiAgICAgICAgICAgICAgICBjZXBoZnNfZmlsZXN5 + c3RlbV9uYW1lLAogICAgICAgICAgICAgICAgc3Vidm9sdW1lX2dyb3VwLAogICAgICAgICAgICBd + CiAgICAgICAgICAgIHRyeToKICAgICAgICAgICAgICAgIF8gPSBzdWJwcm9jZXNzLmNoZWNrX291 + dHB1dChjbWQsIHN0ZGVycj1zdWJwcm9jZXNzLlBJUEUpCiAgICAgICAgICAgIGV4Y2VwdCBzdWJw + cm9jZXNzLkNhbGxlZFByb2Nlc3NFcnJvcjoKICAgICAgICAgICAgICAgIHJhaXNlIEV4ZWN1dGlv + bkZhaWx1cmVFeGNlcHRpb24oCiAgICAgICAgICAgICAgICAgICAgZiJzdWJ2b2x1bWUgZ3JvdXAg + e3N1YnZvbHVtZV9ncm91cH0gaXMgbm90IGFibGUgdG8gZ2V0IGNyZWF0ZWQiCiAgICAgICAgICAg + ICAgICApCgogICAgZGVmIHBpbl9zdWJ2b2x1bWUoCiAgICAgICAgc2VsZiwgc3Vidm9sdW1lX2dy + b3VwLCBjZXBoZnNfZmlsZXN5c3RlbV9uYW1lLCBwaW5fdHlwZSwgcGluX3NldHRpbmcKICAgICk6 + CiAgICAgICAgY21kID0gWwogICAgICAgICAgICAiY2VwaCIsCiAgICAgICAgICAgICJmcyIsCiAg + ICAgICAgICAgICJzdWJ2b2x1bWVncm91cCIsCiAgICAgICAgICAgICJwaW4iLAogICAgICAgICAg + ICBjZXBoZnNfZmlsZXN5c3RlbV9uYW1lLAogICAgICAgICAgICBzdWJ2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+ IGF1dGg9UzNBdXRoKGFjY2Vzc19rZXksIHNlY3JldF9rZXksIHJnd19lbmRwb2ludCksCiAgICAg + ICAgICAgICAgICB2ZXJpZnk9dmVyaWZ5LAogICAgICAgICAgICApCiAgICAgICAgZXhjZXB0IHJl + cXVlc3RzLmV4Y2VwdGlvbnMuVGltZW91dDoKICAgICAgICAgICAgc3lzLnN0ZGVyci53cml0ZSgK + ICAgICAgICAgICAgICAgIGYiaW52YWxpZCBlbmRwb2ludDosIG5vdCBhYmxlIHRvIGNhbGwgYWRt + aW4tb3BzIGFwaXtyZ3dfZW5kcG9pbnR9IgogICAgICAgICAgICApCiAgICAgICAgICAgIHJldHVy + biAiIiwgIi0xIgogICAgICAgIHIxID0gci5qc29uKCkKICAgICAgICBpZiByMSBpcyBOb25lIG9y + IHIxLmdldCgiaW5mbyIpIGlzIE5vbmU6CiAgICAgICAgICAgIHN5cy5zdGRlcnIud3JpdGUoCiAg + ICAgICAgICAgICAgICBmIlRoZSBwcm92aWRlZCByZ3cgRW5kcG9pbnQsICd7c2VsZi5fYXJnX3Bh + cnNlci5yZ3dfZW5kcG9pbnR9JywgaXMgaW52YWxpZC4iCiAgICAgICAgICAgICkKICAgICAgICAg + ICAgcmV0dXJuICgKICAgICAgICAgICAgICAgICIiLAogICAgICAgICAgICAgICAgIi0xIiwKICAg + ICAgICAgICAgKQoKICAgICAgICByZXR1cm4gcjFbImluZm8iXVsic3RvcmFnZV9iYWNrZW5kcyJd + WzBdWyJjbHVzdGVyX2lkIl0sICIiCgogICAgZGVmIHZhbGlkYXRlX3Jnd19lbmRwb2ludChzZWxm + LCBpbmZvX2NhcF9zdXBwb3J0ZWQpOgogICAgICAgICMgaWYgdGhlICdjbHVzdGVyJyBpbnN0YW5j + ZSBpcyBhIGR1bW15IG9uZSwKICAgICAgICAjIGRvbid0IHRyeSB0byByZWFjaCBvdXQgdG8gdGhl + IGVuZHBvaW50CiAgICAgICAgaWYgaXNpbnN0YW5jZShzZWxmLmNsdXN0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AgICAgICAgIGlmIGVyciA9 + PSAiLTEiOgogICAgICAgICAgICAgICAgcmV0dXJuICItMSIKICAgICAgICAgICAgaWYgZnNpZCAh + PSByZ3dfZnNpZDoKICAgICAgICAgICAgICAgIHN5cy5zdGRlcnIud3JpdGUoCiAgICAgICAgICAg + ICAgICAgICAgZiJUaGUgcHJvdmlkZWQgcmd3IEVuZHBvaW50LCAne3NlbGYuX2FyZ19wYXJzZXIu + cmd3X2VuZHBvaW50fScsIGlzIGludmFsaWQuIFdlIGFyZSB2YWxpZGF0aW5nIGJ5IGNhbGxpbmcg + dGhlIGFkbWlub3BzIGFwaSB0aHJvdWdoIHJndy1lbmRwb2ludCBhbmQgdmFsaWRhdGluZyB0aGUg + Y2x1c3Rlcl9pZCAne3Jnd19mc2lkfScgaXMgZXF1YWwgdG8gdGhlIGNlcGggY2x1c3RlciBmc2lk + ICd7ZnNpZH0nIgogICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgcmV0dXJuICItMSIK + CiAgICAgICAgIyBjaGVjayBpZiB0aGUgcmd3IGVuZHBvaW50IHBvb2wgZXhpc3QKICAgICAgICAj + IG9ubHkgdmFsaWRhdGUgaWYgcmd3X3Bvb2xfcHJlZml4IGlzIHBhc3NlZCBlbHNlIGl0IHdpbGwg + dGFrZSBkZWZhdWx0IHZhbHVlIGFuZCB3ZSBkb24ndCBjcmVhdGUgdGhlc2UgZGVmYXVsdCBwb29s + cwogICAgICAgIGlmIHNlbGYuX2FyZ19wYXJzZXIucmd3X3Bvb2xfcHJlZml4ICE9ICJkZWZhdWx0 + IjoKICAgICAgICAgICAgcmd3X3Bvb2xzX3RvX3ZhbGlkYXRlID0gWwogICAgICAgICAgICAgICAg + ZiJ7c2VsZi5fYXJnX3BhcnNlci5yZ3dfcG9vbF9wcmVmaXh9LnJndy5tZXRhIiwKICAgICAgICAg + ICAgICAgICIucmd3LnJvb3QiLAogICAgICAgICAgICAgICAgZiJ7c2VsZi5fYXJnX3BhcnNlci5y + Z3dfcG9vbF9wcmVmaXh9LnJndy5jb250cm9sIiwKICAgICAgICAgICAgICAgIGYie3NlbGYuX2Fy + Z19wYXJzZXIucmd3X3Bvb2xfcHJlZml4fS5yZ3cubG9nIiwKICAgICAgICAgICAgXQogICAgICAg + ICAgICBmb3IgX3Jnd19wb29sX3RvX3ZhbGlkYXRlIGluIHJnd19wb29sc190b192YWxpZGF0ZToK + ICAgICAgICAgICAgICAgIGlmIG5vdCBzZWxmLmNsdXN0ZXIucG9vbF9leGlzdHMoX3Jnd19wb29s + X3RvX3ZhbGlkYXRlKToKICAgICAgICAgICAgICAgICAgICBzeXMuc3RkZXJyLndyaXRlKAogICAg + ICAgICAgICAgICAgICAgICAgICBmIlRoZSBwcm92aWRlZCBwb29sLCAne19yZ3dfcG9vbF90b192 + YWxpZGF0ZX0nLCBkb2VzIG5vdCBleGlzdCIKICAgICAgICAgICAgICAgICAgICApCiAgICAgICAg + ICAgICAgICAgICAgcmV0dXJuICItMSIKCiAgICAgICAgcmV0dXJuICIiCgogICAgZGVmIHZhbGlk + YXRlX3Jnd19tdWx0aXNpdGUoc2VsZiwgcmd3X211bHRpc2l0ZV9jb25maWdfbmFtZSwgcmd3X211 + bHRpc2l0ZV9jb25maWcpOgogICAgICAgIGlmIHJnd19tdWx0aXNpdGVfY29uZmlnICE9ICIiOgog + ICAgICAgICAgICBjbWQgPSBbCiAgICAgICAgICAgICAgICAicmFkb3Nndy1hZG1pbiIsCiAgICAg + ICAgICAgICAgICByZ3dfbXVsdGlzaXRlX2NvbmZpZywKICAgICAgICAgICAgICAgICJnZXQiLAog + ICAgICAgICAgICAgICAgIi0tcmd3LSIgKyByZ3dfbXVsdGlzaXRlX2NvbmZpZywKICAgICAgICAg + ICAgICAgIHJnd19tdWx0aXNpdGVfY29uZmlnX25hbWUsCiAgICAgICAgICAgIF0KICAgICAgICAg + ICAgdHJ5OgogICAgICAgICAgICAgICAgXyA9IHN1YnByb2Nlc3MuY2hlY2tfb3V0cHV0KGNtZCwg + c3RkZXJyPXN1YnByb2Nlc3MuUElQRSkKICAgICAgICAgICAgZXhjZXB0IHN1YnByb2Nlc3MuQ2Fs + bGVkUHJvY2Vzc0Vycm9yIGFzIGV4ZWNFcnI6CiAgICAgICAgICAgICAgICBlcnJfbXNnID0gKAog + ICAgICAgICAgICAgICAgICAgIGYiZmFpbGVkIHRvIGV4ZWN1dGUgY29tbWFuZCB7Y21kfS4gT3V0 + cHV0OiB7ZXhlY0Vyci5vdXRwdXR9LiAiCiAgICAgICAgICAgICAgICAgICAgZiJDb2RlOiB7ZXhl + Y0Vyci5yZXR1cm5jb2RlfS4gRXJyb3I6IHtleGVjRXJyLnN0ZGVycn0iCiAgICAgICAgICAgICAg + ICApCiAgICAgICAgICAgICAgICBzeXMuc3RkZXJyLndyaXRlKGVycl9tc2cpCiAgICAgICAgICAg + ICAgICByZXR1cm4gIi0xIgogICAgICAgIHJldHVybiAiIgoKICAgIGRlZiBjb252ZXJ0X2NvbW1h + X3NlcGFyYXRlZF90b19hcnJheShzZWxmLCB2YWx1ZSk6CiAgICAgICAgcmV0dXJuIHZhbHVlLnNw + bGl0KCIsIikKCiAgICBkZWYgcmFpc2VfZXhjZXB0aW9uX2lmX2FueV90b3BvbG9neV9mbGFnX2lz + X21pc3Npbmcoc2VsZik6CiAgICAgICAgaWYgKAogICAgICAgICAgICAoCiAgICAgICAgICAgICAg + ICBzZWxmLl9hcmdfcGFyc2VyLnRvcG9sb2d5X3Bvb2xzICE9ICIiCiAgICAgICAgICAgICAgICBh + bmQgKAogICAgICAgICAgICAgICAgICAgIHNlbGYuX2FyZ19wYXJzZXIudG9wb2xvZ3lfZmFpbHVy + ZV9kb21haW5fbGFiZWwgPT0gIiIKICAgICAgICAgICAgICAgICAgICBvciBzZWxmLl9hcmdfcGFy + c2VyLnRvcG9sb2d5X2ZhaWx1cmVfZG9tYWluX3ZhbHVlcyA9PSAiIgogICAgICAgICAgICAgICAg + KQogICAgICAgICAgICApCiAgICAgICAgICAgIG9yICgKICAgICAgICAgICAgICAgIHNlbGYuX2Fy + Z19wYXJzZXIudG9wb2xvZ3lfZmFpbHVyZV9kb21haW5fbGFiZWwgIT0gIiIKICAgICAgICAgICAg + ICAgIGFuZCAoCiAgICAgICAgICAgICAgICAgICAgc2VsZi5fYXJnX3BhcnNlci50b3BvbG9neV9w + b29scyA9PSAiIgogICAgICAgICAgICAgICAgICAgIG9yIHNlbGYuX2FyZ19wYXJzZXIudG9wb2xv + Z3lfZmFpbHVyZV9kb21haW5fdmFsdWVzID09ICIiCiAgICAgICAgICAgICAgICApCiAgICAgICAg + ICAgICkKICAgICAgICAgICAgb3IgKAogICAgICAgICAgICAgICAgc2VsZi5fYXJnX3BhcnNlci50 + b3BvbG9neV9mYWlsdXJlX2RvbWFpbl92YWx1ZXMgIT0gIiIKICAgICAgICAgICAgICAgIGFuZCAo + CiAgICAgICAgICAgICAgICAgICAgc2VsZi5fYXJnX3BhcnNlci50b3BvbG9neV9wb29scyA9PSAi + IgogICAgICAgICAgICAgICAgICAgIG9yIHNlbGYuX2FyZ19wYXJzZXIudG9wb2xvZ3lfZmFpbHVy + ZV9kb21haW5fbGFiZWwgPT0gIiIKICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgKQogICAg + ICAgICk6CiAgICAgICAgICAgIHJhaXNlIEV4ZWN1dGlvbkZhaWx1cmVFeGNlcHRpb24oCiAgICAg + ICAgICAgICAgICAicHJvdmlkZSBhbGwgdGhlIHRvcG9sb2d5IGZsYWdzIC0tdG9wb2xvZ3ktcG9v + bHMsIC0tdG9wb2xvZ3ktZmFpbHVyZS1kb21haW4tbGFiZWwsIC0tdG9wb2xvZ3ktZmFpbHVyZS1k + b21haW4tdmFsdWVzIgogICAgICAgICAgICApCgogICAgZGVmIHZhbGlkYXRlX3RvcG9sb2d5X3Zh + bHVlcyhzZWxmLCB0b3BvbG9neV9wb29scywgdG9wb2xvZ3lfZmQpOgogICAgICAgIGlmIGxlbih0 + b3BvbG9neV9wb29scykgIT0gbGVuKHRvcG9sb2d5X2ZkKToKICAgICAgICAgICAgcmFpc2UgRXhl + Y3V0aW9uRmFpbHVyZUV4Y2VwdGlvbigKICAgICAgICAgICAgICAgIGYiVGhlIHByb3ZpZGVkIHRv + cG9sb2d5IHBvb2xzLCAne3RvcG9sb2d5X3Bvb2xzfScsIGFuZCAiCiAgICAgICAgICAgICAgICBm + InRvcG9sb2d5IGZhaWx1cmUgZG9tYWluLCAne3RvcG9sb2d5X2ZkfScsIgogICAgICAgICAgICAg + ICAgZiJhcmUgb2YgZGlmZmVyZW50IGxlbmd0aCwgJ3tsZW4odG9wb2xvZ3lfcG9vbHMpfScgYW5k + ICd7bGVuKHRvcG9sb2d5X2ZkKX0nIHJlc3BjdGl2ZWx5IgogICAgICAgICAgICApCiAgICAgICAg + cmV0dXJuCgogICAgZGVmIHZhbGlkYXRlX3RvcG9sb2d5X3JiZF9wb29scyhzZWxmLCB0b3BvbG9n + eV9yYmRfcG9vbHMpOgogICAgICAgIGZvciBwb29sIGluIHRvcG9sb2d5X3JiZF9wb29sczoKICAg + ICAgICAgICAgc2VsZi52YWxpZGF0ZV9yYmRfcG9vbChwb29sKQoKICAgIGRlZiBpbml0X3RvcG9s + b2d5X3JiZF9wb29scyhzZWxmLCB0b3BvbG9neV9yYmRfcG9vbHMpOgogICAgICAgIGZvciBwb29s + IGluIHRvcG9sb2d5X3JiZF9wb29sczoKICAgICAgICAgICAgc2VsZi5pbml0X3JiZF9wb29sKHBv + b2wpCgogICAgZGVmIF9nZW5fb3V0cHV0X21hcChzZWxmKToKICAgICAgICBpZiBzZWxmLm91dF9t + YXA6CiAgICAgICAgICAgIHJldHVybgogICAgICAgICMgc3VwcG9ydCBsZWdhY3kgZmxhZyB3aXRo + IHVwZ3JhZGVzCiAgICAgICAgaWYgc2VsZi5fYXJnX3BhcnNlci5jbHVzdGVyX25hbWU6CiAgICAg + ICAgICAgIHNlbGYuX2FyZ19wYXJzZXIuazhzX2NsdXN0ZXJfbmFtZSA9IHNlb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mcy1ub2RlIikKICAgICAgICAgICAgKAogICAgICAgICAgICAgICAgc2VsZi5v + dXRfbWFwWyJDU0lfQ0VQSEZTX1BST1ZJU0lPTkVSX1NFQ1JFVCJdLAogICAgICAgICAgICAgICAg c2VsZi5vdXRfbWFwWyJDU0lfQ0VQSEZTX1BST1ZJU0lPTkVSX1NFQ1JFVF9OQU1FIl0sCiAgICAg - ICAgICAgICAgICAgICAgICAgICJhZG1pbktleSI6IHNlbGYub3V0X21hcFsiQ1NJX0NFUEhGU19Q - Uk9WSVNJT05FUl9TRUNSRVQiXSwKICAgICAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICAg - ICAgfQogICAgICAgICAgICApCiAgICAgICAgIyBpZiAnQ1NJX0NFUEhGU19OT0RFX1NFQ1JFVCcg - ZXhpc3RzLCB0aGVuIG9ubHkgYWRkICdyb29rLWNzaS1jZXBoZnMtbm9kZScgU2VjcmV0CiAgICAg - ICAgaWYgKAogICAgICAgICAgICBzZWxmLm91dF9tYXBbIkNTSV9DRVBIRlNfTk9ERV9TRUNSRVQi - XQogICAgICAgICAgICBhbmQgc2VsZi5vdXRfbWFwWyJDU0lfQ0VQSEZTX05PREVfU0VDUkVUX05B - TUUiXQogICAgICAgICk6CiAgICAgICAgICAgIGpzb25fb3V0LmFwcGVuZCgKICAgICAgICAgICAg - ICAgIHsKICAgICAgICAgICAgICAgICAgICAibmFtZSI6IGYicm9vay17c2VsZi5vdXRfbWFwWydD - U0lfQ0VQSEZTX05PREVfU0VDUkVUX05BTUUnXX0iLAogICAgICAgICAgICAgICAgICAgICJraW5k - IjogIlNlY3JldCIsCiAgICAgICAgICAgICAgICAgICAgImRhdGEiOiB7CiAgICAgICAgICAgICAg - ICAgICAgICAgICJhZG1pbklEIjogc2VsZi5vdXRfbWFwWyJDU0lfQ0VQSEZTX05PREVfU0VDUkVU - X05BTUUiXSwKICAgICAgICAgICAgICAgICAgICAgICAgImFkbWluS2V5Ijogc2VsZi5vdXRfbWFw - WyJDU0lfQ0VQSEZTX05PREVfU0VDUkVUIl0sCiAgICAgICAgICAgICAgICAgICAgfSwKICAgICAg - ICAgICAgICAgIH0KICAgICAgICAgICAgKQogICAgICAgICMgaWYgJ1JPT0tfRVhURVJOQUxfREFT - SEJPQVJEX0xJTksnIGV4aXN0cywgdGhlbiBvbmx5IGFkZCAncm9vay1jZXBoLWRhc2hib2FyZC1s - aW5rJyBTZWNyZXQKICAgICAgICBpZiBzZWxmLm91dF9tYXBbIlJPT0tfRVhURVJOQUxfREFTSEJP - QVJEX0xJTksiXToKICAgICAgICAgICAganNvbl9vdXQuYXBwZW5kKAogICAgICAgICAgICAgICAg - ewogICAgICAgICAgICAgICAgICAgICJuYW1lIjogInJvb2stY2VwaC1kYXNoYm9hcmQtbGluayIs - CiAgICAgICAgICAgICAgICAgICAgImtpbmQiOiAiU2VjcmV0IiwKICAgICAgICAgICAgICAgICAg - ICAiZGF0YSI6IHsKICAgICAgICAgICAgICAgICAgICAgICAgInVzZXJJRCI6ICJjZXBoLWRhc2hi - b2FyZC1saW5rIiwKICAgICAgICAgICAgICAgICAgICAgICAgInVzZXJLZXkiOiBzZWxmLm91dF9t - YXBbIlJPT0tfRVhURVJOQUxfREFTSEJPQVJEX0xJTksiXSwKICAgICAgICAgICAgICAgICAgICB9 - LAogICAgICAgICAgICAgICAgfQogICAgICAgICAgICApCiAgICAgICAgIyBpZiAnUkFET1NfTkFN - RVNQQUNFJyBleGlzdHMsIHRoZW4gb25seSBhZGQgdGhlICJSQURPU19OQU1FU1BBQ0UiIG5hbWVz - cGFjZQogICAgICAgIGlmICgKICAgICAgICAgICAgc2VsZi5vdXRfbWFwWyJSQURPU19OQU1FU1BB - Q0UiXQogICAgICAgICAgICBhbmQgc2VsZi5vdXRfbWFwWyJSRVNUUklDVEVEX0FVVEhfUEVSTUlT - U0lPTiJdCiAgICAgICAgICAgIGFuZCBub3Qgc2VsZi5vdXRfbWFwWyJSQkRfTUVUQURBVEFfRUNf - UE9PTF9OQU1FIl0KICAgICAgICApOgogICAgICAgICAgICBqc29uX291dC5hcHBlbmQoCiAgICAg - ICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgIm5hbWUiOiAicmFkb3MtbmFtZXNwYWNl - IiwKICAgICAgICAgICAgICAgICAgICAia2luZCI6ICJDZXBoQmxvY2tQb29sUmFkb3NOYW1lc3Bh - Y2UiLAogICAgICAgICAgICAgICAgICAgICJkYXRhIjogewogICAgICAgICAgICAgICAgICAgICAg - ICAicmFkb3NOYW1lc3BhY2VOYW1lIjogc2VsZi5vdXRfbWFwWyJSQURPU19OQU1FU1BBQ0UiXSwK - ICAgICAgICAgICAgICAgICAgICAgICAgInBvb2wiOiBzZWxmLm91dF9tYXBbIlJCRF9QT09MX05B - TUUiXSwKICAgICAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICAgICAgfQogICAgICAgICAg - ICApCiAgICAgICAgICAgIGpzb25fb3V0LmFwcGVuZCgKICAgICAgICAgICAgICAgIHsKICAgICAg - ICAgICAgICAgICAgICAibmFtZSI6ICJjZXBoLXJiZC1yYWRvcy1uYW1lc3BhY2UiLAogICAgICAg - ICAgICAgICAgICAgICJraW5kIjogIlN0b3JhZ2VDbGFzcyIsCiAgICAgICAgICAgICAgICAgICAg - ImRhdGEiOiB7CiAgICAgICAgICAgICAgICAgICAgICAgICJwb29sIjogc2VsZi5vdXRfbWFwWyJS - QkRfUE9PTF9OQU1FIl0sCiAgICAgICAgICAgICAgICAgICAgICAgICJjc2kuc3RvcmFnZS5rOHMu - aW8vcHJvdmlzaW9uZXItc2VjcmV0LW5hbWUiOiBmInJvb2ste3NlbGYub3V0X21hcFsnQ1NJX1JC - RF9QUk9WSVNJT05FUl9TRUNSRVRfTkFNRSddfSIsCiAgICAgICAgICAgICAgICAgICAgICAgICJj - c2kuc3RvcmFnZS5rOHMuaW8vY29udHJvbGxlci1leHBhbmQtc2VjcmV0LW5hbWUiOiBmInJvb2st - e3NlbGYub3V0X21hcFsnQ1NJX1JCRF9QUk9WSVNJT05FUl9TRUNSRVRfTkFNRSddfSIsCiAgICAg - ICAgICAgICAgICAgICAgICAgICJjc2kuc3RvcmFnZS5rOHMuaW8vbm9kZS1zdGFnZS1zZWNyZXQt - bmFtZSI6IGYicm9vay17c2VsZi5vdXRfbWFwWydDU0lfUkJEX05PREVfU0VDUkVUX05BTUUnXX0i - LAogICAgICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICkK - ICAgICAgICBlbHNlOgogICAgICAgICAgICBpZiBzZWxmLm91dF9tYXBbIlJCRF9NRVRBREFUQV9F - Q19QT09MX05BTUUiXToKICAgICAgICAgICAgICAgIGpzb25fb3V0LmFwcGVuZCgKICAgICAgICAg - ICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgICAgICJuYW1lIjogImNlcGgtcmJkIiwK - ICAgICAgICAgICAgICAgICAgICAgICAgImtpbmQiOiAiU3RvcmFnZUNsYXNzIiwKICAgICAgICAg - ICAgICAgICAgICAgICAgImRhdGEiOiB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZGF0 - YVBvb2wiOiBzZWxmLm91dF9tYXBbIlJCRF9QT09MX05BTUUiXSwKICAgICAgICAgICAgICAgICAg - ICAgICAgICAgICJwb29sIjogc2VsZi5vdXRfbWFwWyJSQkRfTUVUQURBVEFfRUNfUE9PTF9OQU1F - Il0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAiY3NpLnN0b3JhZ2UuazhzLmlvL3Byb3Zp - c2lvbmVyLXNlY3JldC1uYW1lIjogZiJyb29rLXtzZWxmLm91dF9tYXBbJ0NTSV9SQkRfUFJPVklT - SU9ORVJfU0VDUkVUX05BTUUnXX0iLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgImNzaS5z - dG9yYWdlLms4cy5pby9jb250cm9sbGVyLWV4cGFuZC1zZWNyZXQtbmFtZSI6IGYicm9vay17c2Vs - Zi5vdXRfbWFwWydDU0lfUkJEX1BST1ZJU0lPTkVSX1NFQ1JFVF9OQU1FJ119IiwKICAgICAgICAg - ICAgICAgICAgICAgICAgICAgICJjc2kuc3RvcmFnZS5rOHMuaW8vbm9kZS1zdGFnZS1zZWNyZXQt - bmFtZSI6IGYicm9vay17c2VsZi5vdXRfbWFwWydDU0lfUkJEX05PREVfU0VDUkVUX05BTUUnXX0i - LAogICAgICAgICAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICAgICAgICAgIH0KICAgICAg - ICAgICAgICAgICkKICAgICAgICAgICAgZWxzZToKICAgICAgICAgICAgICAgIGpzb25fb3V0LmFw - cGVuZCgKICAgICAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgICAgICJuYW1l - IjogImNlcGgtcmJkIiwKICAgICAgICAgICAgICAgICAgICAgICAgImtpbmQiOiAiU3RvcmFnZUNs - YXNzIiwKICAgICAgICAgICAgICAgICAgICAgICAgImRhdGEiOiB7CiAgICAgICAgICAgICAgICAg - ICAgICAgICAgICAicG9vbCI6IHNlbGYub3V0X21hcFsiUkJEX1BPT0xfTkFNRSJdLAogICAgICAg - ICAgICAgICAgICAgICAgICAgICAgImNzaS5zdG9yYWdlLms4cy5pby9wcm92aXNpb25lci1zZWNy - ZXQtbmFtZSI6IGYicm9vay17c2VsZi5vdXRfbWFwWydDU0lfUkJEX1BST1ZJU0lPTkVSX1NFQ1JF - VF9OQU1FJ119IiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICJjc2kuc3RvcmFnZS5rOHMu - aW8vY29udHJvbGxlci1leHBhbmQtc2VjcmV0LW5hbWUiOiBmInJvb2ste3NlbGYub3V0X21hcFsn - Q1NJX1JCRF9QUk9WSVNJT05FUl9TRUNSRVRfTkFNRSddfSIsCiAgICAgICAgICAgICAgICAgICAg - ICAgICAgICAiY3NpLnN0b3JhZ2UuazhzLmlvL25vZGUtc3RhZ2Utc2VjcmV0LW5hbWUiOiBmInJv - b2ste3NlbGYub3V0X21hcFsnQ1NJX1JCRF9OT0RFX1NFQ1JFVF9OQU1FJ119IiwKICAgICAgICAg - ICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAp - CgogICAgICAgICMgaWYgJ1RPUE9MT0dZX1BPT0xTJywgJ1RPUE9MT0dZX0ZBSUxVUkVfRE9NQUlO - X0xBQkVMJywgJ1RPUE9MT0dZX0ZBSUxVUkVfRE9NQUlOX1ZBTFVFUycgIGV4aXN0cywKICAgICAg - ICAjIHRoZW4gb25seSBhZGQgJ3RvcG9sb2d5JyBTdG9yYWdlQ2xhc3MKICAgICAgICBpZiAoCiAg - ICAgICAgICAgIHNlbGYub3V0X21hcFsiVE9QT0xPR1lfUE9PTFMiXQogICAgICAgICAgICBhbmQg - c2VsZi5vdXRfbWFwWyJUT1BPTE9HWV9GQUlMVVJFX0RPTUFJTl9MQUJFTCJdCiAgICAgICAgICAg - IGFuZCBzZWxmLm91dF9tYXBbIlRPUE9MT0dZX0ZBSUxVUkVfRE9NQUlOX1ZBTFVFUyJdCiAgICAg - ICAgKToKICAgICAgICAgICAganNvbl9vdXQuYXBwZW5kKAogICAgICAgICAgICAgICAgewogICAg - ICAgICAgICAgICAgICAgICJuYW1lIjogImNlcGgtcmJkLXRvcG9sb2d5IiwKICAgICAgICAgICAg - ICAgICAgICAia2luZCI6ICJTdG9yYWdlQ2xhc3MiLAogICAgICAgICAgICAgICAgICAgICJkYXRh - IjogewogICAgICAgICAgICAgICAgICAgICAgICAidG9wb2xvZ3lGYWlsdXJlRG9tYWluTGFiZWwi - OiBzZWxmLm91dF9tYXBbCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAiVE9QT0xPR1lfRkFJ - TFVSRV9ET01BSU5fTEFCRUwiCiAgICAgICAgICAgICAgICAgICAgICAgIF0sCiAgICAgICAgICAg - ICAgICAgICAgICAgICJ0b3BvbG9neUZhaWx1cmVEb21haW5WYWx1ZXMiOiBzZWxmLm91dF9tYXBb - CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAiVE9QT0xPR1lfRkFJTFVSRV9ET01BSU5fVkFM - VUVTIgogICAgICAgICAgICAgICAgICAgICAgICBdLAogICAgICAgICAgICAgICAgICAgICAgICAi - dG9wb2xvZ3lQb29scyI6IHNlbGYub3V0X21hcFsiVE9QT0xPR1lfUE9PTFMiXSwKICAgICAgICAg - ICAgICAgICAgICAgICAgImNzaS5zdG9yYWdlLms4cy5pby9wcm92aXNpb25lci1zZWNyZXQtbmFt - ZSI6IGYicm9vay17c2VsZi5vdXRfbWFwWydDU0lfUkJEX1BST1ZJU0lPTkVSX1NFQ1JFVF9OQU1F + ICAgICAgICkgPSBzZWxmLmNyZWF0ZV9jZXBoQ1NJS2V5cmluZ191c2VyKCJjbGllbnQuY3NpLWNl + cGhmcy1wcm92aXNpb25lciIpCiAgICAgICAgICAgICMgY3JlYXRlIHRoZSBkZWZhdWx0ICJjc2ki + IHN1YnZvbHVtZWdyb3VwCiAgICAgICAgICAgIHNlbGYuZ2V0X29yX2NyZWF0ZV9zdWJ2b2x1bWVf + Z3JvdXAoCiAgICAgICAgICAgICAgICAiY3NpIiwgc2VsZi5fYXJnX3BhcnNlci5jZXBoZnNfZmls + ZXN5c3RlbV9uYW1lCiAgICAgICAgICAgICkKICAgICAgICAgICAgIyBwaW4gdGhlIGRlZmF1bHQg + ImNzaSIgc3Vidm9sdW1lZ3JvdXAKICAgICAgICAgICAgc2VsZi5waW5fc3Vidm9sdW1lKAogICAg + ICAgICAgICAgICAgImNzaSIsIHNlbGYuX2FyZ19wYXJzZXIuY2VwaGZzX2ZpbGVzeXN0ZW1fbmFt + ZSwgImRpc3RyaWJ1dGVkIiwgIjEiCiAgICAgICAgICAgICkKICAgICAgICAgICAgaWYgc2VsZi5v + dXRfbWFwWyJTVUJWT0xVTUVfR1JPVVAiXToKICAgICAgICAgICAgICAgIHNlbGYuZ2V0X29yX2Ny + ZWF0ZV9zdWJ2b2x1bWVfZ3JvdXAoCiAgICAgICAgICAgICAgICAgICAgc2VsZi5fYXJnX3BhcnNl + ci5zdWJ2b2x1bWVfZ3JvdXAsCiAgICAgICAgICAgICAgICAgICAgc2VsZi5fYXJnX3BhcnNlci5j + ZXBoZnNfZmlsZXN5c3RlbV9uYW1lLAogICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAg + c2VsZi5waW5fc3Vidm9sdW1lKAogICAgICAgICAgICAgICAgICAgIHNlbGYuX2FyZ19wYXJzZXIu + c3Vidm9sdW1lX2dyb3VwLAogICAgICAgICAgICAgICAgICAgIHNlbGYuX2FyZ19wYXJzZXIuY2Vw + aGZzX2ZpbGVzeXN0ZW1fbmFtZSwKICAgICAgICAgICAgICAgICAgICAiZGlzdHJpYnV0ZWQiLAog + ICAgICAgICAgICAgICAgICAgICIxIiwKICAgICAgICAgICAgICAgICkKICAgICAgICBzZWxmLm91 + dF9tYXBbIlJHV19UTFNfQ0VSVCJdID0gIiIKICAgICAgICBzZWxmLm91dF9tYXBbIk1PTklUT1JJ + TkdfRU5EUE9JTlQiXSA9ICIiCiAgICAgICAgc2VsZi5vdXRfbWFwWyJNT05JVE9SSU5HX0VORFBP + SU5UX1BPUlQiXSA9ICIiCiAgICAgICAgaWYgbm90IHNlbGYuX2FyZ19wYXJzZXIuc2tpcF9tb25p + dG9yaW5nX2VuZHBvaW50OgogICAgICAgICAgICAoCiAgICAgICAgICAgICAgICBzZWxmLm91dF9t + YXBbIk1PTklUT1JJTkdfRU5EUE9JTlQiXSwKICAgICAgICAgICAgICAgIHNlbGYub3V0X21hcFsi + TU9OSVRPUklOR19FTkRQT0lOVF9QT1JUIl0sCiAgICAgICAgICAgICkgPSBzZWxmLmdldF9hY3Rp + dmVfYW5kX3N0YW5kYnlfbWdycygpCiAgICAgICAgc2VsZi5vdXRfbWFwWyJSQkRfUE9PTF9OQU1F + Il0gPSBzZWxmLl9hcmdfcGFyc2VyLnJiZF9kYXRhX3Bvb2xfbmFtZQogICAgICAgIHNlbGYub3V0 + X21hcFsiUkJEX01FVEFEQVRBX0VDX1BPT0xfTkFNRSJdID0gKAogICAgICAgICAgICBzZWxmLnZh + bGlkYXRlX3JiZF9tZXRhZGF0YV9lY19wb29sX25hbWUoKQogICAgICAgICkKICAgICAgICBzZWxm + Lm91dF9tYXBbIlRPUE9MT0dZX1BPT0xTIl0gPSBzZWxmLl9hcmdfcGFyc2VyLnRvcG9sb2d5X3Bv + b2xzCiAgICAgICAgc2VsZi5vdXRfbWFwWyJUT1BPTE9HWV9GQUlMVVJFX0RPTUFJTl9MQUJFTCJd + ID0gKAogICAgICAgICAgICBzZWxmLl9hcmdfcGFyc2VyLnRvcG9sb2d5X2ZhaWx1cmVfZG9tYWlu + X2xhYmVsCiAgICAgICAgKQogICAgICAgIHNlbGYub3V0X21hcFsiVE9QT0xPR1lfRkFJTFVSRV9E + T01BSU5fVkFMVUVTIl0gPSAoCiAgICAgICAgICAgIHNlbGYuX2FyZ19wYXJzZXIudG9wb2xvZ3lf + ZmFpbHVyZV9kb21haW5fdmFsdWVzCiAgICAgICAgKQogICAgICAgIGlmICgKICAgICAgICAgICAg + c2VsZi5fYXJnX3BhcnNlci50b3BvbG9neV9wb29scyAhPSAiIgogICAgICAgICAgICBhbmQgc2Vs + Zi5fYXJnX3BhcnNlci50b3BvbG9neV9mYWlsdXJlX2RvbWFpbl9sYWJlbCAhPSAiIgogICAgICAg + ICAgICBhbmQgc2VsZi5fYXJnX3BhcnNlci50b3BvbG9neV9mYWlsdXJlX2RvbWFpbl92YWx1ZXMg + IT0gIiIKICAgICAgICApOgogICAgICAgICAgICBzZWxmLnZhbGlkYXRlX3RvcG9sb2d5X3ZhbHVl + cygKICAgICAgICAgICAgICAgIHNlbGYuY29udmVydF9jb21tYV9zZXBhcmF0ZWRfdG9fYXJyYXko + c2VsZi5vdXRfbWFwWyJUT1BPTE9HWV9QT09MUyJdKSwKICAgICAgICAgICAgICAgIHNlbGYuY29u + dmVydF9jb21tYV9zZXBhcmF0ZWRfdG9fYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgc2VsZi5v + dXRfbWFwWyJUT1BPTE9HWV9GQUlMVVJFX0RPTUFJTl9WQUxVRVMiXQogICAgICAgICAgICAgICAg + KSwKICAgICAgICAgICAgKQogICAgICAgICAgICBzZWxmLnZhbGlkYXRlX3RvcG9sb2d5X3JiZF9w + b29scygKICAgICAgICAgICAgICAgIHNlbGYuY29udmVydF9jb21tYV9zZXBhcmF0ZWRfdG9fYXJy + YXkoc2VsZi5vdXRfbWFwWyJUT1BPTE9HWV9QT09MUyJdKQogICAgICAgICAgICApCiAgICAgICAg + ICAgIHNlbGYuaW5pdF90b3BvbG9neV9yYmRfcG9vbHMoCiAgICAgICAgICAgICAgICBzZWxmLmNv + bnZlcnRfY29tbWFfc2VwYXJhdGVkX3RvX2FycmF5KHNlbGYub3V0X21hcFsiVE9QT0xPR1lfUE9P + TFMiXSkKICAgICAgICAgICAgKQogICAgICAgIGVsc2U6CiAgICAgICAgICAgIHNlbGYucmFpc2Vf + ZXhjZXB0aW9uX2lmX2FueV90b3BvbG9neV9mbGFnX2lzX21pc3NpbmcoKQoKICAgICAgICBzZWxm + Lm91dF9tYXBbIlJHV19QT09MX1BSRUZJWCJdID0gc2VsZi5fYXJnX3BhcnNlci5yZ3dfcG9vbF9w + cmVmaXgKICAgICAgICBzZWxmLm91dF9tYXBbIlJHV19FTkRQT0lOVCJdID0gIiIKICAgICAgICBp + ZiBzZWxmLl9hcmdfcGFyc2VyLnJnd19lbmRwb2ludDoKICAgICAgICAgICAgaWYgc2VsZi5fYXJn + X3BhcnNlci5kcnlfcnVuOgogICAgICAgICAgICAgICAgc2VsZi5jcmVhdGVfcmd3X2FkbWluX29w + c191c2VyKCkKICAgICAgICAgICAgZWxzZToKICAgICAgICAgICAgICAgIGlmICgKICAgICAgICAg + ICAgICAgICAgICBzZWxmLl9hcmdfcGFyc2VyLnJnd19yZWFsbV9uYW1lICE9ICIiCiAgICAgICAg + ICAgICAgICAgICAgYW5kIHNlbGYuX2FyZ19wYXJzZXIucmd3X3pvbmVncm91cF9uYW1lICE9ICIi + CiAgICAgICAgICAgICAgICAgICAgYW5kIHNlbGYuX2FyZ19wYXJzZXIucmd3X3pvbmVfbmFtZSAh + PSAiIgogICAgICAgICAgICAgICAgKToKICAgICAgICAgICAgICAgICAgICBlcnIgPSBzZWxmLnZh + bGlkYXRlX3Jnd19tdWx0aXNpdGUoCiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuX2FyZ19w + YXJzZXIucmd3X3JlYWxtX25hbWUsICJyZWFsbSIKICAgICAgICAgICAgICAgICAgICApCiAgICAg + ICAgICAgICAgICAgICAgZXJyID0gc2VsZi52YWxpZGF0ZV9yZ3dfbXVsdGlzaXRlKAogICAgICAg + ICAgICAgICAgICAgICAgICBzZWxmLl9hcmdfcGFyc2VyLnJnd196b25lZ3JvdXBfbmFtZSwgInpv + bmVncm91cCIKICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICAgICAgZXJyID0g + c2VsZi52YWxpZGF0ZV9yZ3dfbXVsdGlzaXRlKAogICAgICAgICAgICAgICAgICAgICAgICBzZWxm + Ll9hcmdfcGFyc2VyLnJnd196b25lX25hbWUsICJ6b25lIgogICAgICAgICAgICAgICAgICAgICkK + CiAgICAgICAgICAgICAgICBpZiAoCiAgICAgICAgICAgICAgICAgICAgc2VsZi5fYXJnX3BhcnNl + ci5yZ3dfcmVhbG1fbmFtZSA9PSAiIgogICAgICAgICAgICAgICAgICAgIGFuZCBzZWxmLl9hcmdf + cGFyc2VyLnJnd196b25lZ3JvdXBfbmFtZSA9PSAiIgogICAgICAgICAgICAgICAgICAgIGFuZCBz + ZWxmLl9hcmdfcGFyc2VyLnJnd196b25lX25hbWUgPT0gIiIKICAgICAgICAgICAgICAgICkgb3Ig + KAogICAgICAgICAgICAgICAgICAgIHNlbGYuX2FyZ19wYXJzZXIucmd3X3JlYWxtX25hbWUgIT0g + IiIKICAgICAgICAgICAgICAgICAgICBhbmQgc2VsZi5fYXJnX3BhcnNlci5yZ3dfem9uZWdyb3Vw + X25hbWUgIT0gIiIKICAgICAgICAgICAgICAgICAgICBhbmQgc2VsZi5fYXJnX3BhcnNlci5yZ3df + em9uZV9uYW1lICE9ICIiCiAgICAgICAgICAgICAgICApOgogICAgICAgICAgICAgICAgICAgICgK + ICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5vdXRfbWFwWyJSR1dfQURNSU5fT1BTX1VTRVJf + QUNDRVNTX0tFWSJdLAogICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm91dF9tYXBbIlJHV19B + RE1JTl9PUFNfVVNFUl9TRUNSRVRfS0VZIl0sCiAgICAgICAgICAgICAgICAgICAgICAgIGluZm9f + Y2FwX3N1cHBvcnRlZCwKICAgICAgICAgICAgICAgICAgICAgICAgZXJyLAogICAgICAgICAgICAg + ICAgICAgICkgPSBzZWxmLmNyZWF0ZV9yZ3dfYWRtaW5fb3BzX3VzZXIoKQogICAgICAgICAgICAg + ICAgICAgIGVyciA9IHNlbGYudmFsaWRhdGVfcmd3X2VuZHBvaW50KGluZm9fY2FwX3N1cHBvcnRl + ZCkKICAgICAgICAgICAgICAgICAgICBpZiBzZWxmLl9hcmdfcGFyc2VyLnJnd190bHNfY2VydF9w + YXRoOgogICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm91dF9tYXBbIlJHV19UTFNfQ0VSVCJd + ID0gKAogICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi52YWxpZGF0ZV9yZ3dfZW5kcG9p + bnRfdGxzX2NlcnQoKQogICAgICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICAg + ICAgIyBpZiB0aGVyZSBpcyBubyBlcnJvciwgc2V0IHRoZSBSR1dfRU5EUE9JTlQKICAgICAgICAg + ICAgICAgICAgICBpZiBlcnIgIT0gIi0xIjoKICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5v + dXRfbWFwWyJSR1dfRU5EUE9JTlQiXSA9IHNlbGYuX2FyZ19wYXJzZXIucmd3X2VuZHBvaW50CiAg + ICAgICAgICAgICAgICBlbHNlOgogICAgICAgICAgICAgICAgICAgIGVyciA9ICJQbGVhc2UgcHJv + dmlkZSBhbGwgdGhlIFJHVyBtdWx0aXNpdGUgcGFyYW1ldGVycyBvciBub25lIG9mIHRoZW0iCiAg + ICAgICAgICAgICAgICAgICAgc3lzLnN0ZGVyci53cml0ZShlcnIpCgogICAgZGVmIGdlbl9zaGVs + bF9vdXQoc2VsZik6CiAgICAgICAgc2VsZi5fZ2VuX291dHB1dF9tYXAoKQogICAgICAgIHNoT3V0 + SU8gPSBTdHJpbmdJTygpCiAgICAgICAgZm9yIGssIHYgaW4gc2VsZi5vdXRfbWFwLml0ZW1zKCk6 + CiAgICAgICAgICAgIGlmIHYgYW5kIGsgbm90IGluIHNlbGYuX2V4Y2x1ZGVkX2tleXM6CiAgICAg + ICAgICAgICAgICBzaE91dElPLndyaXRlKGYiZXhwb3J0IHtrfT17dn17TElORVNFUH0iKQogICAg + ICAgIHNoT3V0ID0gc2hPdXRJTy5nZXR2YWx1ZSgpCiAgICAgICAgc2hPdXRJTy5jbG9zZSgpCiAg + ICAgICAgcmV0dXJuIHNoT3V0CgogICAgZGVmIGdlbl9qc29uX291dChzZWxmKToKICAgICAgICBz + ZWxmLl9nZW5fb3V0cHV0X21hcCgpCiAgICAgICAgaWYgc2VsZi5fYXJnX3BhcnNlci5kcnlfcnVu + OgogICAgICAgICAgICByZXR1cm4gIiIKICAgICAgICBqc29uX291dCA9IFsKICAgICAgICAgICAg + ewogICAgICAgICAgICAgICAgIm5hbWUiOiAicm9vay1jZXBoLW1vbi1lbmRwb2ludHMiLAogICAg + ICAgICAgICAgICAgImtpbmQiOiAiQ29uZmlnTWFwIiwKICAgICAgICAgICAgICAgICJkYXRhIjog + ewogICAgICAgICAgICAgICAgICAgICJkYXRhIjogc2VsZi5vdXRfbWFwWyJST09LX0VYVEVSTkFM + X0NFUEhfTU9OX0RBVEEiXSwKICAgICAgICAgICAgICAgICAgICAibWF4TW9uSWQiOiAiMCIsCiAg + ICAgICAgICAgICAgICAgICAgIm1hcHBpbmciOiAie30iLAogICAgICAgICAgICAgICAgfSwKICAg + ICAgICAgICAgfSwKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgIm5hbWUiOiAicm9vay1j + ZXBoLW1vbiIsCiAgICAgICAgICAgICAgICAia2luZCI6ICJTZWNyZXQiLAogICAgICAgICAgICAg + ICAgImRhdGEiOiB7CiAgICAgICAgICAgICAgICAgICAgImFkbWluLXNlY3JldCI6ICJhZG1pbi1z + ZWNyZXQiLAogICAgICAgICAgICAgICAgICAgICJmc2lkIjogc2VsZi5vdXRfbWFwWyJST09LX0VY + VEVSTkFMX0ZTSUQiXSwKICAgICAgICAgICAgICAgICAgICAibW9uLXNlY3JldCI6ICJtb24tc2Vj + cmV0IiwKICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIHsKICAg + ICAgICAgICAgICAgICJuYW1lIjogInJvb2stY2VwaC1vcGVyYXRvci1jcmVkcyIsCiAgICAgICAg + ICAgICAgICAia2luZCI6ICJTZWNyZXQiLAogICAgICAgICAgICAgICAgImRhdGEiOiB7CiAgICAg + ICAgICAgICAgICAgICAgInVzZXJJRCI6IHNlbGYub3V0X21hcFsiUk9PS19FWFRFUk5BTF9VU0VS + TkFNRSJdLAogICAgICAgICAgICAgICAgICAgICJ1c2VyS2V5Ijogc2VsZi5vdXRfbWFwWyJST09L + X0VYVEVSTkFMX1VTRVJfU0VDUkVUIl0sCiAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICB9 + LAogICAgICAgIF0KCiAgICAgICAgIyBpZiAnTU9OSVRPUklOR19FTkRQT0lOVCcgZXhpc3RzLCB0 + aGVuIG9ubHkgYWRkICdtb25pdG9yaW5nLWVuZHBvaW50JyB0byBDbHVzdGVyCiAgICAgICAgaWYg + KAogICAgICAgICAgICBzZWxmLm91dF9tYXBbIk1PTklUT1JJTkdfRU5EUE9JTlQiXQogICAgICAg + ICAgICBhbmQgc2VsZi5vdXRfbWFwWyJNT05JVE9SSU5HX0VORFBPSU5UX1BPUlQiXQogICAgICAg + ICk6CiAgICAgICAgICAgIGpzb25fb3V0LmFwcGVuZCgKICAgICAgICAgICAgICAgIHsKICAgICAg + ICAgICAgICAgICAgICAibmFtZSI6ICJtb25pdG9yaW5nLWVuZHBvaW50IiwKICAgICAgICAgICAg + ICAgICAgICAia2luZCI6ICJDZXBoQ2x1c3RlciIsCiAgICAgICAgICAgICAgICAgICAgImRhdGEi + OiB7CiAgICAgICAgICAgICAgICAgICAgICAgICJNb25pdG9yaW5nRW5kcG9pbnQiOiBzZWxmLm91 + dF9tYXBbIk1PTklUT1JJTkdfRU5EUE9JTlQiXSwKICAgICAgICAgICAgICAgICAgICAgICAgIk1v + bml0b3JpbmdQb3J0Ijogc2VsZi5vdXRfbWFwWyJNT05JVE9SSU5HX0VORFBPSU5UX1BPUlQiXSwK + ICAgICAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICAgICAgfQogICAgICAgICAgICApCgog + ICAgICAgICMgaWYgJ0NTSV9SQkRfTk9ERV9TRUNSRVQnIGV4aXN0cywgdGhlbiBvbmx5IGFkZCAn + cm9vay1jc2ktcmJkLXByb3Zpc2lvbmVyJyBTZWNyZXQKICAgICAgICBpZiAoCiAgICAgICAgICAg + IHNlbGYub3V0X21hcFsiQ1NJX1JCRF9OT0RFX1NFQ1JFVCJdCiAgICAgICAgICAgIGFuZCBzZWxm + Lm91dF9tYXBbIkNTSV9SQkRfTk9ERV9TRUNSRVRfTkFNRSJdCiAgICAgICAgKToKICAgICAgICAg + ICAganNvbl9vdXQuYXBwZW5kKAogICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAg + ICJuYW1lIjogZiJyb29rLXtzZWxmLm91dF9tYXBbJ0NTSV9SQkRfTk9ERV9TRUNSRVRfTkFNRSdd + fSIsCiAgICAgICAgICAgICAgICAgICAgImtpbmQiOiAiU2VjcmV0IiwKICAgICAgICAgICAgICAg + ICAgICAiZGF0YSI6IHsKICAgICAgICAgICAgICAgICAgICAgICAgInVzZXJJRCI6IHNlbGYub3V0 + X21hcFsiQ1NJX1JCRF9OT0RFX1NFQ1JFVF9OQU1FIl0sCiAgICAgICAgICAgICAgICAgICAgICAg + ICJ1c2VyS2V5Ijogc2VsZi5vdXRfbWFwWyJDU0lfUkJEX05PREVfU0VDUkVUIl0sCiAgICAgICAg + ICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgKQogICAgICAgICMg + aWYgJ0NTSV9SQkRfUFJPVklTSU9ORVJfU0VDUkVUJyBleGlzdHMsIHRoZW4gb25seSBhZGQgJ3Jv + b2stY3NpLXJiZC1wcm92aXNpb25lcicgU2VjcmV0CiAgICAgICAgaWYgKAogICAgICAgICAgICBz + ZWxmLm91dF9tYXBbIkNTSV9SQkRfUFJPVklTSU9ORVJfU0VDUkVUIl0KICAgICAgICAgICAgYW5k + IHNlbGYub3V0X21hcFsiQ1NJX1JCRF9QUk9WSVNJT05FUl9TRUNSRVRfTkFNRSJdCiAgICAgICAg + KToKICAgICAgICAgICAganNvbl9vdXQuYXBwZW5kKAogICAgICAgICAgICAgICAgewogICAgICAg + ICAgICAgICAgICAgICJuYW1lIjogZiJyb29rLXtzZWxmLm91dF9tYXBbJ0NTSV9SQkRfUFJPVklT + SU9ORVJfU0VDUkVUX05BTUUnXX0iLAogICAgICAgICAgICAgICAgICAgICJraW5kIjogIlNlY3Jl + dCIsCiAgICAgICAgICAgICAgICAgICAgImRhdGEiOiB7CiAgICAgICAgICAgICAgICAgICAgICAg + ICJ1c2VySUQiOiBzZWxmLm91dF9tYXBbIkNTSV9SQkRfUFJPVklTSU9ORVJfU0VDUkVUX05BTUUi + XSwKICAgICAgICAgICAgICAgICAgICAgICAgInVzZXJLZXkiOiBzZWxmLm91dF9tYXBbIkNTSV9S + QkRfUFJPVklTSU9ORVJfU0VDUkVUIl0sCiAgICAgICAgICAgICAgICAgICAgfSwKICAgICAgICAg + ICAgICAgIH0KICAgICAgICAgICAgKQogICAgICAgICMgaWYgJ0NTSV9DRVBIRlNfUFJPVklTSU9O + RVJfU0VDUkVUJyBleGlzdHMsIHRoZW4gb25seSBhZGQgJ3Jvb2stY3NpLWNlcGhmcy1wcm92aXNp + b25lcicgU2VjcmV0CiAgICAgICAgaWYgKAogICAgICAgICAgICBzZWxmLm91dF9tYXBbIkNTSV9D + RVBIRlNfUFJPVklTSU9ORVJfU0VDUkVUIl0KICAgICAgICAgICAgYW5kIHNlbGYub3V0X21hcFsi + Q1NJX0NFUEhGU19QUk9WSVNJT05FUl9TRUNSRVRfTkFNRSJdCiAgICAgICAgKToKICAgICAgICAg + ICAganNvbl9vdXQuYXBwZW5kKAogICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAg + ICJuYW1lIjogZiJyb29rLXtzZWxmLm91dF9tYXBbJ0NTSV9DRVBIRlNfUFJPVklTSU9ORVJfU0VD + UkVUX05BTUUnXX0iLAogICAgICAgICAgICAgICAgICAgICJraW5kIjogIlNlY3JldCIsCiAgICAg + ICAgICAgICAgICAgICAgImRhdGEiOiB7CiAgICAgICAgICAgICAgICAgICAgICAgICJhZG1pbklE + Ijogc2VsZi5vdXRfbWFwWyJDU0lfQ0VQSEZTX1BST1ZJU0lPTkVSX1NFQ1JFVF9OQU1FIl0sCiAg + ICAgICAgICAgICAgICAgICAgICAgICJhZG1pbktleSI6IHNlbGYub3V0X21hcFsiQ1NJX0NFUEhG + U19QUk9WSVNJT05FUl9TRUNSRVQiXSwKICAgICAgICAgICAgICAgICAgICB9LAogICAgICAgICAg + ICAgICAgfQogICAgICAgICAgICApCiAgICAgICAgIyBpZiAnQ1NJX0NFUEhGU19OT0RFX1NFQ1JF + VCcgZXhpc3RzLCB0aGVuIG9ubHkgYWRkICdyb29rLWNzaS1jZXBoZnMtbm9kZScgU2VjcmV0CiAg + ICAgICAgaWYgKAogICAgICAgICAgICBzZWxmLm91dF9tYXBbIkNTSV9DRVBIRlNfTk9ERV9TRUNS + RVQiXQogICAgICAgICAgICBhbmQgc2VsZi5vdXRfbWFwWyJDU0lfQ0VQSEZTX05PREVfU0VDUkVU + X05BTUUiXQogICAgICAgICk6CiAgICAgICAgICAgIGpzb25fb3V0LmFwcGVuZCgKICAgICAgICAg + ICAgICAgIHsKICAgICAgICAgICAgICAgICAgICAibmFtZSI6IGYicm9vay17c2VsZi5vdXRfbWFw + WydDU0lfQ0VQSEZTX05PREVfU0VDUkVUX05BTUUnXX0iLAogICAgICAgICAgICAgICAgICAgICJr + aW5kIjogIlNlY3JldCIsCiAgICAgICAgICAgICAgICAgICAgImRhdGEiOiB7CiAgICAgICAgICAg + ICAgICAgICAgICAgICJhZG1pbklEIjogc2VsZi5vdXRfbWFwWyJDU0lfQ0VQSEZTX05PREVfU0VD + UkVUX05BTUUiXSwKICAgICAgICAgICAgICAgICAgICAgICAgImFkbWluS2V5Ijogc2VsZi5vdXRf + bWFwWyJDU0lfQ0VQSEZTX05PREVfU0VDUkVUIl0sCiAgICAgICAgICAgICAgICAgICAgfSwKICAg + ICAgICAgICAgICAgIH0KICAgICAgICAgICAgKQogICAgICAgICMgaWYgJ1JPT0tfRVhURVJOQUxf + REFTSEJPQVJEX0xJTksnIGV4aXN0cywgdGhlbiBvbmx5IGFkZCAncm9vay1jZXBoLWRhc2hib2Fy + ZC1saW5rJyBTZWNyZXQKICAgICAgICBpZiBzZWxmLm91dF9tYXBbIlJPT0tfRVhURVJOQUxfREFT + SEJPQVJEX0xJTksiXToKICAgICAgICAgICAganNvbl9vdXQuYXBwZW5kKAogICAgICAgICAgICAg + ICAgewogICAgICAgICAgICAgICAgICAgICJuYW1lIjogInJvb2stY2VwaC1kYXNoYm9hcmQtbGlu + ayIsCiAgICAgICAgICAgICAgICAgICAgImtpbmQiOiAiU2VjcmV0IiwKICAgICAgICAgICAgICAg + ICAgICAiZGF0YSI6IHsKICAgICAgICAgICAgICAgICAgICAgICAgInVzZXJJRCI6ICJjZXBoLWRh + c2hib2FyZC1saW5rIiwKICAgICAgICAgICAgICAgICAgICAgICAgInVzZXJLZXkiOiBzZWxmLm91 + dF9tYXBbIlJPT0tfRVhURVJOQUxfREFTSEJPQVJEX0xJTksiXSwKICAgICAgICAgICAgICAgICAg + ICB9LAogICAgICAgICAgICAgICAgfQogICAgICAgICAgICApCiAgICAgICAgIyBpZiAnUkFET1Nf + TkFNRVNQQUNFJyBleGlzdHMsIHRoZW4gb25seSBhZGQgdGhlICJSQURPU19OQU1FU1BBQ0UiIG5h + bWVzcGFjZQogICAgICAgIGlmICgKICAgICAgICAgICAgc2VsZi5vdXRfbWFwWyJSQURPU19OQU1F + U1BBQ0UiXQogICAgICAgICAgICBhbmQgc2VsZi5vdXRfbWFwWyJSRVNUUklDVEVEX0FVVEhfUEVS + TUlTU0lPTiJdCiAgICAgICAgICAgIGFuZCBub3Qgc2VsZi5vdXRfbWFwWyJSQkRfTUVUQURBVEFf + RUNfUE9PTF9OQU1FIl0KICAgICAgICApOgogICAgICAgICAgICBqc29uX291dC5hcHBlbmQoCiAg + ICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgIm5hbWUiOiAicmFkb3MtbmFtZXNw + YWNlIiwKICAgICAgICAgICAgICAgICAgICAia2luZCI6ICJDZXBoQmxvY2tQb29sUmFkb3NOYW1l + c3BhY2UiLAogICAgICAgICAgICAgICAgICAgICJkYXRhIjogewogICAgICAgICAgICAgICAgICAg + ICAgICAicmFkb3NOYW1lc3BhY2VOYW1lIjogc2VsZi5vdXRfbWFwWyJSQURPU19OQU1FU1BBQ0Ui + XSwKICAgICAgICAgICAgICAgICAgICAgICAgInBvb2wiOiBzZWxmLm91dF9tYXBbIlJCRF9QT09M + X05BTUUiXSwKICAgICAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICAgICAgfQogICAgICAg + ICAgICApCiAgICAgICAgICAgIGpzb25fb3V0LmFwcGVuZCgKICAgICAgICAgICAgICAgIHsKICAg + ICAgICAgICAgICAgICAgICAibmFtZSI6ICJjZXBoLXJiZC1yYWRvcy1uYW1lc3BhY2UiLAogICAg + ICAgICAgICAgICAgICAgICJraW5kIjogIlN0b3JhZ2VDbGFzcyIsCiAgICAgICAgICAgICAgICAg + ICAgImRhdGEiOiB7CiAgICAgICAgICAgICAgICAgICAgICAgICJwb29sIjogc2VsZi5vdXRfbWFw + WyJSQkRfUE9PTF9OQU1FIl0sCiAgICAgICAgICAgICAgICAgICAgICAgICJjc2kuc3RvcmFnZS5r + OHMuaW8vcHJvdmlzaW9uZXItc2VjcmV0LW5hbWUiOiBmInJvb2ste3NlbGYub3V0X21hcFsnQ1NJ + X1JCRF9QUk9WSVNJT05FUl9TRUNSRVRfTkFNRSddfSIsCiAgICAgICAgICAgICAgICAgICAgICAg + ICJjc2kuc3RvcmFnZS5rOHMuaW8vY29udHJvbGxlci1leHBhbmQtc2VjcmV0LW5hbWUiOiBmInJv + b2ste3NlbGYub3V0X21hcFsnQ1NJX1JCRF9QUk9WSVNJT05FUl9TRUNSRVRfTkFNRSddfSIsCiAg + ICAgICAgICAgICAgICAgICAgICAgICJjc2kuc3RvcmFnZS5rOHMuaW8vbm9kZS1zdGFnZS1zZWNy + ZXQtbmFtZSI6IGYicm9vay17c2VsZi5vdXRfbWFwWydDU0lfUkJEX05PREVfU0VDUkVUX05BTUUn + XX0iLAogICAgICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAg + ICkKICAgICAgICBlbHNlOgogICAgICAgICAgICBpZiBzZWxmLm91dF9tYXBbIlJCRF9NRVRBREFU + QV9FQ19QT09MX05BTUUiXToKICAgICAgICAgICAgICAgIGpzb25fb3V0LmFwcGVuZCgKICAgICAg + ICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgICAgICJuYW1lIjogImNlcGgtcmJk + IiwKICAgICAgICAgICAgICAgICAgICAgICAgImtpbmQiOiAiU3RvcmFnZUNsYXNzIiwKICAgICAg + ICAgICAgICAgICAgICAgICAgImRhdGEiOiB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAi + ZGF0YVBvb2wiOiBzZWxmLm91dF9tYXBbIlJCRF9QT09MX05BTUUiXSwKICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICJwb29sIjogc2VsZi5vdXRfbWFwWyJSQkRfTUVUQURBVEFfRUNfUE9PTF9O + QU1FIl0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAiY3NpLnN0b3JhZ2UuazhzLmlvL3By + b3Zpc2lvbmVyLXNlY3JldC1uYW1lIjogZiJyb29rLXtzZWxmLm91dF9tYXBbJ0NTSV9SQkRfUFJP + VklTSU9ORVJfU0VDUkVUX05BTUUnXX0iLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgImNz + aS5zdG9yYWdlLms4cy5pby9jb250cm9sbGVyLWV4cGFuZC1zZWNyZXQtbmFtZSI6IGYicm9vay17 + c2VsZi5vdXRfbWFwWydDU0lfUkJEX1BST1ZJU0lPTkVSX1NFQ1JFVF9OQU1FJ119IiwKICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICJjc2kuc3RvcmFnZS5rOHMuaW8vbm9kZS1zdGFnZS1zZWNy + ZXQtbmFtZSI6IGYicm9vay17c2VsZi5vdXRfbWFwWydDU0lfUkJEX05PREVfU0VDUkVUX05BTUUn + XX0iLAogICAgICAgICAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICAgICAgICAgIH0KICAg + ICAgICAgICAgICAgICkKICAgICAgICAgICAgZWxzZToKICAgICAgICAgICAgICAgIGpzb25fb3V0 + LmFwcGVuZCgKICAgICAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgICAgICJu + YW1lIjogImNlcGgtcmJkIiwKICAgICAgICAgICAgICAgICAgICAgICAgImtpbmQiOiAiU3RvcmFn + ZUNsYXNzIiwKICAgICAgICAgICAgICAgICAgICAgICAgImRhdGEiOiB7CiAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAicG9vbCI6IHNlbGYub3V0X21hcFsiUkJEX1BPT0xfTkFNRSJdLAogICAg + ICAgICAgICAgICAgICAgICAgICAgICAgImNzaS5zdG9yYWdlLms4cy5pby9wcm92aXNpb25lci1z + ZWNyZXQtbmFtZSI6IGYicm9vay17c2VsZi5vdXRfbWFwWydDU0lfUkJEX1BST1ZJU0lPTkVSX1NF + Q1JFVF9OQU1FJ119IiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICJjc2kuc3RvcmFnZS5r + OHMuaW8vY29udHJvbGxlci1leHBhbmQtc2VjcmV0LW5hbWUiOiBmInJvb2ste3NlbGYub3V0X21h + cFsnQ1NJX1JCRF9QUk9WSVNJT05FUl9TRUNSRVRfTkFNRSddfSIsCiAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAiY3NpLnN0b3JhZ2UuazhzLmlvL25vZGUtc3RhZ2Utc2VjcmV0LW5hbWUiOiBm + InJvb2ste3NlbGYub3V0X21hcFsnQ1NJX1JCRF9OT0RFX1NFQ1JFVF9OQU1FJ119IiwKICAgICAg + ICAgICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAg + ICApCgogICAgICAgICMgaWYgJ1RPUE9MT0dZX1BPT0xTJywgJ1RPUE9MT0dZX0ZBSUxVUkVfRE9N + QUlOX0xBQkVMJywgJ1RPUE9MT0dZX0ZBSUxVUkVfRE9NQUlOX1ZBTFVFUycgIGV4aXN0cywKICAg + ICAgICAjIHRoZW4gb25seSBhZGQgJ3RvcG9sb2d5JyBTdG9yYWdlQ2xhc3MKICAgICAgICBpZiAo + CiAgICAgICAgICAgIHNlbGYub3V0X21hcFsiVE9QT0xPR1lfUE9PTFMiXQogICAgICAgICAgICBh + bmQgc2VsZi5vdXRfbWFwWyJUT1BPTE9HWV9GQUlMVVJFX0RPTUFJTl9MQUJFTCJdCiAgICAgICAg + ICAgIGFuZCBzZWxmLm91dF9tYXBbIlRPUE9MT0dZX0ZBSUxVUkVfRE9NQUlOX1ZBTFVFUyJdCiAg + ICAgICAgKToKICAgICAgICAgICAganNvbl9vdXQuYXBwZW5kKAogICAgICAgICAgICAgICAgewog + ICAgICAgICAgICAgICAgICAgICJuYW1lIjogImNlcGgtcmJkLXRvcG9sb2d5IiwKICAgICAgICAg + ICAgICAgICAgICAia2luZCI6ICJTdG9yYWdlQ2xhc3MiLAogICAgICAgICAgICAgICAgICAgICJk + YXRhIjogewogICAgICAgICAgICAgICAgICAgICAgICAidG9wb2xvZ3lGYWlsdXJlRG9tYWluTGFi + ZWwiOiBzZWxmLm91dF9tYXBbCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAiVE9QT0xPR1lf + RkFJTFVSRV9ET01BSU5fTEFCRUwiCiAgICAgICAgICAgICAgICAgICAgICAgIF0sCiAgICAgICAg + ICAgICAgICAgICAgICAgICJ0b3BvbG9neUZhaWx1cmVEb21haW5WYWx1ZXMiOiBzZWxmLm91dF9t + YXBbCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAiVE9QT0xPR1lfRkFJTFVSRV9ET01BSU5f + VkFMVUVTIgogICAgICAgICAgICAgICAgICAgICAgICBdLAogICAgICAgICAgICAgICAgICAgICAg + ICAidG9wb2xvZ3lQb29scyI6IHNlbGYub3V0X21hcFsiVE9QT0xPR1lfUE9PTFMiXSwKICAgICAg + ICAgICAgICAgICAgICAgICAgImNzaS5zdG9yYWdlLms4cy5pby9wcm92aXNpb25lci1zZWNyZXQt + bmFtZSI6IGYicm9vay17c2VsZi5vdXRfbWFwWydDU0lfUkJEX1BST1ZJU0lPTkVSX1NFQ1JFVF9O + QU1FJ119IiwKICAgICAgICAgICAgICAgICAgICAgICAgImNzaS5zdG9yYWdlLms4cy5pby9jb250 + cm9sbGVyLWV4cGFuZC1zZWNyZXQtbmFtZSI6IGYicm9vay17c2VsZi5vdXRfbWFwWydDU0lfUkJE + X1BST1ZJU0lPTkVSX1NFQ1JFVF9OQU1FJ119IiwKICAgICAgICAgICAgICAgICAgICAgICAgImNz + aS5zdG9yYWdlLms4cy5pby9ub2RlLXN0YWdlLXNlY3JldC1uYW1lIjogZiJyb29rLXtzZWxmLm91 + dF9tYXBbJ0NTSV9SQkRfTk9ERV9TRUNSRVRfTkFNRSddfSIsCiAgICAgICAgICAgICAgICAgICAg + fSwKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgKQoKICAgICAgICAjIGlmICdDRVBIRlNf + RlNfTkFNRScgZXhpc3RzLCB0aGVuIG9ubHkgYWRkICdjZXBoZnMnIFN0b3JhZ2VDbGFzcwogICAg + ICAgIGlmIHNlbGYub3V0X21hcFsiQ0VQSEZTX0ZTX05BTUUiXToKICAgICAgICAgICAganNvbl9v + dXQuYXBwZW5kKAogICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICJuYW1lIjog + ImNlcGhmcyIsCiAgICAgICAgICAgICAgICAgICAgImtpbmQiOiAiU3RvcmFnZUNsYXNzIiwKICAg + ICAgICAgICAgICAgICAgICAiZGF0YSI6IHsKICAgICAgICAgICAgICAgICAgICAgICAgImZzTmFt + ZSI6IHNlbGYub3V0X21hcFsiQ0VQSEZTX0ZTX05BTUUiXSwKICAgICAgICAgICAgICAgICAgICAg + ICAgInBvb2wiOiBzZWxmLm91dF9tYXBbIkNFUEhGU19QT09MX05BTUUiXSwKICAgICAgICAgICAg + ICAgICAgICAgICAgImNzaS5zdG9yYWdlLms4cy5pby9wcm92aXNpb25lci1zZWNyZXQtbmFtZSI6 + IGYicm9vay17c2VsZi5vdXRfbWFwWydDU0lfQ0VQSEZTX1BST1ZJU0lPTkVSX1NFQ1JFVF9OQU1F J119IiwKICAgICAgICAgICAgICAgICAgICAgICAgImNzaS5zdG9yYWdlLms4cy5pby9jb250cm9s - bGVyLWV4cGFuZC1zZWNyZXQtbmFtZSI6IGYicm9vay17c2VsZi5vdXRfbWFwWydDU0lfUkJEX1BS - T1ZJU0lPTkVSX1NFQ1JFVF9OQU1FJ119IiwKICAgICAgICAgICAgICAgICAgICAgICAgImNzaS5z - dG9yYWdlLms4cy5pby9ub2RlLXN0YWdlLXNlY3JldC1uYW1lIjogZiJyb29rLXtzZWxmLm91dF9t - YXBbJ0NTSV9SQkRfTk9ERV9TRUNSRVRfTkFNRSddfSIsCiAgICAgICAgICAgICAgICAgICAgfSwK - ICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgKQoKICAgICAgICAjIGlmICdDRVBIRlNfRlNf - TkFNRScgZXhpc3RzLCB0aGVuIG9ubHkgYWRkICdjZXBoZnMnIFN0b3JhZ2VDbGFzcwogICAgICAg - IGlmIHNlbGYub3V0X21hcFsiQ0VQSEZTX0ZTX05BTUUiXToKICAgICAgICAgICAganNvbl9vdXQu - YXBwZW5kKAogICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICJuYW1lIjogImNl - cGhmcyIsCiAgICAgICAgICAgICAgICAgICAgImtpbmQiOiAiU3RvcmFnZUNsYXNzIiwKICAgICAg - ICAgICAgICAgICAgICAiZGF0YSI6IHsKICAgICAgICAgICAgICAgICAgICAgICAgImZzTmFtZSI6 - IHNlbGYub3V0X21hcFsiQ0VQSEZTX0ZTX05BTUUiXSwKICAgICAgICAgICAgICAgICAgICAgICAg - InBvb2wiOiBzZWxmLm91dF9tYXBbIkNFUEhGU19QT09MX05BTUUiXSwKICAgICAgICAgICAgICAg - ICAgICAgICAgImNzaS5zdG9yYWdlLms4cy5pby9wcm92aXNpb25lci1zZWNyZXQtbmFtZSI6IGYi - cm9vay17c2VsZi5vdXRfbWFwWydDU0lfQ0VQSEZTX1BST1ZJU0lPTkVSX1NFQ1JFVF9OQU1FJ119 - IiwKICAgICAgICAgICAgICAgICAgICAgICAgImNzaS5zdG9yYWdlLms4cy5pby9jb250cm9sbGVy - LWV4cGFuZC1zZWNyZXQtbmFtZSI6IGYicm9vay17c2VsZi5vdXRfbWFwWydDU0lfQ0VQSEZTX1BS - T1ZJU0lPTkVSX1NFQ1JFVF9OQU1FJ119IiwKICAgICAgICAgICAgICAgICAgICAgICAgImNzaS5z - dG9yYWdlLms4cy5pby9ub2RlLXN0YWdlLXNlY3JldC1uYW1lIjogZiJyb29rLXtzZWxmLm91dF9t - YXBbJ0NTSV9DRVBIRlNfTk9ERV9TRUNSRVRfTkFNRSddfSIsCiAgICAgICAgICAgICAgICAgICAg - fSwKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgKQogICAgICAgICMgaWYgJ1JHV19FTkRQ - T0lOVCcgZXhpc3RzLCB0aGVuIG9ubHkgYWRkICdjZXBoLXJndycgU3RvcmFnZUNsYXNzCiAgICAg - ICAgaWYgc2VsZi5vdXRfbWFwWyJSR1dfRU5EUE9JTlQiXToKICAgICAgICAgICAganNvbl9vdXQu - YXBwZW5kKAogICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICJuYW1lIjogImNl - cGgtcmd3IiwKICAgICAgICAgICAgICAgICAgICAia2luZCI6ICJTdG9yYWdlQ2xhc3MiLAogICAg - ICAgICAgICAgICAgICAgICJkYXRhIjogewogICAgICAgICAgICAgICAgICAgICAgICAiZW5kcG9p - bnQiOiBzZWxmLm91dF9tYXBbIlJHV19FTkRQT0lOVCJdLAogICAgICAgICAgICAgICAgICAgICAg - ICAicG9vbFByZWZpeCI6IHNlbGYub3V0X21hcFsiUkdXX1BPT0xfUFJFRklYIl0sCiAgICAgICAg - ICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgKQogICAgICAgICAg + bGVyLWV4cGFuZC1zZWNyZXQtbmFtZSI6IGYicm9vay17c2VsZi5vdXRfbWFwWydDU0lfQ0VQSEZT + X1BST1ZJU0lPTkVSX1NFQ1JFVF9OQU1FJ119IiwKICAgICAgICAgICAgICAgICAgICAgICAgImNz + aS5zdG9yYWdlLms4cy5pby9ub2RlLXN0YWdlLXNlY3JldC1uYW1lIjogZiJyb29rLXtzZWxmLm91 + dF9tYXBbJ0NTSV9DRVBIRlNfTk9ERV9TRUNSRVRfTkFNRSddfSIsCiAgICAgICAgICAgICAgICAg + ICAgfSwKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgKQogICAgICAgICMgaWYgJ1JHV19F + TkRQT0lOVCcgZXhpc3RzLCB0aGVuIG9ubHkgYWRkICdjZXBoLXJndycgU3RvcmFnZUNsYXNzCiAg + ICAgICAgaWYgc2VsZi5vdXRfbWFwWyJSR1dfRU5EUE9JTlQiXToKICAgICAgICAgICAganNvbl9v + dXQuYXBwZW5kKAogICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICJuYW1lIjog + ImNlcGgtcmd3IiwKICAgICAgICAgICAgICAgICAgICAia2luZCI6ICJTdG9yYWdlQ2xhc3MiLAog + ICAgICAgICAgICAgICAgICAgICJkYXRhIjogewogICAgICAgICAgICAgICAgICAgICAgICAiZW5k + cG9pbnQiOiBzZWxmLm91dF9tYXBbIlJHV19FTkRQT0lOVCJdLAogICAgICAgICAgICAgICAgICAg + ICAgICAicG9vbFByZWZpeCI6IHNlbGYub3V0X21hcFsiUkdXX1BPT0xfUFJFRklYIl0sCiAgICAg + ICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgKQogICAgICAg + ICAgICBqc29uX291dC5hcHBlbmQoCiAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAg + ICAgIm5hbWUiOiAicmd3LWFkbWluLW9wcy11c2VyIiwKICAgICAgICAgICAgICAgICAgICAia2lu + ZCI6ICJTZWNyZXQiLAogICAgICAgICAgICAgICAgICAgICJkYXRhIjogewogICAgICAgICAgICAg + ICAgICAgICAgICAiYWNjZXNzS2V5Ijogc2VsZi5vdXRfbWFwWyJSR1dfQURNSU5fT1BTX1VTRVJf + QUNDRVNTX0tFWSJdLAogICAgICAgICAgICAgICAgICAgICAgICAic2VjcmV0S2V5Ijogc2VsZi5v + dXRfbWFwWyJSR1dfQURNSU5fT1BTX1VTRVJfU0VDUkVUX0tFWSJdLAogICAgICAgICAgICAgICAg + ICAgIH0sCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICkKICAgICAgICAjIGlmICdSR1df + VExTX0NFUlQnIGV4aXN0cywgdGhlbiBvbmx5IGFkZCB0aGUgImNlcGgtcmd3LXRscy1jZXJ0IiBz + ZWNyZXQKICAgICAgICBpZiBzZWxmLm91dF9tYXBbIlJHV19UTFNfQ0VSVCJdOgogICAgICAgICAg ICBqc29uX291dC5hcHBlbmQoCiAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAg - Im5hbWUiOiAicmd3LWFkbWluLW9wcy11c2VyIiwKICAgICAgICAgICAgICAgICAgICAia2luZCI6 - ICJTZWNyZXQiLAogICAgICAgICAgICAgICAgICAgICJkYXRhIjogewogICAgICAgICAgICAgICAg - ICAgICAgICAiYWNjZXNzS2V5Ijogc2VsZi5vdXRfbWFwWyJSR1dfQURNSU5fT1BTX1VTRVJfQUND - RVNTX0tFWSJdLAogICAgICAgICAgICAgICAgICAgICAgICAic2VjcmV0S2V5Ijogc2VsZi5vdXRf - bWFwWyJSR1dfQURNSU5fT1BTX1VTRVJfU0VDUkVUX0tFWSJdLAogICAgICAgICAgICAgICAgICAg - IH0sCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICkKICAgICAgICAjIGlmICdSR1dfVExT - X0NFUlQnIGV4aXN0cywgdGhlbiBvbmx5IGFkZCB0aGUgImNlcGgtcmd3LXRscy1jZXJ0IiBzZWNy - ZXQKICAgICAgICBpZiBzZWxmLm91dF9tYXBbIlJHV19UTFNfQ0VSVCJdOgogICAgICAgICAgICBq - c29uX291dC5hcHBlbmQoCiAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgIm5h - bWUiOiAiY2VwaC1yZ3ctdGxzLWNlcnQiLAogICAgICAgICAgICAgICAgICAgICJraW5kIjogIlNl - Y3JldCIsCiAgICAgICAgICAgICAgICAgICAgImRhdGEiOiB7CiAgICAgICAgICAgICAgICAgICAg - ICAgICJjZXJ0Ijogc2VsZi5vdXRfbWFwWyJSR1dfVExTX0NFUlQiXSwKICAgICAgICAgICAgICAg - ICAgICB9LAogICAgICAgICAgICAgICAgfQogICAgICAgICAgICApCgogICAgICAgIHJldHVybiBq - c29uLmR1bXBzKGpzb25fb3V0KSArIExJTkVTRVAKCiAgICBkZWYgdXBncmFkZV91c2Vyc19wZXJt - aXNzaW9ucyhzZWxmKToKICAgICAgICB1c2VycyA9IFsKICAgICAgICAgICAgImNsaWVudC5jc2kt - Y2VwaGZzLW5vZGUiLAogICAgICAgICAgICAiY2xpZW50LmNzaS1jZXBoZnMtcHJvdmlzaW9uZXIi - LAogICAgICAgICAgICAiY2xpZW50LmNzaS1yYmQtbm9kZSIsCiAgICAgICAgICAgICJjbGllbnQu - Y3NpLXJiZC1wcm92aXNpb25lciIsCiAgICAgICAgICAgICJjbGllbnQuaGVhbHRoY2hlY2tlciIs - CiAgICAgICAgXQogICAgICAgIGlmIHNlbGYucnVuX2FzX3VzZXIgIT0gIiIgYW5kIHNlbGYucnVu - X2FzX3VzZXIgbm90IGluIHVzZXJzOgogICAgICAgICAgICB1c2Vycy5hcHBlbmQoc2VsZi5ydW5f - YXNfdXNlcikKICAgICAgICBmb3IgdXNlciBpbiB1c2VyczoKICAgICAgICAgICAgc2VsZi51cGdy - YWRlX3VzZXJfcGVybWlzc2lvbnModXNlcikKCiAgICBkZWYgZ2V0X3Jnd19wb29sX25hbWVfZHVy - aW5nX3VwZ3JhZGUoc2VsZiwgdXNlciwgY2Fwcyk6CiAgICAgICAgaWYgdXNlciA9PSAiY2xpZW50 - LmhlYWx0aGNoZWNrZXIiOgogICAgICAgICAgICAjIHdoZW4gYWRtaW4gaGFzIG5vdCBwcm92aWRl - ZCByZ3cgcG9vbCBuYW1lIGR1cmluZyB1cGdyYWRlLAogICAgICAgICAgICAjIGdldCB0aGUgcmd3 - IHBvb2wgbmFtZSBmcm9tIGNsaWVudC5oZWFsdGhjaGVja2VyIHVzZXIgd2hpY2ggd2FzIHVzZWQg - ZHVyaW5nIGNvbm5lY3Rpb24KICAgICAgICAgICAgaWYgbm90IHNlbGYuX2FyZ19wYXJzZXIucmd3 - X3Bvb2xfcHJlZml4OgogICAgICAgICAgICAgICAgIyBUbyBnZXQgdmFsdWUgJ2RlZmF1bHQnIHdo - aWNoIGlzIHJndyBwb29sIG5hbWUgZnJvbSAnYWxsb3cgcnd4IHBvb2w9ZGVmYXVsdC5yZ3cubWV0 - YScKICAgICAgICAgICAgICAgIHBhdHRlcm4gPSByInBvb2w9KC4qPylcLnJnd1wubWV0YSIKICAg - ICAgICAgICAgICAgIG1hdGNoID0gcmUuc2VhcmNoKHBhdHRlcm4sIGNhcHMpCiAgICAgICAgICAg - ICAgICBpZiBtYXRjaDoKICAgICAgICAgICAgICAgICAgICBzZWxmLl9hcmdfcGFyc2VyLnJnd19w - b29sX3ByZWZpeCA9IG1hdGNoLmdyb3VwKDEpCiAgICAgICAgICAgICAgICBlbHNlOgogICAgICAg - ICAgICAgICAgICAgIHJhaXNlIEV4ZWN1dGlvbkZhaWx1cmVFeGNlcHRpb24oCiAgICAgICAgICAg - ICAgICAgICAgICAgICJmYWlsZWQgdG8gZ2V0IHJndyBwb29sIG5hbWUgZm9yIHVwZ3JhZGUiCiAg - ICAgICAgICAgICAgICAgICAgKQoKICAgIGRlZiB1cGdyYWRlX3VzZXJfcGVybWlzc2lvbnMoc2Vs - ZiwgdXNlcik6CiAgICAgICAgIyBjaGVjayB3aGV0aGVyIHRoZSBnaXZlbiB1c2VyIGV4aXN0cyBv - ciBub3QKICAgICAgICBjbWRfanNvbiA9IHsicHJlZml4IjogImF1dGggZ2V0IiwgImVudGl0eSI6 - IGYie3VzZXJ9IiwgImZvcm1hdCI6ICJqc29uIn0KICAgICAgICByZXRfdmFsLCBqc29uX291dCwg - ZXJyX21zZyA9IHNlbGYuX2NvbW1vbl9jbWRfanNvbl9nZW4oY21kX2pzb24pCiAgICAgICAgaWYg - cmV0X3ZhbCAhPSAwIG9yIGxlbihqc29uX291dCkgPT0gMDoKICAgICAgICAgICAgcHJpbnQoZiJ1 - c2VyIHt1c2VyfSBub3QgZm91bmQgZm9yIHVwZ3JhZGluZy4iKQogICAgICAgICAgICByZXR1cm4K - ICAgICAgICBleGlzdGluZ19jYXBzID0ganNvbl9vdXRbMF1bImNhcHMiXQogICAgICAgIHNlbGYu - Z2V0X3Jnd19wb29sX25hbWVfZHVyaW5nX3VwZ3JhZGUodXNlciwgc3RyKGV4aXN0aW5nX2NhcHMp - KQogICAgICAgIG5ld19jYXAsIF8gPSBzZWxmLmdldF9jYXBzX2FuZF9lbnRpdHkodXNlcikKICAg - ICAgICBjYXBfa2V5cyA9IFsibW9uIiwgIm1nciIsICJvc2QiLCAibWRzIl0KICAgICAgICBjYXBz - ID0gW10KICAgICAgICBmb3IgZWFjaENhcCBpbiBjYXBfa2V5czoKICAgICAgICAgICAgY3VyX2Nh - cF92YWx1ZXMgPSBleGlzdGluZ19jYXBzLmdldChlYWNoQ2FwLCAiIikKICAgICAgICAgICAgbmV3 - X2NhcF92YWx1ZXMgPSBuZXdfY2FwLmdldChlYWNoQ2FwLCAiIikKICAgICAgICAgICAgY3VyX2Nh - cF9wZXJtX2xpc3QgPSBbCiAgICAgICAgICAgICAgICB4LnN0cmlwKCkgZm9yIHggaW4gY3VyX2Nh - cF92YWx1ZXMuc3BsaXQoIiwiKSBpZiB4LnN0cmlwKCkKICAgICAgICAgICAgXQogICAgICAgICAg - ICBuZXdfY2FwX3Blcm1fbGlzdCA9IFsKICAgICAgICAgICAgICAgIHguc3RyaXAoKSBmb3IgeCBp - biBuZXdfY2FwX3ZhbHVlcy5zcGxpdCgiLCIpIGlmIHguc3RyaXAoKQogICAgICAgICAgICBdCiAg - ICAgICAgICAgICMgYXBwZW5kIG5ld19jYXBfbGlzdCB0byBjdXJfY2FwX2xpc3QgdG8gbWFpbnRh - aW4gdGhlIG9yZGVyIG9mIGNhcHMKICAgICAgICAgICAgY3VyX2NhcF9wZXJtX2xpc3QuZXh0ZW5k - KG5ld19jYXBfcGVybV9saXN0KQogICAgICAgICAgICAjIGVsaW1pbmF0ZSBkdXBsaWNhdGVzIHdp - dGhvdXQgdXNpbmcgJ3NldCcKICAgICAgICAgICAgIyBzZXQgcmUtb3JkZXJzIGl0ZW1zIGluIHRo - ZSBsaXN0IGFuZCB3ZSBoYXZlIHRvIGtlZXAgdGhlIG9yZGVyCiAgICAgICAgICAgIG5ld19jYXBf - bGlzdCA9IFtdCiAgICAgICAgICAgIFtuZXdfY2FwX2xpc3QuYXBwZW5kKHgpIGZvciB4IGluIGN1 - cl9jYXBfcGVybV9saXN0IGlmIHggbm90IGluIG5ld19jYXBfbGlzdF0KICAgICAgICAgICAgZXhp - c3RpbmdfY2Fwc1tlYWNoQ2FwXSA9ICIsICIuam9pbihuZXdfY2FwX2xpc3QpCiAgICAgICAgICAg - IGlmIGV4aXN0aW5nX2NhcHNbZWFjaENhcF06CiAgICAgICAgICAgICAgICBjYXBzLmFwcGVuZChl - YWNoQ2FwKQogICAgICAgICAgICAgICAgY2Fwcy5hcHBlbmQoZXhpc3RpbmdfY2Fwc1tlYWNoQ2Fw - XSkKICAgICAgICBjbWRfanNvbiA9IHsKICAgICAgICAgICAgInByZWZpeCI6ICJhdXRoIGNhcHMi - LAogICAgICAgICAgICAiZW50aXR5IjogdXNlciwKICAgICAgICAgICAgImNhcHMiOiBjYXBzLAog - ICAgICAgICAgICAiZm9ybWF0IjogImpzb24iLAogICAgICAgIH0KICAgICAgICByZXRfdmFsLCBq - c29uX291dCwgZXJyX21zZyA9IHNlbGYuX2NvbW1vbl9jbWRfanNvbl9nZW4oY21kX2pzb24pCiAg - ICAgICAgaWYgcmV0X3ZhbCAhPSAwOgogICAgICAgICAgICByYWlzZSBFeGVjdXRpb25GYWlsdXJl - RXhjZXB0aW9uKAogICAgICAgICAgICAgICAgZiInYXV0aCBjYXBzIHt1c2VyfScgY29tbWFuZCBm - YWlsZWQuXG4gRXJyb3I6IHtlcnJfbXNnfSIKICAgICAgICAgICAgKQogICAgICAgIHByaW50KGYi - VXBkYXRlZCB1c2VyIHt1c2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ojIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj - IyMjIyMjIyMjIyMjIyMjIyMKaWYgX19uYW1lX18gPT0gIl9fbWFpbl9fIjoKICAgIHJqT2JqID0g - UmFkb3NKU09OKCkKICAgIHRyeToKICAgICAgICByak9iai5tYWluKCkKICAgIGV4Y2VwdCBFeGVj - dXRpb25GYWlsdXJlRXhjZXB0aW9uIGFzIGVycjoKICAgICAgICBwcmludChmIkV4ZWN1dGlvbiBG - YWlsZWQ6IHtlcnJ9IikKICAgICAgICByYWlzZSBlcnIKICAgIGV4Y2VwdCBLZXlFcnJvciBhcyBr - RXJyOgogICAgICAgIHByaW50KGYiS2V5RXJyb3I6IHtrRXJyfSIpCiAgICBleGNlcHQgT1NFcnJv - ciBhcyBvc0VycjoKICAgICAgICBwcmludChmIkVycm9yIHdoaWxlIHRyeWluZyB0byBvdXRwdXQg - dGhlIGRhdGE6IHtvc0Vycn0iKQogICAgZmluYWxseToKICAgICAgICByak9iai5zaHV0ZG93bigp - Cg== + Im5hbWUiOiAiY2VwaC1yZ3ctdGxzLWNlcnQiLAogICAgICAgICAgICAgICAgICAgICJraW5kIjog + IlNlY3JldCIsCiAgICAgICAgICAgICAgICAgICAgImRhdGEiOiB7CiAgICAgICAgICAgICAgICAg + ICAgICAgICJjZXJ0Ijogc2VsZi5vdXRfbWFwWyJSR1dfVExTX0NFUlQiXSwKICAgICAgICAgICAg + ICAgICAgICB9LAogICAgICAgICAgICAgICAgfQogICAgICAgICAgICApCgogICAgICAgIHJldHVy + biBqc29uLmR1bXBzKGpzb25fb3V0KSArIExJTkVTRVAKCiAgICBkZWYgdXBncmFkZV91c2Vyc19w + ZXJtaXNzaW9ucyhzZWxmKToKICAgICAgICB1c2VycyA9IFsKICAgICAgICAgICAgImNsaWVudC5j + c2ktY2VwaGZzLW5vZGUiLAogICAgICAgICAgICAiY2xpZW50LmNzaS1jZXBoZnMtcHJvdmlzaW9u + ZXIiLAogICAgICAgICAgICAiY2xpZW50LmNzaS1yYmQtbm9kZSIsCiAgICAgICAgICAgICJjbGll + bnQuY3NpLXJiZC1wcm92aXNpb25lciIsCiAgICAgICAgICAgICJjbGllbnQuaGVhbHRoY2hlY2tl + ciIsCiAgICAgICAgXQogICAgICAgIGlmIHNlbGYucnVuX2FzX3VzZXIgIT0gIiIgYW5kIHNlbGYu + cnVuX2FzX3VzZXIgbm90IGluIHVzZXJzOgogICAgICAgICAgICB1c2Vycy5hcHBlbmQoc2VsZi5y + dW5fYXNfdXNlcikKICAgICAgICBmb3IgdXNlciBpbiB1c2VyczoKICAgICAgICAgICAgc2VsZi51 + cGdyYWRlX3VzZXJfcGVybWlzc2lvbnModXNlcikKCiAgICBkZWYgZ2V0X3Jnd19wb29sX25hbWVf + ZHVyaW5nX3VwZ3JhZGUoc2VsZiwgdXNlciwgY2Fwcyk6CiAgICAgICAgaWYgdXNlciA9PSAiY2xp + ZW50LmhlYWx0aGNoZWNrZXIiOgogICAgICAgICAgICAjIHdoZW4gYWRtaW4gaGFzIG5vdCBwcm92 + aWRlZCByZ3cgcG9vbCBuYW1lIGR1cmluZyB1cGdyYWRlLAogICAgICAgICAgICAjIGdldCB0aGUg + cmd3IHBvb2wgbmFtZSBmcm9tIGNsaWVudC5oZWFsdGhjaGVja2VyIHVzZXIgd2hpY2ggd2FzIHVz + ZWQgZHVyaW5nIGNvbm5lY3Rpb24KICAgICAgICAgICAgaWYgbm90IHNlbGYuX2FyZ19wYXJzZXIu + cmd3X3Bvb2xfcHJlZml4OgogICAgICAgICAgICAgICAgIyBUbyBnZXQgdmFsdWUgJ2RlZmF1bHQn + IHdoaWNoIGlzIHJndyBwb29sIG5hbWUgZnJvbSAnYWxsb3cgcnd4IHBvb2w9ZGVmYXVsdC5yZ3cu + bWV0YScKICAgICAgICAgICAgICAgIHBhdHRlcm4gPSByInBvb2w9KC4qPylcLnJnd1wubWV0YSIK + ICAgICAgICAgICAgICAgIG1hdGNoID0gcmUuc2VhcmNoKHBhdHRlcm4sIGNhcHMpCiAgICAgICAg + ICAgICAgICBpZiBtYXRjaDoKICAgICAgICAgICAgICAgICAgICBzZWxmLl9hcmdfcGFyc2VyLnJn + d19wb29sX3ByZWZpeCA9IG1hdGNoLmdyb3VwKDEpCiAgICAgICAgICAgICAgICBlbHNlOgogICAg + ICAgICAgICAgICAgICAgIHJhaXNlIEV4ZWN1dGlvbkZhaWx1cmVFeGNlcHRpb24oCiAgICAgICAg + ICAgICAgICAgICAgICAgICJmYWlsZWQgdG8gZ2V0IHJndyBwb29sIG5hbWUgZm9yIHVwZ3JhZGUi + CiAgICAgICAgICAgICAgICAgICAgKQoKICAgIGRlZiB1cGdyYWRlX3VzZXJfcGVybWlzc2lvbnMo + c2VsZiwgdXNlcik6CiAgICAgICAgIyBjaGVjayB3aGV0aGVyIHRoZSBnaXZlbiB1c2VyIGV4aXN0 + cyBvciBub3QKICAgICAgICBjbWRfanNvbiA9IHsicHJlZml4IjogImF1dGggZ2V0IiwgImVudGl0 + eSI6IGYie3VzZXJ9IiwgImZvcm1hdCI6ICJqc29uIn0KICAgICAgICByZXRfdmFsLCBqc29uX291 + dCwgZXJyX21zZyA9IHNlbGYuX2NvbW1vbl9jbWRfanNvbl9nZW4oY21kX2pzb24pCiAgICAgICAg + aWYgcmV0X3ZhbCAhPSAwIG9yIGxlbihqc29uX291dCkgPT0gMDoKICAgICAgICAgICAgcHJpbnQo + ZiJ1c2VyIHt1c2VyfSBub3QgZm91bmQgZm9yIHVwZ3JhZGluZy4iKQogICAgICAgICAgICByZXR1 + cm4KICAgICAgICBleGlzdGluZ19jYXBzID0ganNvbl9vdXRbMF1bImNhcHMiXQogICAgICAgIHNl + bGYuZ2V0X3Jnd19wb29sX25hbWVfZHVyaW5nX3VwZ3JhZGUodXNlciwgc3RyKGV4aXN0aW5nX2Nh + cHMpKQogICAgICAgIG5ld19jYXAsIF8gPSBzZWxmLmdldF9jYXBzX2FuZF9lbnRpdHkodXNlcikK + ICAgICAgICBjYXBfa2V5cyA9IFsibW9uIiwgIm1nciIsICJvc2QiLCAibWRzIl0KICAgICAgICBj + YXBzID0gW10KICAgICAgICBmb3IgZWFjaENhcCBpbiBjYXBfa2V5czoKICAgICAgICAgICAgY3Vy + X2NhcF92YWx1ZXMgPSBleGlzdGluZ19jYXBzLmdldChlYWNoQ2FwLCAiIikKICAgICAgICAgICAg + bmV3X2NhcF92YWx1ZXMgPSBuZXdfY2FwLmdldChlYWNoQ2FwLCAiIikKICAgICAgICAgICAgY3Vy + X2NhcF9wZXJtX2xpc3QgPSBbCiAgICAgICAgICAgICAgICB4LnN0cmlwKCkgZm9yIHggaW4gY3Vy + X2NhcF92YWx1ZXMuc3BsaXQoIiwiKSBpZiB4LnN0cmlwKCkKICAgICAgICAgICAgXQogICAgICAg + ICAgICBuZXdfY2FwX3Blcm1fbGlzdCA9IFsKICAgICAgICAgICAgICAgIHguc3RyaXAoKSBmb3Ig + eCBpbiBuZXdfY2FwX3ZhbHVlcy5zcGxpdCgiLCIpIGlmIHguc3RyaXAoKQogICAgICAgICAgICBd + CiAgICAgICAgICAgICMgYXBwZW5kIG5ld19jYXBfbGlzdCB0byBjdXJfY2FwX2xpc3QgdG8gbWFp + bnRhaW4gdGhlIG9yZGVyIG9mIGNhcHMKICAgICAgICAgICAgY3VyX2NhcF9wZXJtX2xpc3QuZXh0 + ZW5kKG5ld19jYXBfcGVybV9saXN0KQogICAgICAgICAgICAjIGVsaW1pbmF0ZSBkdXBsaWNhdGVz + IHdpdGhvdXQgdXNpbmcgJ3NldCcKICAgICAgICAgICAgIyBzZXQgcmUtb3JkZXJzIGl0ZW1zIGlu + IHRoZSBsaXN0IGFuZCB3ZSBoYXZlIHRvIGtlZXAgdGhlIG9yZGVyCiAgICAgICAgICAgIG5ld19j + YXBfbGlzdCA9IFtdCiAgICAgICAgICAgIFtuZXdfY2FwX2xpc3QuYXBwZW5kKHgpIGZvciB4IGlu + IGN1cl9jYXBfcGVybV9saXN0IGlmIHggbm90IGluIG5ld19jYXBfbGlzdF0KICAgICAgICAgICAg + ZXhpc3RpbmdfY2Fwc1tlYWNoQ2FwXSA9ICIsICIuam9pbihuZXdfY2FwX2xpc3QpCiAgICAgICAg + ICAgIGlmIGV4aXN0aW5nX2NhcHNbZWFjaENhcF06CiAgICAgICAgICAgICAgICBjYXBzLmFwcGVu + ZChlYWNoQ2FwKQogICAgICAgICAgICAgICAgY2Fwcy5hcHBlbmQoZXhpc3RpbmdfY2Fwc1tlYWNo + Q2FwXSkKICAgICAgICBjbWRfanNvbiA9IHsKICAgICAgICAgICAgInByZWZpeCI6ICJhdXRoIGNh + cHMiLAogICAgICAgICAgICAiZW50aXR5IjogdXNlciwKICAgICAgICAgICAgImNhcHMiOiBjYXBz + LAogICAgICAgICAgICAiZm9ybWF0IjogImpzb24iLAogICAgICAgIH0KICAgICAgICByZXRfdmFs + LCBqc29uX291dCwgZXJyX21zZyA9IHNlbGYuX2NvbW1vbl9jbWRfanNvbl9nZW4oY21kX2pzb24p + CiAgICAgICAgaWYgcmV0X3ZhbCAhPSAwOgogICAgICAgICAgICByYWlzZSBFeGVjdXRpb25GYWls + dXJlRXhjZXB0aW9uKAogICAgICAgICAgICAgICAgZiInYXV0aCBjYXBzIHt1c2VyfScgY29tbWFu + ZCBmYWlsZWQuXG4gRXJyb3I6IHtlcnJfbXNnfSIKICAgICAgICAgICAgKQogICAgICAgIHByaW50 + KGYiVXBkYXRlZCB1c2VyIHt1c2VyfSBzdWNjZXNzZnVsbHkuIikKCiAgICBkZWYgbWFpbihzZWxm + KToKICAgICAgICBnZW5lcmF0ZWRfb3V0cHV0ID0gIiIKICAgICAgICBpZiBzZWxmLl9hcmdfcGFy + c2VyLnVwZ3JhZGU6CiAgICAgICAgICAgIHNlbGYudXBncmFkZV91c2Vyc19wZXJtaXNzaW9ucygp + CiAgICAgICAgZWxpZiBzZWxmLl9hcmdfcGFyc2VyLmZvcm1hdCA9PSAianNvbiI6CiAgICAgICAg + ICAgIGdlbmVyYXRlZF9vdXRwdXQgP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IKICAgIGV4Y2VwdCBLZXlFcnJvciBh + cyBrRXJyOgogICAgICAgIHByaW50KGYiS2V5RXJyb3I6IHtrRXJyfSIpCiAgICBleGNlcHQgT1NF + cnJvciBhcyBvc0VycjoKICAgICAgICBwcmludChmIkVycm9yIHdoaWxlIHRyeWluZyB0byBvdXRw + dXQgdGhlIGRhdGE6IHtvc0Vycn0iKQogICAgZmluYWxseToKICAgICAgICByak9iai5zaHV0ZG93 + bigpCg== name: rook-ceph-operator.v4.17.0 namespace: placeholder spec: diff --git a/build/makelib/golang.mk b/build/makelib/golang.mk index 86950452e63e..9a8504d0c2e3 100644 --- a/build/makelib/golang.mk +++ b/build/makelib/golang.mk @@ -201,7 +201,7 @@ $(GOFMT): $(GOJUNIT): @echo === installing go-junit-report @mkdir -p $(TOOLS_DIR)/tmp - @curl -sL https://github.com/jstemmer/go-junit-report/releases/download/v2.0.0/go-junit-report-v2.0.0-$(GOOS)-$(GOHOSTARCH).tar.gz | tar -xz -C $(TOOLS_DIR)/tmp + @curl -sL https://github.com/jstemmer/go-junit-report/releases/download/v2.1.0/go-junit-report-v2.1.0-$(GOOS)-$(GOHOSTARCH).tar.gz | tar -xz -C $(TOOLS_DIR)/tmp @mv $(TOOLS_DIR)/tmp/go-junit-report $(TOOLS_DIR) @rm -fr $(TOOLS_DIR)/tmp diff --git a/deploy/charts/rook-ceph/templates/resources.yaml b/deploy/charts/rook-ceph/templates/resources.yaml index c8c58dbc19a3..bac4fb8a1e21 100644 --- a/deploy/charts/rook-ceph/templates/resources.yaml +++ b/deploy/charts/rook-ceph/templates/resources.yaml @@ -3152,6 +3152,12 @@ spec: description: A spec for available storage in the cluster and how it should be used nullable: true properties: + backfillFullRatio: + description: BackfillFullRatio is the ratio at which the cluster is too full for backfill. Backfill will be disabled if above this threshold. Default is 0.90. + maximum: 1 + minimum: 0 + nullable: true + type: number config: additionalProperties: type: string @@ -3192,6 +3198,18 @@ spec: User needs to manually restart the OSD pod if they manage to fix the underlying OSD flapping issue before the restart interval. The sleep will be disabled if this interval is set to 0. type: integer + fullRatio: + description: FullRatio is the ratio at which the cluster is considered full and ceph will stop accepting writes. Default is 0.95. + maximum: 1 + minimum: 0 + nullable: true + type: number + nearFullRatio: + description: NearFullRatio is the ratio at which the cluster is considered nearly full and will raise a ceph health warning. Default is 0.85. + maximum: 1 + minimum: 0 + nullable: true + type: number nodes: items: description: Node is a storage nodes diff --git a/deploy/examples/cluster.yaml b/deploy/examples/cluster.yaml index 1c0c68434075..902577817d3e 100644 --- a/deploy/examples/cluster.yaml +++ b/deploy/examples/cluster.yaml @@ -272,6 +272,12 @@ spec: onlyApplyOSDPlacement: false # Time for which an OSD pod will sleep before restarting, if it stopped due to flapping # flappingRestartIntervalHours: 24 + # The ratio at which Ceph should block IO if the OSDs are too full. The default is 0.95. + # fullRatio: 0.95 + # The ratio at which Ceph should stop backfilling data if the OSDs are too full. The default is 0.90. + # backfillFullRatio: 0.90 + # The ratio at which Ceph should raise a health warning if the OSDs are almost full. The default is 0.85. + # nearFullRatio: 0.85 # The section for configuring management of daemon disruptions during upgrade or fencing. disruptionManagement: # If true, the operator will create and manage PodDisruptionBudgets for OSD, Mon, RGW, and MDS daemons. OSD PDBs are managed dynamically diff --git a/deploy/examples/crds.yaml b/deploy/examples/crds.yaml index a2bfaa060c8b..0a510790c7e6 100644 --- a/deploy/examples/crds.yaml +++ b/deploy/examples/crds.yaml @@ -3150,6 +3150,12 @@ spec: description: A spec for available storage in the cluster and how it should be used nullable: true properties: + backfillFullRatio: + description: BackfillFullRatio is the ratio at which the cluster is too full for backfill. Backfill will be disabled if above this threshold. Default is 0.90. + maximum: 1 + minimum: 0 + nullable: true + type: number config: additionalProperties: type: string @@ -3190,6 +3196,18 @@ spec: User needs to manually restart the OSD pod if they manage to fix the underlying OSD flapping issue before the restart interval. The sleep will be disabled if this interval is set to 0. type: integer + fullRatio: + description: FullRatio is the ratio at which the cluster is considered full and ceph will stop accepting writes. Default is 0.95. + maximum: 1 + minimum: 0 + nullable: true + type: number + nearFullRatio: + description: NearFullRatio is the ratio at which the cluster is considered nearly full and will raise a ceph health warning. Default is 0.85. + maximum: 1 + minimum: 0 + nullable: true + type: number nodes: items: description: Node is a storage nodes diff --git a/deploy/examples/create-external-cluster-resources.py b/deploy/examples/create-external-cluster-resources.py index ce28d7073ce1..e0ccbcaf9496 100644 --- a/deploy/examples/create-external-cluster-resources.py +++ b/deploy/examples/create-external-cluster-resources.py @@ -14,8 +14,6 @@ limitations under the License. """ -# pylint: disable=E0606 - import errno import sys import json @@ -29,12 +27,12 @@ from email.utils import formatdate import requests from requests.auth import AuthBase - -py3k = False -if sys.version_info.major >= 3: - py3k = True - import urllib.parse - from ipaddress import ip_address, IPv4Address +from io import StringIO +from urllib.parse import urlparse +from urllib.parse import urlencode as urlencode +from ipaddress import ip_address +from ipaddress import IPv4Address +from base64 import encodebytes as encodestring ModuleNotFoundError = ImportError @@ -50,27 +48,6 @@ print(f"Error: {noModErr}\nExiting the script...") sys.exit(1) -try: - # for 2.7.x - from StringIO import StringIO -except ModuleNotFoundError: - # for 3.x - from io import StringIO - -try: - # for 2.7.x - from urlparse import urlparse - from urllib import urlencode as urlencode -except ModuleNotFoundError: - # for 3.x - from urllib.parse import urlparse - from urllib.parse import urlencode as urlencode - -try: - from base64 import encodestring -except: - from base64 import encodebytes as encodestring - class ExecutionFailureException(Exception): pass @@ -235,19 +212,14 @@ def __call__(self, r): if "date" not in r.headers and "x-amz-date" not in r.headers: r.headers["date"] = formatdate(timeval=None, localtime=False, usegmt=True) signature = self.get_signature(r) - if py3k: - signature = signature.decode("utf-8") + signature = signature.decode("utf-8") r.headers["Authorization"] = f"AWS {self.access_key}:{signature}" return r def get_signature(self, r): canonical_string = self.get_canonical_string(r.url, r.headers, r.method) - if py3k: - key = self.secret_key.encode("utf-8") - msg = canonical_string.encode("utf-8") - else: - key = self.secret_key - msg = canonical_string + key = self.secret_key.encode("utf-8") + msg = canonical_string.encode("utf-8") h = hmac.new(key, msg, digestmod=sha) return encodestring(h.digest()).strip() @@ -273,12 +245,8 @@ def get_canonical_string(self, url, headers, method): interesting_headers[lk] = headers[key].strip() # If x-amz-date is used it supersedes the date header. - if not py3k: - if "x-amz-date" in interesting_headers: - interesting_headers["date"] = "" - else: - if "x-amz-date" in interesting_headers: - interesting_headers["date"] = "" + if "x-amz-date" in interesting_headers: + interesting_headers["date"] = "" buf = f"{method}\n" for key in sorted(interesting_headers.keys()): @@ -757,6 +725,7 @@ def _convert_hostname_to_ip(self, host_name, port, ip_type): host_ip_type = self._invalid_endpoint(host_addr + ":80") import socket + ip = [] # example output [(, , 6, '', ('93.184.216.34', 80)), ...] # we need to get 93.184.216.34 so it would be ip[0][4][0] if host_ip_type == "IPv6": @@ -1287,16 +1256,6 @@ def create_rgw_admin_ops_user(self): sys.stderr.write(err_msg) return None, None, False, "-1" - # if it is python2, don't check for ceph version for adding `info=read` cap(rgw_validation) - if sys.version_info.major < 3: - jsonoutput = json.loads(output) - return ( - jsonoutput["keys"][0]["access_key"], - jsonoutput["keys"][0]["secret_key"], - False, - "", - ) - # separately add info=read caps for rgw-endpoint ip validation info_cap_supported = True cmd = [ diff --git a/deploy/examples/monitoring/exporter-service-monitor.yaml b/deploy/examples/monitoring/exporter-service-monitor.yaml index b24e0fc9f935..e05012b6e52e 100644 --- a/deploy/examples/monitoring/exporter-service-monitor.yaml +++ b/deploy/examples/monitoring/exporter-service-monitor.yaml @@ -13,7 +13,6 @@ spec: matchLabels: app: rook-ceph-exporter rook_cluster: rook-ceph # namespace:cluster - ceph_daemon_id: exporter endpoints: - port: ceph-exporter-http-metrics path: /metrics diff --git a/go.mod b/go.mod index 78c6def14df6..ec728e98a250 100644 --- a/go.mod +++ b/go.mod @@ -13,8 +13,8 @@ replace ( ) require ( - github.com/IBM/keyprotect-go-client v0.13.0 - github.com/aws/aws-sdk-go v1.53.0 + github.com/IBM/keyprotect-go-client v0.14.0 + github.com/aws/aws-sdk-go v1.53.14 github.com/banzaicloud/k8s-objectmatcher v1.8.0 github.com/ceph/go-ceph v0.27.0 github.com/coreos/pkg v0.0.0-20230601102743-20bbbf26f4d8 @@ -23,13 +23,13 @@ require ( github.com/go-ini/ini v1.67.0 github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.6.0 - github.com/hashicorp/vault/api v1.13.0 + github.com/hashicorp/vault/api v1.14.0 github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.7.0 github.com/kube-object-storage/lib-bucket-provisioner v0.0.0-20221122204822-d1a8c34382f1 github.com/libopenstorage/secrets v0.0.0-20231011182615-5f4b25ceede1 github.com/pkg/errors v0.9.1 - github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.73.2 - github.com/prometheus-operator/prometheus-operator/pkg/client v0.73.2 + github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.74.0 + github.com/prometheus-operator/prometheus-operator/pkg/client v0.74.0 github.com/rook/rook/pkg/apis v0.0.0-20231204200402-5287527732f7 github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 @@ -41,11 +41,11 @@ require ( golang.org/x/sync v0.7.0 gopkg.in/ini.v1 v1.67.0 gopkg.in/yaml.v2 v2.4.0 - k8s.io/api v0.29.3 - k8s.io/apiextensions-apiserver v0.29.3 - k8s.io/apimachinery v0.29.3 + k8s.io/api v0.29.5 + k8s.io/apiextensions-apiserver v0.29.5 + k8s.io/apimachinery v0.29.5 k8s.io/cli-runtime v0.29.3 - k8s.io/client-go v0.29.3 + k8s.io/client-go v0.29.5 k8s.io/cloud-provider v0.29.3 k8s.io/utils v0.0.0-20240310230437-4693a0247e57 sigs.k8s.io/controller-runtime v0.17.2 @@ -103,7 +103,7 @@ require ( github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-retryablehttp v0.7.5 // indirect + github.com/hashicorp/go-retryablehttp v0.7.6 // indirect github.com/hashicorp/go-rootcerts v1.0.2 // indirect github.com/hashicorp/go-secure-stdlib/parseutil v0.1.8 // indirect github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect @@ -144,12 +144,12 @@ require ( github.com/xlab/treeprint v1.2.0 // indirect go.starlark.net v0.0.0-20231121155337-90ade8b19d09 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.21.0 // indirect - golang.org/x/net v0.23.0 // indirect + golang.org/x/crypto v0.23.0 // indirect + golang.org/x/net v0.25.0 // indirect golang.org/x/oauth2 v0.18.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/term v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect golang.org/x/time v0.5.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/appengine v1.6.8 // indirect @@ -157,7 +157,7 @@ require ( gopkg.in/evanphx/json-patch.v5 v5.7.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/component-base v0.29.3 // indirect + k8s.io/component-base v0.29.5 // indirect k8s.io/klog/v2 v2.120.1 // indirect k8s.io/kube-openapi v0.0.0-20240322212309-b815d8309940 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect diff --git a/go.sum b/go.sum index a52b5e4e7bf5..7b1bf231894d 100644 --- a/go.sum +++ b/go.sum @@ -103,8 +103,8 @@ github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1/go.mod h1:wP83 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/IBM/keyprotect-go-client v0.5.1/go.mod h1:5TwDM/4FRJq1ZOlwQL1xFahLWQ3TveR88VmL1u3njyI= -github.com/IBM/keyprotect-go-client v0.13.0 h1:vCCkvD0q5rUA6ssDTbZSJmeO8pCjC7yH985rj2nOs+s= -github.com/IBM/keyprotect-go-client v0.13.0/go.mod h1:cAt714Vnwnd03mmkBHHSJlDNRVthdRmJB6RePd4/B8Q= +github.com/IBM/keyprotect-go-client v0.14.0 h1:GqgK3BdczA/w7+B1RxEPLya0w9S/ZXi5YWKAxdW8vHQ= +github.com/IBM/keyprotect-go-client v0.14.0/go.mod h1:cAt714Vnwnd03mmkBHHSJlDNRVthdRmJB6RePd4/B8Q= github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= @@ -140,8 +140,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkY github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/aws/aws-sdk-go v1.44.164/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/aws/aws-sdk-go v1.53.0 h1:MMo1x1ggPPxDfHMXJnQudTbGXYlD4UigUAud1DJxPVo= -github.com/aws/aws-sdk-go v1.53.0/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.53.14 h1:SzhkC2Pzag0iRW8WBb80RzKdGXDydJR9LAMs2GyKJ2M= +github.com/aws/aws-sdk-go v1.53.14/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/banzaicloud/k8s-objectmatcher v1.8.0 h1:Nugn25elKtPMTA2br+JgHNeSQ04sc05MDPmpJnd1N2A= github.com/banzaicloud/k8s-objectmatcher v1.8.0/go.mod h1:p2LSNAjlECf07fbhDyebTkPUIYnU05G+WfGgkTmgeMg= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= @@ -499,8 +499,9 @@ github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-hclog v0.16.2 h1:K4ev2ib4LdQETX5cSZBG0DVLk1jwGqSPXBjdah3veNs= github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= +github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= @@ -510,8 +511,8 @@ github.com/hashicorp/go-retryablehttp v0.6.2/go.mod h1:gEx6HMUGxYYhJScX7W1Il64m6 github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-retryablehttp v0.7.1/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT9yvm0e+Nd5M= -github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= +github.com/hashicorp/go-retryablehttp v0.7.6 h1:TwRYfx2z2C4cLbXmT8I5PgP/xmuqASDyiVuGYfs9GZM= +github.com/hashicorp/go-retryablehttp v0.7.6/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= @@ -542,8 +543,8 @@ github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2p github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hashicorp/vault/api v1.10.0/go.mod h1:jo5Y/ET+hNyz+JnKDt8XLAdKs+AM0G5W0Vp1IrFI8N8= github.com/hashicorp/vault/api v1.12.0/go.mod h1:si+lJCYO7oGkIoNPAN8j3azBLTn9SjMGS+jFaHd1Cck= -github.com/hashicorp/vault/api v1.13.0 h1:RTCGpE2Rgkn9jyPcFlc7YmNocomda44k5ck8FKMH41Y= -github.com/hashicorp/vault/api v1.13.0/go.mod h1:0cb/uZUv1w2cVu9DIvuW1SMlXXC6qtATJt+LXJRx+kg= +github.com/hashicorp/vault/api v1.14.0 h1:Ah3CFLixD5jmjusOgm8grfN9M0d+Y8fVR2SW0K6pJLU= +github.com/hashicorp/vault/api v1.14.0/go.mod h1:pV9YLxBGSz+cItFDd8Ii4G17waWOQ32zVjMWHe/cOqk= github.com/hashicorp/vault/api/auth/approle v0.5.0/go.mod h1:CHOQIA1AZACfjTzHggmyfiOZ+xCSKNRFqe48FTCzH0k= github.com/hashicorp/vault/api/auth/approle v0.6.0 h1:ELfFFQlTM/e97WJKu1HvNFa7lQ3tlTwwzrR1NJE1V7Y= github.com/hashicorp/vault/api/auth/approle v0.6.0/go.mod h1:CCoIl1xBC3lAWpd1HV+0ovk76Z8b8Mdepyk21h3pGk0= @@ -763,11 +764,11 @@ github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4 github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.44.1/go.mod h1:3WYi4xqXxGGXWDdQIITnLNmuDzO5n6wYva9spVhR4fg= github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.46.0/go.mod h1:3WYi4xqXxGGXWDdQIITnLNmuDzO5n6wYva9spVhR4fg= -github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.73.2 h1:GwlGJPK6vf1UIohpc72KJVkKYlzki1UgE3xC4bWbf20= -github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.73.2/go.mod h1:yJ3CawR/A5qEYFEeCOUVYLTwYxmacfHQhJS+b/2QiaM= +github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.74.0 h1:AHzMWDxNiAVscJL6+4wkvFRTpMnJqiaZFEKA/osaBXE= +github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.74.0/go.mod h1:wAR5JopumPtAZnu0Cjv2PSqV4p4QB09LMhc6fZZTXuA= github.com/prometheus-operator/prometheus-operator/pkg/client v0.46.0/go.mod h1:k4BrWlVQQsvBiTcDnKEMgyh/euRxyxgrHdur/ZX/sdA= -github.com/prometheus-operator/prometheus-operator/pkg/client v0.73.2 h1:cKSYjDjk9Rn/VIFKCh+CCd771ip7VTJzA3fAuKTxY2Q= -github.com/prometheus-operator/prometheus-operator/pkg/client v0.73.2/go.mod h1:mkLwGPvmexoEm6j3bk8gkWNIIFzN2uCs9tRFU2Vsu/I= +github.com/prometheus-operator/prometheus-operator/pkg/client v0.74.0 h1:SyBTzvFuVshDNjDVALs6+NgOy3qh8/xlAsyqB1SzHbI= +github.com/prometheus-operator/prometheus-operator/pkg/client v0.74.0/go.mod h1:FlcnLo14zQxL6P1yPrV22kYBqyAT0ZRRytv98+B7lBQ= github.com/prometheus/client_golang v0.9.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= @@ -958,8 +959,8 @@ golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58 golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1072,8 +1073,8 @@ golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1212,8 +1213,8 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1226,8 +1227,8 @@ golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1245,8 +1246,9 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1582,15 +1584,15 @@ k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= k8s.io/api v0.20.4/go.mod h1:++lNL1AJMkDymriNniQsWRkMDzRaX2Y/POTUi8yvqYQ= k8s.io/api v0.23.5/go.mod h1:Na4XuKng8PXJ2JsploYYrivXrINeTaycCGcYgF91Xm8= k8s.io/api v0.26.0/go.mod h1:k6HDTaIFC8yn1i6pSClSqIwLABIcLV9l5Q4EcngKnQg= -k8s.io/api v0.29.3 h1:2ORfZ7+bGC3YJqGpV0KSDDEVf8hdGQ6A03/50vj8pmw= -k8s.io/api v0.29.3/go.mod h1:y2yg2NTyHUUkIoTC+phinTnEa3KFM6RZ3szxt014a80= +k8s.io/api v0.29.5 h1:levS+umUigHCfI3riD36pMY1vQEbrzh4r1ivVWAhHaI= +k8s.io/api v0.29.5/go.mod h1:7b18TtPcJzdjk7w5zWyIHgoAtpGeRvGGASxlS7UZXdQ= k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8/go.mod h1:IxkesAMoaCRoLrPJdZNZUQp9NfZnzqaVzLhb2VEQzXE= k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY= k8s.io/apiextensions-apiserver v0.18.3/go.mod h1:TMsNGs7DYpMXd+8MOCX8KzPOCx8fnZMoIGB24m03+JE= k8s.io/apiextensions-apiserver v0.18.4/go.mod h1:NYeyeYq4SIpFlPxSAB6jHPIdvu3hL0pc36wuRChybio= k8s.io/apiextensions-apiserver v0.20.1/go.mod h1:ntnrZV+6a3dB504qwC5PN/Yg9PBiDNt1EVqbW2kORVk= -k8s.io/apiextensions-apiserver v0.29.3 h1:9HF+EtZaVpFjStakF4yVufnXGPRppWFEQ87qnO91YeI= -k8s.io/apiextensions-apiserver v0.29.3/go.mod h1:po0XiY5scnpJfFizNGo6puNU6Fq6D70UJY2Cb2KwAVc= +k8s.io/apiextensions-apiserver v0.29.5 h1:njDywexhE6n+1NEl3A4axT0TMQHREnndrk3/ztdWcNE= +k8s.io/apiextensions-apiserver v0.29.5/go.mod h1:pfIvij+MH9a8NQKtW7MD4EFnzvUjJ1ZQsDL8wuP8fnc= k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= k8s.io/apimachinery v0.18.2/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= k8s.io/apimachinery v0.18.3/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko= @@ -1602,8 +1604,8 @@ k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRp k8s.io/apimachinery v0.20.4/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= k8s.io/apimachinery v0.23.5/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= k8s.io/apimachinery v0.26.0/go.mod h1:tnPmbONNJ7ByJNz9+n9kMjNP8ON+1qoAIIC70lztu74= -k8s.io/apimachinery v0.29.3 h1:2tbx+5L7RNvqJjn7RIuIKu9XTsIZ9Z5wX2G22XAa5EU= -k8s.io/apimachinery v0.29.3/go.mod h1:hx/S4V2PNW4OMg3WizRrHutyB5la0iCUbZym+W0EQIU= +k8s.io/apimachinery v0.29.5 h1:Hofa2BmPfpoT+IyDTlcPdCHSnHtEQMoJYGVoQpRTfv4= +k8s.io/apimachinery v0.29.5/go.mod h1:i3FJVwhvSp/6n8Fl4K97PJEP8C+MM+aoDq4+ZJBf70Y= k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw= k8s.io/apiserver v0.18.3/go.mod h1:tHQRmthRPLUtwqsOnJJMoI8SW3lnoReZeE861lH8vUw= k8s.io/apiserver v0.18.4/go.mod h1:q+zoFct5ABNnYkGIaGQ3bcbUNdmPyOCoEBcg51LChY8= @@ -1618,8 +1620,8 @@ k8s.io/client-go v0.19.2/go.mod h1:S5wPhCqyDNAlzM9CnEdgTGV4OqhsW3jGO1UM1epwfJA= k8s.io/client-go v0.20.0/go.mod h1:4KWh/g+Ocd8KkCwKF8vUNnmqgv+EVnQDK4MBF4oB5tY= k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= k8s.io/client-go v0.23.5/go.mod h1:flkeinTO1CirYgzMPRWxUCnV0G4Fbu2vLhYCObnt/r4= -k8s.io/client-go v0.29.3 h1:R/zaZbEAxqComZ9FHeQwOh3Y1ZUs7FaHKZdQtIc2WZg= -k8s.io/client-go v0.29.3/go.mod h1:tkDisCvgPfiRpxGnOORfkljmS+UrW+WtXAy2fTvXJB0= +k8s.io/client-go v0.29.5 h1:nlASXmPQy190qTteaVP31g3c/wi2kycznkTP7Sv1zPc= +k8s.io/client-go v0.29.5/go.mod h1:aY5CnqUUvXYccJhm47XHoPcRyX6vouHdIBHaKZGTbK4= k8s.io/cloud-provider v0.29.3 h1:y39hNq0lrPD1qmqQ2ykwMJGeWF9LsepVkR2a4wskwLc= k8s.io/cloud-provider v0.29.3/go.mod h1:daDV1WkAO6pTrdsn7v8TpN/q9n75ExUC4RJDl7vlPKk= k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= @@ -1632,8 +1634,8 @@ k8s.io/component-base v0.18.2/go.mod h1:kqLlMuhJNHQ9lz8Z7V5bxUUtjFZnrypArGl58gmD k8s.io/component-base v0.18.3/go.mod h1:bp5GzGR0aGkYEfTj+eTY0AN/vXTgkJdQXjNTTVUaa3k= k8s.io/component-base v0.18.4/go.mod h1:7jr/Ef5PGmKwQhyAz/pjByxJbC58mhKAhiaDu0vXfPk= k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk= -k8s.io/component-base v0.29.3 h1:Oq9/nddUxlnrCuuR2K/jp6aflVvc0uDvxMzAWxnGzAo= -k8s.io/component-base v0.29.3/go.mod h1:Yuj33XXjuOk2BAaHsIGHhCKZQAgYKhqIxIjIr2UXYio= +k8s.io/component-base v0.29.5 h1:Ptj8AzG+p8c2a839XriHwxakDpZH9uvIgYz+o1agjg8= +k8s.io/component-base v0.29.5/go.mod h1:9nBUoPxW/yimISIgAG7sJDrUGJlu7t8HnDafIrOdU8Q= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= diff --git a/images/ceph/Dockerfile b/images/ceph/Dockerfile index e1fdf1230b4f..b5bc029e4dc2 100644 --- a/images/ceph/Dockerfile +++ b/images/ceph/Dockerfile @@ -19,8 +19,12 @@ FROM BASEIMAGE ARG S5CMD_VERSION ARG S5CMD_ARCH -# install 'ip' tool for Multus -RUN dnf install -y --repo baseos --setopt=install_weak_deps=False iproute && dnf clean all +# 'ip' tool must be installed for Multus. It's present in the base image today, but it will likely +# be removed in the future. Doing a 'dnf install' sometimes breaks CI when centos repos go down or +# have other package build errors. In order to make sure Rook CI catches the eventual removal and +# also limit Rook CI breakage due to centos breakage, simply check that 'ip' is present. +# Eventually: dnf install -y --repo baseos --setopt=install_weak_deps=False iproute && dnf clean all +RUN which ip # Install the s5cmd package to interact with s3 gateway RUN curl --fail -sSL -o /s5cmd.tar.gz https://github.com/peak/s5cmd/releases/download/v${S5CMD_VERSION}/s5cmd_${S5CMD_VERSION}_${S5CMD_ARCH}.tar.gz && \ diff --git a/pkg/apis/ceph.rook.io/v1/network.go b/pkg/apis/ceph.rook.io/v1/network.go index 629f30a069d0..c950eed22b43 100644 --- a/pkg/apis/ceph.rook.io/v1/network.go +++ b/pkg/apis/ceph.rook.io/v1/network.go @@ -32,8 +32,13 @@ func (n *NetworkSpec) IsMultus() bool { return n.Provider == NetworkProviderMultus } -// IsHost get whether to use host network provider. This method also preserve -// compatibility with the old HostNetwork field. +// IsHost is intended to be used to determine if the rook operator should configure +// managed pods to use host networking. +// This behavior is enabled by configuring the cephCluster with the "host" network provider. +// This method also maintains compatibility with the old HostNetwork setting +// which is incompatible with other network providers: HostNetwork set to true +// together with an empty or unset network provider has the same effect as +// network.Provider set to "host" func (n *NetworkSpec) IsHost() bool { return (n.HostNetwork && n.Provider == NetworkProviderDefault) || n.Provider == NetworkProviderHost } diff --git a/pkg/apis/ceph.rook.io/v1/network_test.go b/pkg/apis/ceph.rook.io/v1/network_test.go index 3e3446257f26..6c6980f2ce8b 100644 --- a/pkg/apis/ceph.rook.io/v1/network_test.go +++ b/pkg/apis/ceph.rook.io/v1/network_test.go @@ -72,10 +72,40 @@ func TestValidateNetworkSpec(t *testing.T) { assert.NoError(t, err) } -func TestNetworkCephIsHostLegacy(t *testing.T) { - net := NetworkSpec{HostNetwork: true} +// test the NetworkSpec.IsHost method with different network providers +// Also test it in combination with the legacy +// "HostNetwork" setting. +func TestNetworkCephIsHost(t *testing.T) { + net := NetworkSpec{HostNetwork: false} + net.Provider = NetworkProviderHost assert.True(t, net.IsHost()) + + net.Provider = NetworkProviderDefault + net.HostNetwork = true + assert.True(t, net.IsHost()) + + net = NetworkSpec{} + net.Provider = NetworkProviderDefault + net.HostNetwork = false + assert.False(t, net.IsHost()) + + net = NetworkSpec{} + net.Provider = NetworkProviderMultus + net.HostNetwork = false + assert.False(t, net.IsHost()) + + net = NetworkSpec{} + net.Provider = NetworkProviderMultus + net.HostNetwork = true + assert.False(t, net.IsHost()) + + // test with nonempty but invalid provider + net = NetworkSpec{} + net.HostNetwork = true + net.Provider = "foo" + assert.False(t, net.IsHost()) + } func TestNetworkSpec(t *testing.T) { diff --git a/pkg/apis/ceph.rook.io/v1/types.go b/pkg/apis/ceph.rook.io/v1/types.go index 306b4078a895..f305f95530a0 100755 --- a/pkg/apis/ceph.rook.io/v1/types.go +++ b/pkg/apis/ceph.rook.io/v1/types.go @@ -2839,6 +2839,24 @@ type StorageScopeSpec struct { // User needs to manually restart the OSD pod if they manage to fix the underlying OSD flapping issue before the restart interval. // The sleep will be disabled if this interval is set to 0. FlappingRestartIntervalHours int `json:"flappingRestartIntervalHours"` + // FullRatio is the ratio at which the cluster is considered full and ceph will stop accepting writes. Default is 0.95. + // +kubebuilder:validation:Minimum=0.0 + // +kubebuilder:validation:Maximum=1.0 + // +optional + // +nullable + FullRatio *float64 `json:"fullRatio,omitempty"` + // NearFullRatio is the ratio at which the cluster is considered nearly full and will raise a ceph health warning. Default is 0.85. + // +kubebuilder:validation:Minimum=0.0 + // +kubebuilder:validation:Maximum=1.0 + // +optional + // +nullable + NearFullRatio *float64 `json:"nearFullRatio,omitempty"` + // BackfillFullRatio is the ratio at which the cluster is too full for backfill. Backfill will be disabled if above this threshold. Default is 0.90. + // +kubebuilder:validation:Minimum=0.0 + // +kubebuilder:validation:Maximum=1.0 + // +optional + // +nullable + BackfillFullRatio *float64 `json:"backfillFullRatio,omitempty"` } // OSDStore is the backend storage type used for creating the OSDs diff --git a/pkg/apis/ceph.rook.io/v1/zz_generated.deepcopy.go b/pkg/apis/ceph.rook.io/v1/zz_generated.deepcopy.go index 61e94d216c19..913fd8476794 100644 --- a/pkg/apis/ceph.rook.io/v1/zz_generated.deepcopy.go +++ b/pkg/apis/ceph.rook.io/v1/zz_generated.deepcopy.go @@ -4533,6 +4533,21 @@ func (in *StorageScopeSpec) DeepCopyInto(out *StorageScopeSpec) { } } out.Store = in.Store + if in.FullRatio != nil { + in, out := &in.FullRatio, &out.FullRatio + *out = new(float64) + **out = **in + } + if in.NearFullRatio != nil { + in, out := &in.NearFullRatio, &out.NearFullRatio + *out = new(float64) + **out = **in + } + if in.BackfillFullRatio != nil { + in, out := &in.BackfillFullRatio, &out.BackfillFullRatio + *out = new(float64) + **out = **in + } return } diff --git a/pkg/apis/go.mod b/pkg/apis/go.mod index f0a22e25f8a1..107e76e2883f 100644 --- a/pkg/apis/go.mod +++ b/pkg/apis/go.mod @@ -13,14 +13,14 @@ replace ( ) require ( - github.com/hashicorp/vault/api v1.13.0 + github.com/hashicorp/vault/api v1.14.0 github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.7.0 github.com/kube-object-storage/lib-bucket-provisioner v0.0.0-20221122204822-d1a8c34382f1 github.com/libopenstorage/secrets v0.0.0-20231011182615-5f4b25ceede1 github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.9.0 - k8s.io/api v0.29.3 - k8s.io/apimachinery v0.29.3 + k8s.io/api v0.29.5 + k8s.io/apimachinery v0.29.5 ) require ( @@ -29,7 +29,7 @@ require ( github.com/google/uuid v1.6.0 // indirect github.com/onsi/ginkgo/v2 v2.14.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - k8s.io/client-go v0.29.3 // indirect + k8s.io/client-go v0.29.5 // indirect k8s.io/utils v0.0.0-20240310230437-4693a0247e57 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) @@ -52,7 +52,7 @@ require ( github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-retryablehttp v0.7.5 // indirect + github.com/hashicorp/go-retryablehttp v0.7.6 // indirect github.com/hashicorp/go-rootcerts v1.0.2 // indirect github.com/hashicorp/go-secure-stdlib/parseutil v0.1.8 // indirect github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect @@ -72,12 +72,12 @@ require ( github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/ryanuber/go-glob v1.0.0 // indirect github.com/sirupsen/logrus v1.9.3 // indirect - golang.org/x/crypto v0.21.0 // indirect - golang.org/x/net v0.23.0 // indirect + golang.org/x/crypto v0.23.0 // indirect + golang.org/x/net v0.25.0 // indirect golang.org/x/oauth2 v0.18.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/term v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/protobuf v1.33.0 // indirect diff --git a/pkg/apis/go.sum b/pkg/apis/go.sum index 94b8f5c14e67..743424facb94 100644 --- a/pkg/apis/go.sum +++ b/pkg/apis/go.sum @@ -426,8 +426,9 @@ github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-hclog v0.16.2 h1:K4ev2ib4LdQETX5cSZBG0DVLk1jwGqSPXBjdah3veNs= github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= +github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= @@ -436,8 +437,8 @@ github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9 github.com/hashicorp/go-retryablehttp v0.6.2/go.mod h1:gEx6HMUGxYYhJScX7W1Il64m6cc2C1mDaW3NQ9sY1FY= github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-retryablehttp v0.7.1/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT9yvm0e+Nd5M= -github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= +github.com/hashicorp/go-retryablehttp v0.7.6 h1:TwRYfx2z2C4cLbXmT8I5PgP/xmuqASDyiVuGYfs9GZM= +github.com/hashicorp/go-retryablehttp v0.7.6/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= @@ -467,8 +468,8 @@ github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2p github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hashicorp/vault/api v1.10.0/go.mod h1:jo5Y/ET+hNyz+JnKDt8XLAdKs+AM0G5W0Vp1IrFI8N8= github.com/hashicorp/vault/api v1.12.0/go.mod h1:si+lJCYO7oGkIoNPAN8j3azBLTn9SjMGS+jFaHd1Cck= -github.com/hashicorp/vault/api v1.13.0 h1:RTCGpE2Rgkn9jyPcFlc7YmNocomda44k5ck8FKMH41Y= -github.com/hashicorp/vault/api v1.13.0/go.mod h1:0cb/uZUv1w2cVu9DIvuW1SMlXXC6qtATJt+LXJRx+kg= +github.com/hashicorp/vault/api v1.14.0 h1:Ah3CFLixD5jmjusOgm8grfN9M0d+Y8fVR2SW0K6pJLU= +github.com/hashicorp/vault/api v1.14.0/go.mod h1:pV9YLxBGSz+cItFDd8Ii4G17waWOQ32zVjMWHe/cOqk= github.com/hashicorp/vault/api/auth/approle v0.5.0/go.mod h1:CHOQIA1AZACfjTzHggmyfiOZ+xCSKNRFqe48FTCzH0k= github.com/hashicorp/vault/api/auth/approle v0.6.0 h1:ELfFFQlTM/e97WJKu1HvNFa7lQ3tlTwwzrR1NJE1V7Y= github.com/hashicorp/vault/api/auth/approle v0.6.0/go.mod h1:CCoIl1xBC3lAWpd1HV+0ovk76Z8b8Mdepyk21h3pGk0= @@ -802,8 +803,8 @@ golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58 golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -913,8 +914,8 @@ golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1050,8 +1051,8 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1064,8 +1065,8 @@ golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1083,8 +1084,9 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1402,8 +1404,8 @@ k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= k8s.io/api v0.20.4/go.mod h1:++lNL1AJMkDymriNniQsWRkMDzRaX2Y/POTUi8yvqYQ= k8s.io/api v0.23.5/go.mod h1:Na4XuKng8PXJ2JsploYYrivXrINeTaycCGcYgF91Xm8= k8s.io/api v0.26.0/go.mod h1:k6HDTaIFC8yn1i6pSClSqIwLABIcLV9l5Q4EcngKnQg= -k8s.io/api v0.29.3 h1:2ORfZ7+bGC3YJqGpV0KSDDEVf8hdGQ6A03/50vj8pmw= -k8s.io/api v0.29.3/go.mod h1:y2yg2NTyHUUkIoTC+phinTnEa3KFM6RZ3szxt014a80= +k8s.io/api v0.29.5 h1:levS+umUigHCfI3riD36pMY1vQEbrzh4r1ivVWAhHaI= +k8s.io/api v0.29.5/go.mod h1:7b18TtPcJzdjk7w5zWyIHgoAtpGeRvGGASxlS7UZXdQ= k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8/go.mod h1:IxkesAMoaCRoLrPJdZNZUQp9NfZnzqaVzLhb2VEQzXE= k8s.io/apiextensions-apiserver v0.18.3/go.mod h1:TMsNGs7DYpMXd+8MOCX8KzPOCx8fnZMoIGB24m03+JE= k8s.io/apiextensions-apiserver v0.20.1/go.mod h1:ntnrZV+6a3dB504qwC5PN/Yg9PBiDNt1EVqbW2kORVk= @@ -1416,8 +1418,8 @@ k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRp k8s.io/apimachinery v0.20.4/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= k8s.io/apimachinery v0.23.5/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= k8s.io/apimachinery v0.26.0/go.mod h1:tnPmbONNJ7ByJNz9+n9kMjNP8ON+1qoAIIC70lztu74= -k8s.io/apimachinery v0.29.3 h1:2tbx+5L7RNvqJjn7RIuIKu9XTsIZ9Z5wX2G22XAa5EU= -k8s.io/apimachinery v0.29.3/go.mod h1:hx/S4V2PNW4OMg3WizRrHutyB5la0iCUbZym+W0EQIU= +k8s.io/apimachinery v0.29.5 h1:Hofa2BmPfpoT+IyDTlcPdCHSnHtEQMoJYGVoQpRTfv4= +k8s.io/apimachinery v0.29.5/go.mod h1:i3FJVwhvSp/6n8Fl4K97PJEP8C+MM+aoDq4+ZJBf70Y= k8s.io/apiserver v0.18.3/go.mod h1:tHQRmthRPLUtwqsOnJJMoI8SW3lnoReZeE861lH8vUw= k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= k8s.io/client-go v0.18.3/go.mod h1:4a/dpQEvzAhT1BbuWW09qvIaGw6Gbu1gZYiQZIi1DMw= @@ -1426,8 +1428,8 @@ k8s.io/client-go v0.19.2/go.mod h1:S5wPhCqyDNAlzM9CnEdgTGV4OqhsW3jGO1UM1epwfJA= k8s.io/client-go v0.20.0/go.mod h1:4KWh/g+Ocd8KkCwKF8vUNnmqgv+EVnQDK4MBF4oB5tY= k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= k8s.io/client-go v0.23.5/go.mod h1:flkeinTO1CirYgzMPRWxUCnV0G4Fbu2vLhYCObnt/r4= -k8s.io/client-go v0.29.3 h1:R/zaZbEAxqComZ9FHeQwOh3Y1ZUs7FaHKZdQtIc2WZg= -k8s.io/client-go v0.29.3/go.mod h1:tkDisCvgPfiRpxGnOORfkljmS+UrW+WtXAy2fTvXJB0= +k8s.io/client-go v0.29.5 h1:nlASXmPQy190qTteaVP31g3c/wi2kycznkTP7Sv1zPc= +k8s.io/client-go v0.29.5/go.mod h1:aY5CnqUUvXYccJhm47XHoPcRyX6vouHdIBHaKZGTbK4= k8s.io/code-generator v0.18.3/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= k8s.io/code-generator v0.19.0/go.mod h1:moqLn7w0t9cMs4+5CQyxnfA/HV8MF6aAVENF+WZZhgk= k8s.io/code-generator v0.20.0/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg= diff --git a/pkg/daemon/ceph/client/osd.go b/pkg/daemon/ceph/client/osd.go index bfdb7da4b617..65c266d2d434 100644 --- a/pkg/daemon/ceph/client/osd.go +++ b/pkg/daemon/ceph/client/osd.go @@ -65,8 +65,11 @@ type OSDDump struct { Up json.Number `json:"up"` In json.Number `json:"in"` } `json:"osds"` - Flags string `json:"flags"` - CrushNodeFlags map[string][]string `json:"crush_node_flags"` + Flags string `json:"flags"` + CrushNodeFlags map[string][]string `json:"crush_node_flags"` + FullRatio float64 `json:"full_ratio"` + BackfillFullRatio float64 `json:"backfillfull_ratio"` + NearFullRatio float64 `json:"nearfull_ratio"` } // IsFlagSet checks if an OSD flag is set diff --git a/pkg/daemon/multus/nginx-config.yaml b/pkg/daemon/multus/nginx-config.yaml index 57793c1a7d5f..27bde08a7642 100644 --- a/pkg/daemon/multus/nginx-config.yaml +++ b/pkg/daemon/multus/nginx-config.yaml @@ -7,7 +7,10 @@ metadata: data: server.conf: | server { + # listen on all IPv4 addrs listen 8080; + # listen on all IPv6 addrs + listen [::]:8080; server_name localhost; # return the client ip upon connect diff --git a/pkg/daemon/multus/templates.go b/pkg/daemon/multus/templates.go index f7aab51f2f99..275e0f2a879c 100644 --- a/pkg/daemon/multus/templates.go +++ b/pkg/daemon/multus/templates.go @@ -113,6 +113,12 @@ func (vt *ValidationTest) generateClientTemplateConfig( if attachCluster && serverClusterAddr != "" { netNamesAndAddresses["cluster"] = serverClusterAddr } + for name, addr := range netNamesAndAddresses { + if strings.Contains(addr, ":") { + // it's an IPv6 address and needs square brackets around it to support : addition + netNamesAndAddresses[name] = "[" + addr + "]" + } + } return clientTemplateConfig{ NodeType: nodeType, ClientType: clientType, diff --git a/pkg/operator/ceph/cluster/cluster.go b/pkg/operator/ceph/cluster/cluster.go index 344da2b4e163..e3c6e8df710c 100755 --- a/pkg/operator/ceph/cluster/cluster.go +++ b/pkg/operator/ceph/cluster/cluster.go @@ -20,6 +20,7 @@ package cluster import ( "context" "fmt" + "math" "os" "os/exec" "path" @@ -474,6 +475,10 @@ func (c *cluster) postMonStartupActions() error { return errors.Wrap(err, "") } + if err := c.configureStorageSettings(); err != nil { + return errors.Wrap(err, "failed to configure storage settings") + } + crushRoot := client.GetCrushRootFromSpec(c.Spec) if crushRoot != "default" { // Remove the root=default and replicated_rule which are created by @@ -492,6 +497,65 @@ func (c *cluster) postMonStartupActions() error { return nil } +func (c *cluster) configureStorageSettings() error { + if !c.shouldSetClusterFullSettings() { + return nil + } + osdDump, err := client.GetOSDDump(c.context, c.ClusterInfo) + if err != nil { + return errors.Wrap(err, "failed to get osd dump for setting cluster full settings") + } + + if err := c.setClusterFullRatio("set-full-ratio", c.Spec.Storage.FullRatio, osdDump.FullRatio); err != nil { + return err + } + + if err := c.setClusterFullRatio("set-backfillfull-ratio", c.Spec.Storage.BackfillFullRatio, osdDump.BackfillFullRatio); err != nil { + return err + } + + if err := c.setClusterFullRatio("set-nearfull-ratio", c.Spec.Storage.NearFullRatio, osdDump.NearFullRatio); err != nil { + return err + } + + return nil +} + +func (c *cluster) setClusterFullRatio(ratioCommand string, desiredRatio *float64, actualRatio float64) error { + if !shouldUpdateFloatSetting(desiredRatio, actualRatio) { + if desiredRatio != nil { + logger.Infof("desired value %s=%.2f is already set", ratioCommand, *desiredRatio) + } + return nil + } + desiredStringVal := fmt.Sprintf("%.2f", *desiredRatio) + logger.Infof("updating %s from %.2f to %s", ratioCommand, actualRatio, desiredStringVal) + args := []string{"osd", ratioCommand, desiredStringVal} + cephCmd := client.NewCephCommand(c.context, c.ClusterInfo, args) + output, err := cephCmd.Run() + if err != nil { + return errors.Wrapf(err, "failed to update %s to %q. %s", ratioCommand, desiredStringVal, output) + } + return nil +} + +func shouldUpdateFloatSetting(desired *float64, actual float64) bool { + if desired == nil { + return false + } + if *desired == actual { + return false + } + if actual != 0 && math.Abs(*desired-actual)/actual > 0.01 { + return true + } + return false +} + +func (c *cluster) shouldSetClusterFullSettings() bool { + return c.Spec.Storage.FullRatio != nil || c.Spec.Storage.BackfillFullRatio != nil || c.Spec.Storage.NearFullRatio != nil +} + func (c *cluster) updateConfigStoreFromCRD() error { monStore := config.GetMonStore(c.context, c.ClusterInfo) return monStore.SetAllMultiple(c.Spec.CephConfig) diff --git a/pkg/operator/ceph/cluster/cluster_test.go b/pkg/operator/ceph/cluster/cluster_test.go index 84f86e29d1ab..6656ee1bb641 100644 --- a/pkg/operator/ceph/cluster/cluster_test.go +++ b/pkg/operator/ceph/cluster/cluster_test.go @@ -335,3 +335,98 @@ func TestTelemetry(t *testing.T) { c.reportTelemetry() }) } +func TestClusterFullSettings(t *testing.T) { + actualFullRatio := 0.95 + actualBackfillFullRatio := 0.90 + actualNearFullRatio := 0.85 + setFullRatio := false + setBackfillFullRatio := false + setNearFullRatio := false + clientset := testop.New(t, 1) + context := &clusterd.Context{Clientset: clientset} + c := cluster{ + context: context, + ClusterInfo: cephclient.AdminTestClusterInfo("cluster"), + Spec: &cephv1.ClusterSpec{}, + } + context.Executor = &exectest.MockExecutor{ + MockExecuteCommandWithOutput: func(command string, args ...string) (string, error) { + logger.Infof("Command: %s %v", command, args) + if args[0] == "osd" { + if args[1] == "dump" { + return fmt.Sprintf( + `{ "full_ratio": %.2f, + "backfillfull_ratio": %.2f, + "nearfull_ratio": %.2f}`, actualFullRatio, actualBackfillFullRatio, actualNearFullRatio), nil + } + if args[1] == "set-full-ratio" { + assert.Equal(t, fmt.Sprintf("%.2f", *c.Spec.Storage.FullRatio), args[2]) + setFullRatio = true + return "", nil + } + if args[1] == "set-nearfull-ratio" { + assert.Equal(t, fmt.Sprintf("%.2f", *c.Spec.Storage.NearFullRatio), args[2]) + setNearFullRatio = true + return "", nil + } + if args[1] == "set-backfillfull-ratio" { + assert.Equal(t, fmt.Sprintf("%.2f", *c.Spec.Storage.BackfillFullRatio), args[2]) + setBackfillFullRatio = true + return "", nil + } + } + return "", errors.New("mock error to simulate failure of mon store config") + }, + } + t.Run("no settings", func(t *testing.T) { + err := c.configureStorageSettings() + assert.NoError(t, err) + assert.False(t, setFullRatio) + assert.False(t, setNearFullRatio) + assert.False(t, setBackfillFullRatio) + }) + + val91 := 0.91 + val90 := 0.90 + val85 := 0.85 + val80 := 0.80 + + t.Run("all settings applied", func(t *testing.T) { + c.Spec.Storage.FullRatio = &val90 + c.Spec.Storage.NearFullRatio = &val80 + c.Spec.Storage.BackfillFullRatio = &val85 + err := c.configureStorageSettings() + assert.NoError(t, err) + assert.True(t, setFullRatio) + assert.True(t, setNearFullRatio) + assert.True(t, setBackfillFullRatio) + }) + + t.Run("no settings changed", func(t *testing.T) { + setFullRatio = false + setBackfillFullRatio = false + setNearFullRatio = false + c.Spec.Storage.FullRatio = &actualFullRatio + c.Spec.Storage.NearFullRatio = &actualNearFullRatio + c.Spec.Storage.BackfillFullRatio = &actualBackfillFullRatio + err := c.configureStorageSettings() + assert.NoError(t, err) + assert.False(t, setFullRatio) + assert.False(t, setNearFullRatio) + assert.False(t, setBackfillFullRatio) + }) + + t.Run("one setting applied", func(t *testing.T) { + setFullRatio = false + setBackfillFullRatio = false + setNearFullRatio = false + c.Spec.Storage.FullRatio = &val91 + c.Spec.Storage.NearFullRatio = nil + c.Spec.Storage.BackfillFullRatio = nil + err := c.configureStorageSettings() + assert.NoError(t, err) + assert.True(t, setFullRatio) + assert.False(t, setNearFullRatio) + assert.False(t, setBackfillFullRatio) + }) +} diff --git a/pkg/operator/ceph/cluster/mgr/mgr.go b/pkg/operator/ceph/cluster/mgr/mgr.go index 975f469f5771..e75180063241 100644 --- a/pkg/operator/ceph/cluster/mgr/mgr.go +++ b/pkg/operator/ceph/cluster/mgr/mgr.go @@ -585,10 +585,10 @@ func applyMonitoringLabels(c *Cluster, serviceMonitor *monitoringv1.ServiceMonit if managedBy, ok := monitoringLabels["rook.io/managedBy"]; ok { relabelConfig := monitoringv1.RelabelConfig{ TargetLabel: "managedBy", - Replacement: managedBy, + Replacement: &managedBy, } serviceMonitor.Spec.Endpoints[0].RelabelConfigs = append( - serviceMonitor.Spec.Endpoints[0].RelabelConfigs, &relabelConfig) + serviceMonitor.Spec.Endpoints[0].RelabelConfigs, relabelConfig) } else { logger.Info("rook.io/managedBy not specified in monitoring labels") } diff --git a/pkg/operator/ceph/cluster/mgr/mgr_test.go b/pkg/operator/ceph/cluster/mgr/mgr_test.go index 2499856ebdf4..bd17e4135a3a 100644 --- a/pkg/operator/ceph/cluster/mgr/mgr_test.go +++ b/pkg/operator/ceph/cluster/mgr/mgr_test.go @@ -375,7 +375,7 @@ func TestApplyMonitoringLabels(t *testing.T) { applyMonitoringLabels(c, sm) fmt.Printf("Hello1") assert.Equal(t, "managedBy", sm.Spec.Endpoints[0].RelabelConfigs[0].TargetLabel) - assert.Equal(t, "storagecluster", sm.Spec.Endpoints[0].RelabelConfigs[0].Replacement) + assert.Equal(t, "storagecluster", *sm.Spec.Endpoints[0].RelabelConfigs[0].Replacement) // Service Monitor RelabelConfigs not updated when the required monitoring label is not found monitoringLabels = cephv1.LabelsSpec{ diff --git a/pkg/operator/ceph/cluster/mon/node.go b/pkg/operator/ceph/cluster/mon/node.go index 9c353c66eaef..09c2d9eb4013 100644 --- a/pkg/operator/ceph/cluster/mon/node.go +++ b/pkg/operator/ceph/cluster/mon/node.go @@ -22,12 +22,24 @@ import ( v1 "k8s.io/api/core/v1" ) +const ( + monIPAnnotation = "network.rook.io/mon-ip" +) + func getNodeInfoFromNode(n v1.Node) (*opcontroller.MonScheduleInfo, error) { nr := &opcontroller.MonScheduleInfo{ Name: n.Name, Hostname: n.Labels[v1.LabelHostname], } + // If the host networking is setup such that a different IP should be used + // than the one that is to the K8s node. + if customIP, ok := n.Annotations[monIPAnnotation]; ok { + logger.Infof("found %s annotation on node %q --> %q", monIPAnnotation, n.Name, customIP) + nr.Address = customIP + return nr, nil + } + for _, ip := range n.Status.Addresses { if ip.Type == v1.NodeInternalIP { logger.Debugf("using internal IP %s for node %s", ip.Address, n.Name) diff --git a/pkg/operator/ceph/cluster/mon/node_test.go b/pkg/operator/ceph/cluster/mon/node_test.go index 9c555b837d1f..cac949235f50 100644 --- a/pkg/operator/ceph/cluster/mon/node_test.go +++ b/pkg/operator/ceph/cluster/mon/node_test.go @@ -246,4 +246,11 @@ func TestGetNodeInfoFromNode(t *testing.T) { info, err = getNodeInfoFromNode(*node) assert.NoError(t, err) assert.Equal(t, "1.2.3.4", info.Address) + + node.Annotations = map[string]string{ + monIPAnnotation: "9.8.7.6", + } + info, err = getNodeInfoFromNode(*node) + assert.NoError(t, err) + assert.Equal(t, "9.8.7.6", info.Address) } diff --git a/pkg/operator/ceph/cluster/nodedaemon/exporter.go b/pkg/operator/ceph/cluster/nodedaemon/exporter.go index a92834ccb702..070bee756301 100644 --- a/pkg/operator/ceph/cluster/nodedaemon/exporter.go +++ b/pkg/operator/ceph/cluster/nodedaemon/exporter.go @@ -267,10 +267,10 @@ func applyCephExporterLabels(cephCluster cephv1.CephCluster, serviceMonitor *mon if managedBy, ok := cephExporterLabels["rook.io/managedBy"]; ok { relabelConfig := monitoringv1.RelabelConfig{ TargetLabel: "managedBy", - Replacement: managedBy, + Replacement: &managedBy, } serviceMonitor.Spec.Endpoints[0].RelabelConfigs = append( - serviceMonitor.Spec.Endpoints[0].RelabelConfigs, &relabelConfig) + serviceMonitor.Spec.Endpoints[0].RelabelConfigs, relabelConfig) } else { logger.Info("rook.io/managedBy not specified in ceph-exporter labels") } diff --git a/pkg/operator/ceph/cluster/nodedaemon/exporter_test.go b/pkg/operator/ceph/cluster/nodedaemon/exporter_test.go index 6a72b1776bf9..2a6adc90cd22 100644 --- a/pkg/operator/ceph/cluster/nodedaemon/exporter_test.go +++ b/pkg/operator/ceph/cluster/nodedaemon/exporter_test.go @@ -192,7 +192,7 @@ func TestApplyCephExporterLabels(t *testing.T) { applyCephExporterLabels(cephCluster, sm) fmt.Printf("Hello1") assert.Equal(t, "managedBy", sm.Spec.Endpoints[0].RelabelConfigs[0].TargetLabel) - assert.Equal(t, "storagecluster", sm.Spec.Endpoints[0].RelabelConfigs[0].Replacement) + assert.Equal(t, "storagecluster", *sm.Spec.Endpoints[0].RelabelConfigs[0].Replacement) // Service Monitor RelabelConfigs not updated when the required monitoring label is not found monitoringLabels = cephv1.LabelsSpec{ diff --git a/tests/framework/installer/ceph_manifests.go b/tests/framework/installer/ceph_manifests.go index bb8fb0175ae2..7aeb28bd1018 100644 --- a/tests/framework/installer/ceph_manifests.go +++ b/tests/framework/installer/ceph_manifests.go @@ -238,6 +238,14 @@ spec: config: databaseSizeMB: "1024" ` + // Append the storage settings if it's not an upgrade from 1.13 where the settings do not exist + if m.settings.RookVersion != Version1_13 { + clusterSpec += ` + fullRatio: 0.96 + backfillFullRatio: 0.91 + nearFullRatio: 0.88 +` + } } if m.settings.ConnectionsEncrypted { diff --git a/tests/scripts/multus/default-public-cluster-nads.yaml b/tests/scripts/multus/default-public-cluster-nads.yaml index bfb5898b5cc6..bd8e96b51321 100644 --- a/tests/scripts/multus/default-public-cluster-nads.yaml +++ b/tests/scripts/multus/default-public-cluster-nads.yaml @@ -17,4 +17,4 @@ metadata: labels: annotations: spec: - config: '{ "cniVersion": "0.3.1", "type": "macvlan", "master": "eth0", "mode": "bridge", "ipam": { "type": "whereabouts", "range": "192.168.30.0/24" } }' + config: '{ "cniVersion": "0.3.1", "type": "macvlan", "master": "eth0", "mode": "bridge", "ipam": { "type": "whereabouts", "range": "fc00::/96" } }'