Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
moklidia committed Jun 3, 2022
2 parents 2200838 + 6434834 commit 013c560
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# frozen_string_literal: true

class UffizziCore::DockerHubClient
class NotAuthorizedError < StandardError
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ def user_access_module
module_class(:rbac).new
end

def build_parser_module
return unless module_exists?(:github)

module_class(:github).new
end

private

def module_exists?(module_name)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# frozen_string_literal: true

# rubocop:disable Metrics/LineLength
# rubocop:disable Layout/LineLength
class UffizziCore::Controller::DeployContainers::ContainerSerializer::ContainerConfigFileSerializer::ConfigFileSerializer < UffizziCore::BaseSerializer
# rubocop:enable Metrics/LineLength
# rubocop:enable Layout/LineLength

attributes :id, :filename, :kind, :payload
end
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

class UffizziCore::ComposeFile::ServicesOptionsService
class << self
include UffizziCore::DependencyInjectionConcern

def parse(services, global_configs_data, global_secrets_data, compose_payload)
raise UffizziCore::ComposeFile::ParseError, I18n.t('compose.no_services') if services.nil? || services.keys.empty?

Expand All @@ -18,7 +20,7 @@ def parse(services, global_configs_data, global_secrets_data, compose_payload)

private

def prepare_service_data(service_name, service_data, global_configs_data, global_secrets_data, _compose_payload)
def prepare_service_data(service_name, service_data, global_configs_data, global_secrets_data, compose_payload)
options_data = {}
service_data.each_pair do |key, value|
service_key = key.to_sym
Expand All @@ -27,7 +29,7 @@ def prepare_service_data(service_name, service_data, global_configs_data, global
when :image
UffizziCore::ComposeFile::ServicesOptions::ImageService.parse(value)
when :build
raise UffizziCore::ComposeFile::ParseError, I18n.t('compose.not_implemented', option: :build)
check_and_parse_build_option(value, compose_payload)
when :env_file
UffizziCore::ComposeFile::ServicesOptions::EnvFileService.parse(value)
when :environment
Expand All @@ -51,5 +53,11 @@ def prepare_service_data(service_name, service_data, global_configs_data, global

options_data
end

def check_and_parse_build_option(value, compose_payload)
raise UffizziCore::ComposeFile::ParseError, I18n.t('compose.not_implemented', option: :build) unless build_parser_module

build_parser_module.parse(value, compose_payload)
end
end
end

0 comments on commit 013c560

Please sign in to comment.