Skip to content

Commit

Permalink
Revert "set deployment API to apps/v1 if k8s >= 1.9"
Browse files Browse the repository at this point in the history
This reverts commit a226971.
  • Loading branch information
Kingdon Barrett committed Feb 26, 2019
1 parent 813cc69 commit b4af9c9
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions rootfs/scheduler/resources/deployment.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
from datetime import datetime, timedelta
import json
import time
from datetime import datetime, timedelta

from packaging.version import parse

from scheduler.resources import Resource
from scheduler.exceptions import KubeException, KubeHTTPException


class Deployment(Resource):
api_prefix = 'apis'

@property
def api_version(self):
if self.version() >= parse("1.9.0"):
return 'apps/v1'

return 'extensions/v1beta1'
api_version = 'extensions/v1beta1'

def get(self, namespace, name=None, **kwargs):
"""
Expand Down Expand Up @@ -52,7 +43,7 @@ def manifest(self, namespace, name, image, entrypoint, command, spec_annotations

manifest = {
'kind': 'Deployment',
'apiVersion': self.api_version,
'apiVersion': 'extensions/v1beta1',
'metadata': {
'name': name,
'labels': labels,
Expand Down

0 comments on commit b4af9c9

Please sign in to comment.