Skip to content

Commit

Permalink
add local kubeconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkukral committed Oct 2, 2017
1 parent 7373e26 commit b5669fe
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
23 changes: 23 additions & 0 deletions kqueen/test_kubeapi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from kqueen.kubeapi import KubernetesAPI

import pytest


class TestKubeApi:
def test_missing_cluster_param(self):
with pytest.raises(ValueError, match='Missing parameter cluster'):
KubernetesAPI()

def test_get_kubeconfig(self, cluster):
"""Test get_kubeconfig returns YAML"""

cluster.save()
api = KubernetesAPI(cluster=cluster)
print(api.get_kubeconfig_file())

def test_init(self, cluster):
cluster.save()

api = KubernetesAPI(cluster=cluster)

assert hasattr(api, 'cluster')
1 change: 0 additions & 1 deletion kqueen/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from pprint import pprint

import pytest
import json


class TestModelMethods:
Expand Down
13 changes: 13 additions & 0 deletions kubeconfig_localhost
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
clusters:
- cluster:
server: http://127.0.0.1:8080
name: local
contexts:
- context:
cluster: local
user: ""
name: local
current-context: local
kind: Config
preferences: {}

0 comments on commit b5669fe

Please sign in to comment.