summaryrefslogtreecommitdiff
path: root/app/services/ci
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2017-10-04 15:14:01 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2017-10-04 15:14:45 +0200
commitea4af856e49cf5933b6995965fa7d6b922e38c20 (patch)
treea8402a61029dee967883b4e250f42aabdaaf8c42 /app/services/ci
parent7329a0347f6093a15ffb0cf8f6a9ddc7f0495cb6 (diff)
downloadgitlab-ce-ea4af856e49cf5933b6995965fa7d6b922e38c20.tar.gz
Fix cluster event names to be prefixed with: `make_`
Diffstat (limited to 'app/services/ci')
-rw-r--r--app/services/ci/fetch_gcp_operation_service.rb2
-rw-r--r--app/services/ci/finalize_cluster_creation_service.rb4
-rw-r--r--app/services/ci/integrate_cluster_service.rb2
-rw-r--r--app/services/ci/provision_cluster_service.rb10
4 files changed, 9 insertions, 9 deletions
diff --git a/app/services/ci/fetch_gcp_operation_service.rb b/app/services/ci/fetch_gcp_operation_service.rb
index 415afaf901f..0b68e4d6ea9 100644
--- a/app/services/ci/fetch_gcp_operation_service.rb
+++ b/app/services/ci/fetch_gcp_operation_service.rb
@@ -11,7 +11,7 @@ module Ci
yield(operation) if block_given?
rescue Google::Apis::ServerError, Google::Apis::ClientError, Google::Apis::AuthorizationError => e
- return cluster.errored!("Failed to request to CloudPlatform; #{e.message}")
+ return cluster.make_errored!("Failed to request to CloudPlatform; #{e.message}")
end
end
end
diff --git a/app/services/ci/finalize_cluster_creation_service.rb b/app/services/ci/finalize_cluster_creation_service.rb
index a469acc0467..347875c5697 100644
--- a/app/services/ci/finalize_cluster_creation_service.rb
+++ b/app/services/ci/finalize_cluster_creation_service.rb
@@ -10,7 +10,7 @@ module Ci
cluster.gcp_cluster_zone,
cluster.gcp_cluster_name)
rescue Google::Apis::ServerError, Google::Apis::ClientError, Google::Apis::AuthorizationError => e
- return cluster.errored!("Failed to request to CloudPlatform; #{e.message}")
+ return cluster.make_errored!("Failed to request to CloudPlatform; #{e.message}")
end
endpoint = gke_cluster.endpoint
@@ -23,7 +23,7 @@ module Ci
api_url, ca_cert, username, password).execute
unless kubernetes_token
- return cluster.errored!('Failed to get a default token of kubernetes')
+ return cluster.make_errored!('Failed to get a default token of kubernetes')
end
Ci::IntegrateClusterService.new.execute(
diff --git a/app/services/ci/integrate_cluster_service.rb b/app/services/ci/integrate_cluster_service.rb
index ae7dccb0f42..857bca3f953 100644
--- a/app/services/ci/integrate_cluster_service.rb
+++ b/app/services/ci/integrate_cluster_service.rb
@@ -10,7 +10,7 @@ module Ci
username: username,
password: password,
service: cluster.project.find_or_initialize_service('kubernetes'),
- status_event: :created)
+ status_event: :make_created)
cluster.service.update!(
active: true,
diff --git a/app/services/ci/provision_cluster_service.rb b/app/services/ci/provision_cluster_service.rb
index 6fcbdd8b483..52d80b01813 100644
--- a/app/services/ci/provision_cluster_service.rb
+++ b/app/services/ci/provision_cluster_service.rb
@@ -12,24 +12,24 @@ module Ci
cluster.gcp_cluster_size,
machine_type: cluster.gcp_machine_type)
rescue Google::Apis::ServerError, Google::Apis::ClientError, Google::Apis::AuthorizationError => e
- return cluster.errored!("Failed to request to CloudPlatform; #{e.message}")
+ return cluster.make_errored!("Failed to request to CloudPlatform; #{e.message}")
end
unless operation.status == 'RUNNING' || operation.status == 'PENDING'
- return cluster.errored!("Operation status is unexpected; #{operation.status_message}")
+ return cluster.make_errored!("Operation status is unexpected; #{operation.status_message}")
end
cluster.gcp_operation_id = api_client.parse_operation_id(operation.self_link)
unless cluster.gcp_operation_id
- return cluster.errored!('Can not find operation_id from self_link')
+ return cluster.make_errored!('Can not find operation_id from self_link')
end
- if cluster.creating
+ if cluster.make_creating
WaitForClusterCreationWorker.perform_in(
WaitForClusterCreationWorker::INITIAL_INTERVAL, cluster.id)
else
- return cluster.errored!("Failed to update cluster record; #{cluster.errors}")
+ return cluster.make_errored!("Failed to update cluster record; #{cluster.errors}")
end
end
end