Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions cluster/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


from pathlib import Path

from cluster.types import Config
Expand Down
1 change: 0 additions & 1 deletion cluster/constants.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@

config_file_path = "~/.cluster/config.yml"
1 change: 0 additions & 1 deletion cluster/di.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Exposing the truth that dependency injection is just a fancy name for global variables

from cluster.types import CliOptions
Expand Down
1 change: 0 additions & 1 deletion cluster/factory.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import ruamel.yaml


Expand Down
2 changes: 0 additions & 2 deletions cluster/k8s_connection.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@

from kubernetes import client, config

from cluster.types import Config


class Connection:

apps: client.AppsV1Api
core: client.CoreV1Api
networking: client.NetworkingV1Api
Expand Down
1 change: 0 additions & 1 deletion cluster/log.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import sys


Expand Down
2 changes: 1 addition & 1 deletion cluster/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from cluster.types import CliOptions, MainCmdCtx
from cluster.subcommands import status, install_dns

CLICK_CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
CLICK_CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"])


@click.group(context_settings=CLICK_CONTEXT_SETTINGS)
Expand Down
2 changes: 0 additions & 2 deletions cluster/subcommands/install_dns.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import click

from cluster.types import MainCmdCtx
Expand All @@ -16,4 +15,3 @@ def command(context, do_token, target_zone):
# Read the external-dns object definition YAML into memory
# Replace the template strings with our argumnents
# Send the YAML to k8s

16 changes: 8 additions & 8 deletions cluster/subcommands/status.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import base64
import click
import json
Expand All @@ -19,11 +18,12 @@ def command(context):
print("Nodes:")
for node in nodes:
print(
f"{node.metadata.uid} "
f"{node.metadata.name} "
f"{node.status.node_info.kubelet_version} "
f"{node.metadata.labels['node.kubernetes.io/instance-type']} "
f"{node.metadata.labels['beta.kubernetes.io/arch']}")
f"{node.metadata.uid} "
f"{node.metadata.name} "
f"{node.status.node_info.kubelet_version} "
f"{node.metadata.labels['node.kubernetes.io/instance-type']} "
f"{node.metadata.labels['beta.kubernetes.io/arch']}"
)
print("\nServices:")
list_services_response = connection.core.list_service_for_all_namespaces()
services = list_services_response.items
Expand Down Expand Up @@ -60,10 +60,10 @@ def command(context):
for secret in secrets:
if secret.type == "kubernetes.io/dockerconfigjson":
print(f"{secret.metadata.name}: ", end="")
docker_config_encoded = secret.data['.dockerconfigjson']
docker_config_encoded = secret.data[".dockerconfigjson"]
docker_config_decoded_json = base64.b64decode(docker_config_encoded).decode("ascii")
docker_config = json.loads(docker_config_decoded_json)
auths = docker_config['auths']
auths = docker_config["auths"]
for auth in auths:
print(f"{auth}")

Expand Down
1 change: 0 additions & 1 deletion cluster/types.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from pathlib import Path
from dataclasses import dataclass

Expand Down
1 change: 0 additions & 1 deletion cluster/util.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@

def bool_to_yesno(val: bool) -> str:
return "yes" if val else "no"