Sha256: 7eac0b200c0c514573e4b5a6d27e59073f00c0dfb334403ae10953a7425de048
Contents?: true
Size: 1.41 KB
Versions: 3
Compression:
Stored size: 1.41 KB
Contents
# frozen_string_literal: true require 'uffizzi' module Uffizzi class Cli::Disconnect include ApiClient def run(credential_type) connection_type = case credential_type when 'docker-hub' Uffizzi.configuration.credential_types[:dockerhub] when 'acr' Uffizzi.configuration.credential_types[:azure] when 'ecr' Uffizzi.configuration.credential_types[:amazon] when 'gcr' Uffizzi.configuration.credential_types[:google] when 'ghcr' Uffizzi.configuration.credential_types[:github_container_registry] else raise Uffizzi::Error.new('Unsupported credential type.') end response = delete_credential(ConfigFile.read_option(:server), connection_type) if ResponseHelper.no_content?(response) Uffizzi.ui.say("Successfully disconnected #{connection_name(credential_type)} connection") else ResponseHelper.handle_failed_response(response) end end private def connection_name(credential_type) { 'docker-hub' => 'DockerHub', 'acr' => 'ACR', 'ecr' => 'ECR', 'gcr' => 'GCR', 'ghcr' => 'GHCR', }[credential_type] end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
uffizzi-cli-0.8.0 | lib/uffizzi/cli/disconnect.rb |
uffizzi-cli-0.7.3 | lib/uffizzi/cli/disconnect.rb |
uffizzi-cli-0.7.2 | lib/uffizzi/cli/disconnect.rb |