{"action":"created","comment":{"url":"https://api.github.com/repos/projectatomic/atomicapp/pulls/comments/64750094","id":64750094,"diff_hunk":"@@ -38,227 +44,243 @@ class KubernetesProvider(Provider):\n     This class implements deploy, stop and undeploy of an atomicapp on\n     Kubernetes provider.\n     \"\"\"\n+\n+    # Class variables\n     key = \"kubernetes\"\n+    namespace = DEFAULT_NAMESPACE\n+    k8s_artifacts = {}\n+\n+    # From the provider configuration\n     config_file = None\n-    kubectl = None\n \n-    def init(self):\n-        self.namespace = \"default\"\n+    # Essential provider parameters\n+    provider_api = \"http://localhost:8080\"\n+    provider_auth = None\n+    provider_tls_verify = None\n+    provider_ca = None\n \n-        self.k8s_manifests = []\n+    def init(self):\n+        self.k8s_artifacts = {}\n \n         logger.debug(\"Given config: %s\", self.config)\n         if self.config.get(\"namespace\"):\n             self.namespace = self.config.get(\"namespace\")\n \n         logger.info(\"Using namespace %s\", self.namespace)\n-        if self.container:\n-            self.kubectl = self._find_kubectl(Utils.getRoot())\n-            kube_conf_path = \"/etc/kubernetes\"\n-            host_kube_conf_path = Utils.get_real_abspath(kube_conf_path)\n-            if not os.path.exists(kube_conf_path) and os.path.exists(host_kube_conf_path):\n-                if self.dryrun:\n-                    logger.info(\"DRY-RUN: link %s from %s\" % (kube_conf_path, host_kube_conf_path))\n-                else:\n-                    os.symlink(host_kube_conf_path, kube_conf_path)\n-        else:\n-            self.kubectl = self._find_kubectl()\n+\n+        self._process_artifacts()\n \n         if not self.dryrun:\n-            if not os.access(self.kubectl, os.X_OK):\n-                raise ProviderFailedException(\"Command: \" + self.kubectl + \" not found\")\n \n-            # Check if Kubernetes config file is accessible, but only\n-            # if one was provided by the user; config file is optional.\n-            if self.config_file:\n-                self.checkConfigFile()\n+            '''\n+            Config_file:\n+                If a config_file has been provided, use the configuration\n+                from the file and load the associated generated file.\n+                If a config_file exists (--provider-config) use that.\n \n-    def _find_kubectl(self, prefix=\"\"):\n-        \"\"\"Determine the path to the kubectl program on the host.\n-        1) Check the config for a provider_cli in the general section\n-           remember to add /host prefix\n-        2) Search /usr/bin:/usr/local/bin\n+            Params:\n+                If any provider specific parameters have been provided,\n+                load the configuration through the answers.conf file\n \n-        Use the first valid value found\n-        \"\"\"\n+            .kube/config doesn't exist:\n+                If the configuration file does not exist, generate one using\n+                the default localhost:8080/api end-point.\n+\n+            Default configuration:\n+                If no paramaters have been provided, as well as no --provider-config,\n+                use the default .kube/config location and load the associated configuration.","path":"atomicapp/providers/kubernetes.py","position":101,"original_position":101,"commit_id":"1ed8d245e6750fd8dbe3a8b23a44a66cc5b7973e","original_commit_id":"1ed8d245e6750fd8dbe3a8b23a44a66cc5b7973e","user":{"login":"dustymabe","id":4530030,"avatar_url":"https://avatars.githubusercontent.com/u/4530030?v=3","gravatar_id":"","url":"https://api.github.com/users/dustymabe","html_url":"https://github.com/dustymabe","followers_url":"https://api.github.com/users/dustymabe/followers","following_url":"https://api.github.com/users/dustymabe/following{/other_user}","gists_url":"https://api.github.com/users/dustymabe/gists{/gist_id}","starred_url":"https://api.github.com/users/dustymabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dustymabe/subscriptions","organizations_url":"https://api.github.com/users/dustymabe/orgs","repos_url":"https://api.github.com/users/dustymabe/repos","events_url":"https://api.github.com/users/dustymabe/events{/privacy}","received_events_url":"https://api.github.com/users/dustymabe/received_events","type":"User","site_admin":false},"body":"I think these last two could use some more clarity. How about: \r\n\r\n```\r\n            .kube/config:\r\n                If no config file or params are provided by user then try to find and\r\n                use a config file at the default location.\r\n\r\n            no config at all:\r\n                If no .kube/config file can be found then try to connect to the default\r\n                unauthenticated http://localhost:8080/api end-point.\r\n```","created_at":"2016-05-26T14:00:57Z","updated_at":"2016-05-26T14:00:57Z","html_url":"https://github.com/projectatomic/atomicapp/pull/712#discussion_r64750094","pull_request_url":"https://api.github.com/repos/projectatomic/atomicapp/pulls/712","_links":{"self":{"href":"https://api.github.com/repos/projectatomic/atomicapp/pulls/comments/64750094"},"html":{"href":"https://github.com/projectatomic/atomicapp/pull/712#discussion_r64750094"},"pull_request":{"href":"https://api.github.com/repos/projectatomic/atomicapp/pulls/712"}}},"pull_request":{"url":"https://api.github.com/repos/projectatomic/atomicapp/pulls/712","id":67772756,"html_url":"https://github.com/projectatomic/atomicapp/pull/712","diff_url":"https://github.com/projectatomic/atomicapp/pull/712.diff","patch_url":"https://github.com/projectatomic/atomicapp/pull/712.patch","issue_url":"https://api.github.com/repos/projectatomic/atomicapp/issues/712","number":712,"state":"open","locked":false,"title":"Add a new 'library' for k8s/openshift providers.","user":{"login":"cdrage","id":6422176,"avatar_url":"https://avatars.githubusercontent.com/u/6422176?v=3","gravatar_id":"","url":"https://api.github.com/users/cdrage","html_url":"https://github.com/cdrage","followers_url":"https://api.github.com/users/cdrage/followers","following_url":"https://api.github.com/users/cdrage/following{/other_user}","gists_url":"https://api.github.com/users/cdrage/gists{/gist_id}","starred_url":"https://api.github.com/users/cdrage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdrage/subscriptions","organizations_url":"https://api.github.com/users/cdrage/orgs","repos_url":"https://api.github.com/users/cdrage/repos","events_url":"https://api.github.com/users/cdrage/events{/privacy}","received_events_url":"https://api.github.com/users/cdrage/received_events","type":"User","site_admin":false},"body":"This is the first commit and first initialization into refactoring the\r\nOpenShift provider in order to create a library that is both compatible\r\nwith OpenShift as well as Kubernetes.\r\n\r\nWith this 'library', the *ONLY* thing that is passed in is an object of\r\nthe .kube/config configuration. After passing the configuration, you may\r\nmake API calls such as .create(object) and .delete(object).\r\n\r\nThis commit integrates the library as well as converts the current Kubernetes provider from cmd-line (using kubectl) to using the API.","created_at":"2016-04-25T19:16:12Z","updated_at":"2016-05-26T14:00:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"274340da49c791a1cad2433fe0bd9a1b9e6d767c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/projectatomic/atomicapp/pulls/712/commits","review_comments_url":"https://api.github.com/repos/projectatomic/atomicapp/pulls/712/comments","review_comment_url":"https://api.github.com/repos/projectatomic/atomicapp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/projectatomic/atomicapp/issues/712/comments","statuses_url":"https://api.github.com/repos/projectatomic/atomicapp/statuses/1ed8d245e6750fd8dbe3a8b23a44a66cc5b7973e","head":{"label":"cdrage:add-openshift-k8s-library","ref":"add-openshift-k8s-library","sha":"1ed8d245e6750fd8dbe3a8b23a44a66cc5b7973e","user":{"login":"cdrage","id":6422176,"avatar_url":"https://avatars.githubusercontent.com/u/6422176?v=3","gravatar_id":"","url":"https://api.github.com/users/cdrage","html_url":"https://github.com/cdrage","followers_url":"https://api.github.com/users/cdrage/followers","following_url":"https://api.github.com/users/cdrage/following{/other_user}","gists_url":"https://api.github.com/users/cdrage/gists{/gist_id}","starred_url":"https://api.github.com/users/cdrage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdrage/subscriptions","organizations_url":"https://api.github.com/users/cdrage/orgs","repos_url":"https://api.github.com/users/cdrage/repos","events_url":"https://api.github.com/users/cdrage/events{/privacy}","received_events_url":"https://api.github.com/users/cdrage/received_events","type":"User","site_admin":false},"repo":{"id":41424648,"name":"atomicapp","full_name":"cdrage/atomicapp","owner":{"login":"cdrage","id":6422176,"avatar_url":"https://avatars.githubusercontent.com/u/6422176?v=3","gravatar_id":"","url":"https://api.github.com/users/cdrage","html_url":"https://github.com/cdrage","followers_url":"https://api.github.com/users/cdrage/followers","following_url":"https://api.github.com/users/cdrage/following{/other_user}","gists_url":"https://api.github.com/users/cdrage/gists{/gist_id}","starred_url":"https://api.github.com/users/cdrage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdrage/subscriptions","organizations_url":"https://api.github.com/users/cdrage/orgs","repos_url":"https://api.github.com/users/cdrage/repos","events_url":"https://api.github.com/users/cdrage/events{/privacy}","received_events_url":"https://api.github.com/users/cdrage/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cdrage/atomicapp","description":"This is the reference implementation of the Nulecule container application Specification: Atomic App","fork":true,"url":"https://api.github.com/repos/cdrage/atomicapp","forks_url":"https://api.github.com/repos/cdrage/atomicapp/forks","keys_url":"https://api.github.com/repos/cdrage/atomicapp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cdrage/atomicapp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cdrage/atomicapp/teams","hooks_url":"https://api.github.com/repos/cdrage/atomicapp/hooks","issue_events_url":"https://api.github.com/repos/cdrage/atomicapp/issues/events{/number}","events_url":"https://api.github.com/repos/cdrage/atomicapp/events","assignees_url":"https://api.github.com/repos/cdrage/atomicapp/assignees{/user}","branches_url":"https://api.github.com/repos/cdrage/atomicapp/branches{/branch}","tags_url":"https://api.github.com/repos/cdrage/atomicapp/tags","blobs_url":"https://api.github.com/repos/cdrage/atomicapp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cdrage/atomicapp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cdrage/atomicapp/git/refs{/sha}","trees_url":"https://api.github.com/repos/cdrage/atomicapp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cdrage/atomicapp/statuses/{sha}","languages_url":"https://api.github.com/repos/cdrage/atomicapp/languages","stargazers_url":"https://api.github.com/repos/cdrage/atomicapp/stargazers","contributors_url":"https://api.github.com/repos/cdrage/atomicapp/contributors","subscribers_url":"https://api.github.com/repos/cdrage/atomicapp/subscribers","subscription_url":"https://api.github.com/repos/cdrage/atomicapp/subscription","commits_url":"https://api.github.com/repos/cdrage/atomicapp/commits{/sha}","git_commits_url":"https://api.github.com/repos/cdrage/atomicapp/git/commits{/sha}","comments_url":"https://api.github.com/repos/cdrage/atomicapp/comments{/number}","issue_comment_url":"https://api.github.com/repos/cdrage/atomicapp/issues/comments{/number}","contents_url":"https://api.github.com/repos/cdrage/atomicapp/contents/{+path}","compare_url":"https://api.github.com/repos/cdrage/atomicapp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cdrage/atomicapp/merges","archive_url":"https://api.github.com/repos/cdrage/atomicapp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cdrage/atomicapp/downloads","issues_url":"https://api.github.com/repos/cdrage/atomicapp/issues{/number}","pulls_url":"https://api.github.com/repos/cdrage/atomicapp/pulls{/number}","milestones_url":"https://api.github.com/repos/cdrage/atomicapp/milestones{/number}","notifications_url":"https://api.github.com/repos/cdrage/atomicapp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cdrage/atomicapp/labels{/name}","releases_url":"https://api.github.com/repos/cdrage/atomicapp/releases{/id}","deployments_url":"https://api.github.com/repos/cdrage/atomicapp/deployments","created_at":"2015-08-26T12:37:30Z","updated_at":"2016-01-15T20:59:29Z","pushed_at":"2016-05-25T20:12:02Z","git_url":"git://github.com/cdrage/atomicapp.git","ssh_url":"git@github.com:cdrage/atomicapp.git","clone_url":"https://github.com/cdrage/atomicapp.git","svn_url":"https://github.com/cdrage/atomicapp","homepage":"","size":1366,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"projectatomic:master","ref":"master","sha":"8c0805751570ee66d3f5d620679c9f9c88f8c68b","user":{"login":"projectatomic","id":6852258,"avatar_url":"https://avatars.githubusercontent.com/u/6852258?v=3","gravatar_id":"","url":"https://api.github.com/users/projectatomic","html_url":"https://github.com/projectatomic","followers_url":"https://api.github.com/users/projectatomic/followers","following_url":"https://api.github.com/users/projectatomic/following{/other_user}","gists_url":"https://api.github.com/users/projectatomic/gists{/gist_id}","starred_url":"https://api.github.com/users/projectatomic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectatomic/subscriptions","organizations_url":"https://api.github.com/users/projectatomic/orgs","repos_url":"https://api.github.com/users/projectatomic/repos","events_url":"https://api.github.com/users/projectatomic/events{/privacy}","received_events_url":"https://api.github.com/users/projectatomic/received_events","type":"Organization","site_admin":false},"repo":{"id":32819266,"name":"atomicapp","full_name":"projectatomic/atomicapp","owner":{"login":"projectatomic","id":6852258,"avatar_url":"https://avatars.githubusercontent.com/u/6852258?v=3","gravatar_id":"","url":"https://api.github.com/users/projectatomic","html_url":"https://github.com/projectatomic","followers_url":"https://api.github.com/users/projectatomic/followers","following_url":"https://api.github.com/users/projectatomic/following{/other_user}","gists_url":"https://api.github.com/users/projectatomic/gists{/gist_id}","starred_url":"https://api.github.com/users/projectatomic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectatomic/subscriptions","organizations_url":"https://api.github.com/users/projectatomic/orgs","repos_url":"https://api.github.com/users/projectatomic/repos","events_url":"https://api.github.com/users/projectatomic/events{/privacy}","received_events_url":"https://api.github.com/users/projectatomic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projectatomic/atomicapp","description":"This is the reference implementation of the Nulecule container application Specification: Atomic App","fork":false,"url":"https://api.github.com/repos/projectatomic/atomicapp","forks_url":"https://api.github.com/repos/projectatomic/atomicapp/forks","keys_url":"https://api.github.com/repos/projectatomic/atomicapp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projectatomic/atomicapp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projectatomic/atomicapp/teams","hooks_url":"https://api.github.com/repos/projectatomic/atomicapp/hooks","issue_events_url":"https://api.github.com/repos/projectatomic/atomicapp/issues/events{/number}","events_url":"https://api.github.com/repos/projectatomic/atomicapp/events","assignees_url":"https://api.github.com/repos/projectatomic/atomicapp/assignees{/user}","branches_url":"https://api.github.com/repos/projectatomic/atomicapp/branches{/branch}","tags_url":"https://api.github.com/repos/projectatomic/atomicapp/tags","blobs_url":"https://api.github.com/repos/projectatomic/atomicapp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projectatomic/atomicapp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projectatomic/atomicapp/git/refs{/sha}","trees_url":"https://api.github.com/repos/projectatomic/atomicapp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projectatomic/atomicapp/statuses/{sha}","languages_url":"https://api.github.com/repos/projectatomic/atomicapp/languages","stargazers_url":"https://api.github.com/repos/projectatomic/atomicapp/stargazers","contributors_url":"https://api.github.com/repos/projectatomic/atomicapp/contributors","subscribers_url":"https://api.github.com/repos/projectatomic/atomicapp/subscribers","subscription_url":"https://api.github.com/repos/projectatomic/atomicapp/subscription","commits_url":"https://api.github.com/repos/projectatomic/atomicapp/commits{/sha}","git_commits_url":"https://api.github.com/repos/projectatomic/atomicapp/git/commits{/sha}","comments_url":"https://api.github.com/repos/projectatomic/atomicapp/comments{/number}","issue_comment_url":"https://api.github.com/repos/projectatomic/atomicapp/issues/comments{/number}","contents_url":"https://api.github.com/repos/projectatomic/atomicapp/contents/{+path}","compare_url":"https://api.github.com/repos/projectatomic/atomicapp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projectatomic/atomicapp/merges","archive_url":"https://api.github.com/repos/projectatomic/atomicapp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projectatomic/atomicapp/downloads","issues_url":"https://api.github.com/repos/projectatomic/atomicapp/issues{/number}","pulls_url":"https://api.github.com/repos/projectatomic/atomicapp/pulls{/number}","milestones_url":"https://api.github.com/repos/projectatomic/atomicapp/milestones{/number}","notifications_url":"https://api.github.com/repos/projectatomic/atomicapp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projectatomic/atomicapp/labels{/name}","releases_url":"https://api.github.com/repos/projectatomic/atomicapp/releases{/id}","deployments_url":"https://api.github.com/repos/projectatomic/atomicapp/deployments","created_at":"2015-03-24T19:09:39Z","updated_at":"2016-05-24T10:01:51Z","pushed_at":"2016-05-25T20:12:02Z","git_url":"git://github.com/projectatomic/atomicapp.git","ssh_url":"git@github.com:projectatomic/atomicapp.git","clone_url":"https://github.com/projectatomic/atomicapp.git","svn_url":"https://github.com/projectatomic/atomicapp","homepage":"","size":2038,"stargazers_count":76,"watchers_count":76,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":61,"mirror_url":null,"open_issues_count":110,"forks":61,"open_issues":110,"watchers":76,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/projectatomic/atomicapp/pulls/712"},"html":{"href":"https://github.com/projectatomic/atomicapp/pull/712"},"issue":{"href":"https://api.github.com/repos/projectatomic/atomicapp/issues/712"},"comments":{"href":"https://api.github.com/repos/projectatomic/atomicapp/issues/712/comments"},"review_comments":{"href":"https://api.github.com/repos/projectatomic/atomicapp/pulls/712/comments"},"review_comment":{"href":"https://api.github.com/repos/projectatomic/atomicapp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/projectatomic/atomicapp/pulls/712/commits"},"statuses":{"href":"https://api.github.com/repos/projectatomic/atomicapp/statuses/1ed8d245e6750fd8dbe3a8b23a44a66cc5b7973e"}}}}
{"actor":{"display_login":"dustymabe"}}