snapctl 0.39.2__tar.gz → 0.39.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of snapctl might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: snapctl
3
- Version: 0.39.2
3
+ Version: 0.39.3
4
4
  Summary: Snapser CLI Tool
5
5
  Author: Ajinkya Apte
6
6
  Author-email: aj@snapser.com
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "snapctl"
3
- version = "0.39.2"
3
+ version = "0.39.3"
4
4
  description = "Snapser CLI Tool"
5
5
  authors = ["Ajinkya Apte <aj@snapser.com>"]
6
6
  readme = "README.md"
@@ -251,6 +251,35 @@ class ByoGs:
251
251
  snapctl_error('BYOGS upload failure. Duplicate image error.',
252
252
  SNAPCTL_BYOGS_PUBLISH_DUPLICATE_TAG_ERROR, progress)
253
253
 
254
+ def _clean_slate(self) -> None:
255
+ progress = Progress(
256
+ SpinnerColumn(),
257
+ TextColumn("[progress.description]{task.description}"),
258
+ transient=True,
259
+ )
260
+ progress.start()
261
+ progress.add_task(
262
+ description='Cleaning cache and initializing...', total=None)
263
+ try:
264
+ # Specific ECR repository URL to check against
265
+ ecr_repo_url = self.token_parts[0]
266
+ if platform == "win32":
267
+ # Perform the Docker logout
268
+ logout_response = subprocess.run(
269
+ ['docker', 'logout', ecr_repo_url],
270
+ shell=True, check=False)
271
+ else:
272
+ # Perform the Docker logout
273
+ logout_response = subprocess.run([
274
+ f"docker logout {ecr_repo_url}"
275
+ ], shell=True, check=False)
276
+ if not logout_response.returncode:
277
+ return snapctl_success('Cleanup complete', progress, no_exit=True)
278
+ except subprocess.CalledProcessError:
279
+ warning('Unable to initialize with a clean slate.')
280
+ finally:
281
+ progress.stop()
282
+
254
283
  # Public methods
255
284
 
256
285
  # Validator
@@ -322,6 +351,7 @@ class ByoGs:
322
351
  """
323
352
  self._check_dependencies()
324
353
  self._docker_tag()
354
+ self._clean_slate()
325
355
  self._docker_login()
326
356
  self._docker_push()
327
357
 
@@ -342,6 +372,7 @@ class ByoGs:
342
372
  else:
343
373
  info('--skip-build set. Skipping the build step.')
344
374
  self._docker_tag()
375
+ self._clean_slate()
345
376
  self._docker_login()
346
377
  self._docker_push()
347
378
  snapctl_success('BYOGS publish successful')
@@ -354,6 +354,33 @@ class ByoSnap:
354
354
  SNAPCTL_INPUT_ERROR
355
355
  )
356
356
 
357
+ def _clean_slate(self) -> None:
358
+ progress = Progress(
359
+ SpinnerColumn(),
360
+ TextColumn("[progress.description]{task.description}"),
361
+ transient=True,
362
+ )
363
+ progress.start()
364
+ progress.add_task(
365
+ description='Cleaning cache and initializing...', total=None)
366
+ try:
367
+ # Specific ECR repository URL to check against
368
+ ecr_domain = self.token_parts[0].split('/')[0]
369
+ # Perform the Docker logout
370
+ if platform == "win32":
371
+ logout_response = subprocess.run(['docker', 'logout', ecr_domain],
372
+ shell=True, check=False)
373
+ else:
374
+ logout_response = subprocess.run([
375
+ f"docker logout {ecr_domain}"
376
+ ], shell=True, check=False)
377
+ if not logout_response.returncode:
378
+ return snapctl_success('Cleanup complete.', progress, no_exit=True)
379
+ except subprocess.CalledProcessError:
380
+ warning('Unable to initialize with a clean slate.')
381
+ finally:
382
+ progress.stop()
383
+
357
384
  # Public methods
358
385
 
359
386
  # Validator
@@ -509,6 +536,7 @@ class ByoSnap:
509
536
  """
510
537
  self._check_dependencies()
511
538
  self._docker_tag()
539
+ self._clean_slate()
512
540
  self._docker_login()
513
541
  self._docker_push()
514
542
 
@@ -662,6 +690,7 @@ class ByoSnap:
662
690
  else:
663
691
  info('--skip-build set. Skipping the build step.')
664
692
  self._docker_tag()
693
+ self._clean_slate()
665
694
  self._docker_login()
666
695
  self._docker_push()
667
696
  if self.path is not None or self.resources_path is not None:
@@ -2,7 +2,7 @@
2
2
  Constants used by snapctl
3
3
  """
4
4
  COMPANY_NAME = 'Snapser'
5
- VERSION = '0.39.2'
5
+ VERSION = '0.39.3'
6
6
  CONFIG_FILE_MAC = '~/.snapser/config'
7
7
  CONFIG_FILE_WIN = '%homepath%\\.snapser\\config'
8
8
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes