Class: Clusters::Providers::Gcp

Inherits:
ApplicationRecord show all
Includes:
Concerns::ProviderStatus
Defined in:
app/models/clusters/providers/gcp.rb

Instance Method Summary collapse

Methods inherited from ApplicationRecord

at_most, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, underscore, without_order

Instance Method Details

#api_clientObject


40
41
42
43
44
# File 'app/models/clusters/providers/gcp.rb', line 40

def api_client
  return unless access_token

  @api_client ||= GoogleApi::CloudPlatform::Client.new(access_token, nil)
end

#assign_operation_id(operation_id) ⇒ Object


53
54
55
# File 'app/models/clusters/providers/gcp.rb', line 53

def assign_operation_id(operation_id)
  assign_attributes(operation_id: operation_id)
end

#has_rbac_enabled?Boolean

Returns:

  • (Boolean)

57
58
59
# File 'app/models/clusters/providers/gcp.rb', line 57

def has_rbac_enabled?
  !legacy_abac
end

#knative_pre_installed?Boolean

Returns:

  • (Boolean)

61
62
63
# File 'app/models/clusters/providers/gcp.rb', line 61

def knative_pre_installed?
  cloud_run?
end

#nullify_credentialsObject


46
47
48
49
50
51
# File 'app/models/clusters/providers/gcp.rb', line 46

def nullify_credentials
  assign_attributes(
    access_token: nil,
    operation_id: nil
  )
end