From c9af170d9aeeb39dbb41a99c00402beb384da0e9 Mon Sep 17 00:00:00 2001 From: Thong Kuah Date: Fri, 7 Sep 2018 15:07:47 +1200 Subject: Create a GKE cluster with legacy_abac disabled when the `:rbac_clusters` feature flag is enabled Explicitly persist the legacy_abac value of the cluster_provider_gcp so that we can disable abac if the `:rbac_clusters` feature flag is enabled --- ...07015926_add_legacy_abac_to_cluster_providers_gcp.rb | 17 +++++++++++++++++ db/schema.rb | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20180907015926_add_legacy_abac_to_cluster_providers_gcp.rb (limited to 'db') diff --git a/db/migrate/20180907015926_add_legacy_abac_to_cluster_providers_gcp.rb b/db/migrate/20180907015926_add_legacy_abac_to_cluster_providers_gcp.rb new file mode 100644 index 00000000000..933047e32de --- /dev/null +++ b/db/migrate/20180907015926_add_legacy_abac_to_cluster_providers_gcp.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddLegacyAbacToClusterProvidersGcp < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_column_with_default(:cluster_providers_gcp, :legacy_abac, :boolean, default: true) + end + + def down + remove_column(:cluster_providers_gcp, :legacy_abac) + end +end diff --git a/db/schema.rb b/db/schema.rb index d888891c8ea..9c01d03f683 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20180906101639) do +ActiveRecord::Schema.define(version: 20180907015926) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -620,6 +620,7 @@ ActiveRecord::Schema.define(version: 20180906101639) do t.string "endpoint" t.text "encrypted_access_token" t.string "encrypted_access_token_iv" + t.boolean "legacy_abac", default: true, null: false end add_index "cluster_providers_gcp", ["cluster_id"], name: "index_cluster_providers_gcp_on_cluster_id", unique: true, using: :btree -- cgit v1.2.3