Esempio n. 1
0
 def _disable_verify_ssl() -> None:
     if hasattr(Configuration, 'get_default_copy'):
         configuration = Configuration.get_default_copy()
     else:
         configuration = Configuration()
     configuration.verify_ssl = False
     Configuration.set_default(configuration)
Esempio n. 2
0
def main():
    config.load_kube_config()
    c = Configuration.get_default_copy()
    c.assert_hostname = False
    Configuration.set_default(c)
    core_v1 = core_v1_api.CoreV1Api()

    portforward_commands(core_v1)
Esempio n. 3
0
    def testDefaultConfiguration(self):
        # prepare default configuration
        c1 = Configuration(host="example.com")
        c1.debug = True
        Configuration.set_default(c1)

        # get default configuration
        c2 = Configuration.get_default_copy()
        self.assertEqual(c2.host, "example.com")
        self.assertTrue(c2.debug)

        self.assertNotEqual(id(c1.api_key), id(c2.api_key))
        self.assertNotEqual(id(c1.api_key_prefix), id(c2.api_key_prefix))