diff options
author | Shinya Maeda <shinya@gitlab.com> | 2017-11-03 21:16:34 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2017-11-03 21:16:34 +0900 |
commit | 8d8a860fbbdfffea7c5e53ac299ca4f91d8cc11d (patch) | |
tree | 06e980cc64990fd4e9ff77f62250299dc5422ea2 /db | |
parent | b6d0c9b2310d65144080de15d0c2e6dd87f177ed (diff) | |
download | gitlab-ce-8d8a860fbbdfffea7c5e53ac299ca4f91d8cc11d.tar.gz |
Fix MigrateGcpClustersToNewClustersArchitectures. Improve spec
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20171013104327_migrate_gcp_clusters_to_new_clusters_architectures.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/db/migrate/20171013104327_migrate_gcp_clusters_to_new_clusters_architectures.rb b/db/migrate/20171013104327_migrate_gcp_clusters_to_new_clusters_architectures.rb index 6ff98899bcb..eaf6ac062d8 100644 --- a/db/migrate/20171013104327_migrate_gcp_clusters_to_new_clusters_architectures.rb +++ b/db/migrate/20171013104327_migrate_gcp_clusters_to_new_clusters_architectures.rb @@ -71,7 +71,7 @@ class MigrateGcpClustersToNewClustersArchitectures < ActiveRecord::Migration def params_for_cluster_platforms_kubernetes(gcp_cluster) { cluster_id: gcp_cluster['id'], - api_url: 'https://' + gcp_cluster['endpoint'], + api_url: api_url(gcp_cluster['endpoint']), ca_cert: gcp_cluster['ca_cert'], namespace: gcp_cluster['project_namespace'], username: gcp_cluster['username'], @@ -83,4 +83,8 @@ class MigrateGcpClustersToNewClustersArchitectures < ActiveRecord::Migration updated_at: gcp_cluster['updated_at'] } end + + def api_url(endpoint) + endpoint ? 'https://' + endpoint : nil + end end |