class GitlabClusterHelper::GcpClient

Public Class Methods

new(config: GitlabClusterHelper::Config.instance, shell: GitlabClusterHelper::Shell.new) click to toggle source
# File lib/gitlab_cluster_helper/gcp_client.rb, line 6
def initialize(config: GitlabClusterHelper::Config.instance, shell: GitlabClusterHelper::Shell.new)
  @config = config
  @shell = shell
end

Public Instance Methods

create_cluster() click to toggle source
# File lib/gitlab_cluster_helper/dummy_gcp_client.rb, line 5
def create_cluster
  sleep 5

  Cluster.new({
    name: "fake-cluster-#{Time.now.strftime("%Y-%m-%dt%Hh%Mm%Ss")}",
    api_url: 'fake-url',
    ca_certificate: 'fake certificate',
    token: 'fake-token'
  })
end
delete_cluster(cluster_name) click to toggle source
# File lib/gitlab_cluster_helper/dummy_gcp_client.rb, line 16
def delete_cluster(cluster_name)
  puts "Deleting: #{cluster_name}"
end

Private Instance Methods

gcloud() click to toggle source
# File lib/gitlab_cluster_helper/gcp_client.rb, line 58
def gcloud
  ['gcloud', '--project', @config.gcp_project]
end