Commit 93b806c4 authored by Mayra Cabrera's avatar Mayra Cabrera Committed by Sean McGivern

Improvements for Knative installation

Displays Knative domain field automatically after Helm is successfully
installed.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/56954
parent 1f42dd86
......@@ -14,4 +14,10 @@ module ClustersHelper
render 'clusters/clusters/gcp_signup_offer_banner'
end
end
def has_rbac_enabled?(cluster)
return cluster.platform_kubernetes_rbac? if cluster.platform_kubernetes
!cluster.provider.legacy_abac?
end
end
......@@ -17,7 +17,7 @@
install_knative_path: clusterable.install_applications_cluster_path(@cluster, :knative),
update_knative_path: clusterable.update_applications_cluster_path(@cluster, :knative),
toggle_status: @cluster.enabled? ? 'true': 'false',
has_rbac: @cluster.platform_kubernetes_rbac? ? 'true': 'false',
has_rbac: has_rbac_enabled?(@cluster) ? 'true': 'false',
cluster_type: @cluster.cluster_type,
cluster_status: @cluster.status_name,
cluster_status_reason: @cluster.status_reason,
......
---
title: Improve the Knative installation on Clusters
merge_request: 26339
author:
type: added
......@@ -28,5 +28,9 @@ FactoryBot.define do
gcp.make_errored('Something wrong')
end
end
trait :abac_enabled do
legacy_abac true
end
end
end
# frozen_string_literal: true
require 'spec_helper'
describe ClustersHelper do
describe '#has_rbac_enabled?' do
context 'when kubernetes platform has been created' do
let(:platform_kubernetes) { build_stubbed(:cluster_platform_kubernetes) }
let(:cluster) { build_stubbed(:cluster, :provided_by_gcp, platform_kubernetes: platform_kubernetes) }
it 'returns kubernetes platform value' do
expect(helper.has_rbac_enabled?(cluster)).to be_truthy
end
end
context 'when kubernetes platform has not been created yet' do
let(:cluster) { build_stubbed(:cluster, :providing_by_gcp) }
it 'delegates to cluster provider' do
expect(helper.has_rbac_enabled?(cluster)).to be_truthy
end
context 'when ABAC cluster is created' do
let(:provider) { build_stubbed(:cluster_provider_gcp, :abac_enabled) }
let(:cluster) { build_stubbed(:cluster, :providing_by_gcp, provider_gcp: provider) }
it 'delegates to cluster provider' do
expect(helper.has_rbac_enabled?(cluster)).to be_falsy
end
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment