Commit 89339612 authored by Enrique Alcántara's avatar Enrique Alcántara

Merge branch '343917-remove-cluster-vulnerability-feature-flag' into 'master'

Remove :cluster_vulnerabilities feature flag

See merge request gitlab-org/gitlab!81462
parents 10593bb5 e7b5b39b
......@@ -3,10 +3,6 @@
class Projects::ClusterAgentsController < Projects::ApplicationController
before_action :authorize_can_read_cluster_agent!
before_action do
push_frontend_feature_flag(:cluster_vulnerabilities, project, default_enabled: :yaml)
end
feature_category :kubernetes_management
def show
......
---
name: cluster_vulnerabilities
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/73321
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/343917
milestone: '14.5'
type: development
group: group::container security
default_enabled: true
......@@ -6,7 +6,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Container vulnerability scanning **(ULTIMATE)**
> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/6346) in GitLab 14.8 [with a flag](../../../administration/feature_flags.md) named `cluster_vulnerabilities`. Enabled by default.
> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/6346) in GitLab 14.8.
To view cluster vulnerabilities, you can view the [vulnerability report](../../application_security/vulnerabilities/index.md).
You can also configure your agent so the vulnerabilities are displayed with other agent information in GitLab.
......
......@@ -17,9 +17,7 @@ export default {
mixins: [glFeatureFlagMixin()],
computed: {
showSecurityTab() {
return (
this.glFeatures.kubernetesClusterVulnerabilities && this.glFeatures.clusterVulnerabilities
);
return this.glFeatures.kubernetesClusterVulnerabilities;
},
},
};
......
import { GlTab } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import { nextTick } from 'vue';
import { stubComponent } from 'helpers/stub_component';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import ClusterAgentShow from 'ee/clusters/agents/components/show.vue';
......@@ -16,7 +15,7 @@ describe('ClusterAgentShow', () => {
template: `<div><slot name="ee-security-tab" clusterAgentId="${clusterAgentId}"></slot></div>`,
});
const createWrapper = ({ glFeatures = {} } = {}) => {
const createWrapper = ({ glFeatures = { kubernetesClusterVulnerabilities: true } } = {}) => {
wrapper = extendedWrapper(
shallowMount(ClusterAgentShow, {
provide: { glFeatures },
......@@ -34,27 +33,27 @@ describe('ClusterAgentShow', () => {
wrapper.destroy();
});
describe('tab behavior', () => {
it.each`
title | glFeatures | tabStatus
${'does not display the tab when no glFeatures are available'} | ${{}} | ${false}
${'does not display the tab when only the "clusterVulnerabilities" flag is true'} | ${{ clusterVulnerabilities: true }} | ${false}
${'does not display the tab when only the "kubernetesClusterVulnerabilities" flag is true'} | ${{ kubernetesClusterVulnerabilities: true }} | ${false}
${'does display the tab when both the "kubernetesClusterVulnerabilities" flag and "clusterVulnerabilities" flag are true'} | ${{ clusterVulnerabilities: true, kubernetesClusterVulnerabilities: true }} | ${true}
`('$title', async ({ glFeatures, tabStatus }) => {
createWrapper({ glFeatures });
await nextTick();
expect(findTab().exists()).toBe(tabStatus);
describe('when a user does have permission', () => {
beforeEach(() => {
createWrapper();
});
it('does not display the tab', () => {
expect(findTab().exists()).toBe(true);
});
});
describe('vulnerability report', () => {
it('renders with cluster agent id', async () => {
createWrapper({
glFeatures: { clusterVulnerabilities: true, kubernetesClusterVulnerabilities: true },
});
await nextTick();
it('does display the cluster agent id', () => {
expect(findAgentVulnerabilityReport().props('clusterAgentId')).toBe(clusterAgentId);
});
});
describe('without access', () => {
beforeEach(() => {
createWrapper({ glFeatures: { kubernetesClusterVulnerabilities: false } });
});
it('when a user does not have permission', () => {
expect(findTab().exists()).toBe(false);
});
});
});
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