Browse Source

Fix kubedns idempotency

Removed api-version from kube.py because it is deprecated.
Updating both kube.py because dnsmasq one is actually used.
Fixed name back to kubedns for checking its resource.
pull/483/head
Matthew Mosesohn 8 years ago
parent
commit
ef43b21597
3 changed files with 1 additions and 27 deletions
  1. 13
      roles/dnsmasq/library/kube.py
  2. 13
      roles/kubernetes-apps/ansible/library/kube.py
  3. 2
      roles/kubernetes-apps/ansible/tasks/main.yaml

13
roles/dnsmasq/library/kube.py

@ -44,12 +44,6 @@ options:
default: null default: null
description: description:
- The url for the API server that commands are executed against. - The url for the API server that commands are executed against.
api_version:
required: false
choices: ['v1', 'v1beta3']
default: v1
description:
- The API version associated with cluster.
force: force:
required: false required: false
default: false default: false
@ -105,10 +99,6 @@ class KubeManager(object):
if self.kubectl is None: if self.kubectl is None:
self.kubectl = module.get_bin_path('kubectl', True) self.kubectl = module.get_bin_path('kubectl', True)
self.base_cmd = [self.kubectl] self.base_cmd = [self.kubectl]
self.api_version = module.params.get('api_version')
if self.api_version:
self.base_cmd.append('--api-version=' + self.api_version)
if module.params.get('server'): if module.params.get('server'):
self.base_cmd.append('--server=' + module.params.get('server')) self.base_cmd.append('--server=' + module.params.get('server'))
@ -164,8 +154,6 @@ class KubeManager(object):
return [] return []
cmd = ['replace'] cmd = ['replace']
if self.api_version != 'v1':
cmd = ['update']
if self.force: if self.force:
cmd.append('--force') cmd.append('--force')
@ -271,7 +259,6 @@ def main():
label=dict(), label=dict(),
server=dict(), server=dict(),
kubectl=dict(), kubectl=dict(),
api_version=dict(default='v1', choices=['v1', 'v1beta3']),
force=dict(default=False, type='bool'), force=dict(default=False, type='bool'),
all=dict(default=False, type='bool'), all=dict(default=False, type='bool'),
log_level=dict(default=0, type='int'), log_level=dict(default=0, type='int'),

13
roles/kubernetes-apps/ansible/library/kube.py

@ -44,12 +44,6 @@ options:
default: null default: null
description: description:
- The url for the API server that commands are executed against. - The url for the API server that commands are executed against.
api_version:
required: false
choices: ['v1', 'v1beta3']
default: v1
description:
- The API version associated with cluster.
force: force:
required: false required: false
default: false default: false
@ -105,10 +99,6 @@ class KubeManager(object):
if self.kubectl is None: if self.kubectl is None:
self.kubectl = module.get_bin_path('kubectl', True) self.kubectl = module.get_bin_path('kubectl', True)
self.base_cmd = [self.kubectl] self.base_cmd = [self.kubectl]
self.api_version = module.params.get('api_version')
if self.api_version:
self.base_cmd.append('--api-version=' + self.api_version)
if module.params.get('server'): if module.params.get('server'):
self.base_cmd.append('--server=' + module.params.get('server')) self.base_cmd.append('--server=' + module.params.get('server'))
@ -164,8 +154,6 @@ class KubeManager(object):
return [] return []
cmd = ['replace'] cmd = ['replace']
if self.api_version != 'v1':
cmd = ['update']
if self.force: if self.force:
cmd.append('--force') cmd.append('--force')
@ -271,7 +259,6 @@ def main():
label=dict(), label=dict(),
server=dict(), server=dict(),
kubectl=dict(), kubectl=dict(),
api_version=dict(default='v1', choices=['v1', 'v1beta3']),
force=dict(default=False, type='bool'), force=dict(default=False, type='bool'),
all=dict(default=False, type='bool'), all=dict(default=False, type='bool'),
log_level=dict(default=0, type='int'), log_level=dict(default=0, type='int'),

2
roles/kubernetes-apps/ansible/tasks/main.yaml

@ -9,7 +9,7 @@
- name: Kubernetes Apps | Start Resources - name: Kubernetes Apps | Start Resources
kube: kube:
name: KubeDNS
name: kubedns
namespace: kube-system namespace: kube-system
kubectl: "{{bin_dir}}/kubectl" kubectl: "{{bin_dir}}/kubectl"
resource: "{{item.item.type}}" resource: "{{item.item.type}}"

Loading…
Cancel
Save