Skip to content

Commit 75bae18

Browse files
committed
Remove remotetype
This removes references to remote type since it isn't used any longer.
1 parent 9b6c31e commit 75bae18

File tree

3 files changed

+9
-16
lines changed

3 files changed

+9
-16
lines changed

imagegw/shifter_imagegw/config.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,19 @@
55

66

77
class Location():
8+
# Used to override the location as the URL
9+
# This is not typically required.
10+
url: str = None
11+
# Note this is deprecated but left for reference
812
remotetype: str = 'dockerv2'
13+
14+
# Note this is deprecated but left for reference
915
authentication: str = 'http'
10-
url: str = None
1116

1217
def __init__(self, data: dict):
13-
self.remotetype = data['remotetype']
18+
rtype = data.get('remotetype', 'dockerv2')
19+
if rtype != 'dockerv2':
20+
raise NotImplementedError(f'Unsupported remote type {rtype}')
1421
self.authentication = data['authentication']
1522
self.url = data.get('url')
1623

imagegw/shifter_imagegw/imageworker.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,13 +274,9 @@ def _pull_image(self):
274274

275275
if location in self.conf.Locations:
276276
params = self.conf.Locations[location]
277-
rtype = params.remotetype
278277
else:
279278
raise KeyError(f'{location} not found in configuration')
280279

281-
if rtype != 'dockerv2':
282-
raise NotImplementedError(f'Unsupported remote type {rtype}')
283-
284280
return self._pull_dockerv2(location, repo, tag)
285281

286282
def _examine_image(self):

imagegw/test/imagemngr_test.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ def __init__(self):
142142
self.pull = {'system': self.system,
143143
'itype': self.itype,
144144
'tag': self.tag,
145-
'remotetype': 'dockerv2',
146145
'userACL': [], 'groupACL': []}
147146
self.session = Session(uid=100, gid=100, system=self.system,
148147
user="user", group="user")
@@ -652,7 +651,6 @@ def xtest_pull_testimage(ctx):
652651
'system': ctx.system,
653652
'itype': ctx.itype,
654653
'tag': 'scanon/shanetest:latest',
655-
'remotetype': 'dockerv2',
656654
'userACL': [],
657655
'groupACL': []
658656
}
@@ -797,7 +795,6 @@ def test_pulls_acl_change(ctx):
797795
'system': record['system'],
798796
'itype': record['itype'],
799797
'tag': record['pulltag'],
800-
'remotetype': 'dockerv2',
801798
'userACL': [1001, 1002],
802799
'groupACL': [1003, 1004]
803800
}
@@ -817,7 +814,6 @@ def test_pull_logic(ctx):
817814
'system': record['system'],
818815
'itype': record['itype'],
819816
'tag': tag,
820-
'remotetype': 'dockerv2',
821817
}
822818
id = ctx.images.insert_one(record).inserted_id
823819
assert id
@@ -874,7 +870,6 @@ def test_pull_public_acl(ctx):
874870
'system': ctx.system,
875871
'itype': ctx.itype,
876872
'tag': ctx.tag,
877-
'remotetype': 'dockerv2',
878873
'userACL': [1001, 1002],
879874
'groupACL': [1003, 1004]
880875
}
@@ -913,7 +908,6 @@ def test_pull_public_acl_token(ctx):
913908
'system': ctx.system,
914909
'itype': ctx.itype,
915910
'tag': ctx.public,
916-
'remotetype': 'dockerv2',
917911
'userACL': [1001, 1002],
918912
'groupACL': [1003, 1004]
919913
}
@@ -946,7 +940,6 @@ def test_pull_acl(ctx):
946940
'system': ctx.system,
947941
'itype': ctx.itype,
948942
'tag': ctx.private,
949-
'remotetype': 'dockerv2',
950943
'userACL': [1001, 1002],
951944
'groupACL': [1003, 1004]
952945
}
@@ -1019,7 +1012,6 @@ def test_import(ctx):
10191012
'system': ctx.system,
10201013
'itype': ctx.itype,
10211014
'tag': ctx.tag,
1022-
'remotetype': 'dockerv2',
10231015
'filepath': '/images/test/test.squashfs',
10241016
'format': 'squashfs',
10251017
'userACL': [],
@@ -1270,7 +1262,6 @@ def test_pull_multiple_tags(ctx):
12701262
'system': ctx.system,
12711263
'itype': ctx.itype,
12721264
'tag': ctx.public,
1273-
'remotetype': 'dockerv2'
12741265
}
12751266
# Do the pull
12761267
session = ctx.session
@@ -1292,7 +1283,6 @@ def test_pull_multiple_tags(ctx):
12921283
'system': ctx.system,
12931284
'itype': ctx.itype,
12941285
'tag': newtag,
1295-
'remotetype': 'dockerv2'
12961286
}
12971287
rec = ctx.m.pull(session, pr) # ,delay=False)
12981288
id = rec['_id']

0 commit comments

Comments
 (0)