...@@ -54,10 +54,15 @@ const Api = { ...@@ -54,10 +54,15 @@ const Api = {
}); });
}, },
groupMembers(id) { groupMembers(id, options) {
const url = Api.buildUrl(this.groupMembersPath).replace(':id', encodeURIComponent(id)); const url = Api.buildUrl(this.groupMembersPath).replace(':id', encodeURIComponent(id));
return axios.get(url); return axios.get(url, {
params: {
per_page: DEFAULT_PER_PAGE,
...options,
},
});
}, },
// Return groups list. Filtered by query // Return groups list. Filtered by query
... ...
......
...@@ -21,10 +21,15 @@ module Clusters ...@@ -21,10 +21,15 @@ module Clusters
attr_reader :cluster, :kubernetes_namespace, :platform attr_reader :cluster, :kubernetes_namespace, :platform
def create_project_service_account def create_project_service_account
environment_slug = kubernetes_namespace.environment&.slug
namespace_labels = { 'app.gitlab.com/app' => kubernetes_namespace.project.full_path_slug }
namespace_labels['app.gitlab.com/env'] = environment_slug if environment_slug
Clusters::Kubernetes::CreateOrUpdateServiceAccountService.namespace_creator( Clusters::Kubernetes::CreateOrUpdateServiceAccountService.namespace_creator(
platform.kubeclient, platform.kubeclient,
service_account_name: kubernetes_namespace.service_account_name, service_account_name: kubernetes_namespace.service_account_name,
service_account_namespace: kubernetes_namespace.namespace, service_account_namespace: kubernetes_namespace.namespace,
service_account_namespace_labels: namespace_labels,
rbac: platform.rbac? rbac: platform.rbac?
).execute ).execute
end end
... ...
......
...@@ -3,10 +3,11 @@ ...@@ -3,10 +3,11 @@
module Clusters module Clusters
module Kubernetes module Kubernetes
class CreateOrUpdateServiceAccountService class CreateOrUpdateServiceAccountService
def initialize(kubeclient, service_account_name:, service_account_namespace:, token_name:, rbac:, namespace_creator: false, role_binding_name: nil) def initialize(kubeclient, service_account_name:, service_account_namespace:, service_account_namespace_labels: nil, token_name:, rbac:, namespace_creator: false, role_binding_name: nil)
@kubeclient = kubeclient @kubeclient = kubeclient
@service_account_name = service_account_name @service_account_name = service_account_name
@service_account_namespace = service_account_namespace @service_account_namespace = service_account_namespace
@service_account_namespace_labels = service_account_namespace_labels
@token_name = token_name @token_name = token_name
@rbac = rbac @rbac = rbac
@namespace_creator = namespace_creator @namespace_creator = namespace_creator
...@@ -23,11 +24,12 @@ module Clusters ...@@ -23,11 +24,12 @@ module Clusters
) )
end end
def self.namespace_creator(kubeclient, service_account_name:, service_account_namespace:, rbac:) def self.namespace_creator(kubeclient, service_account_name:, service_account_namespace:, service_account_namespace_labels:, rbac:)
self.new( self.new(
kubeclient, kubeclient,
service_account_name: service_account_name, service_account_name: service_account_name,
service_account_namespace: service_account_namespace, service_account_namespace: service_account_namespace,
service_account_namespace_labels: service_account_namespace_labels,
token_name: "#{service_account_namespace}-token", token_name: "#{service_account_namespace}-token",
rbac: rbac, rbac: rbac,
namespace_creator: true, namespace_creator: true,
...@@ -55,12 +57,13 @@ module Clusters ...@@ -55,12 +57,13 @@ module Clusters
private private
attr_reader :kubeclient, :service_account_name, :service_account_namespace, :token_name, :rbac, :namespace_creator, :role_binding_name attr_reader :kubeclient, :service_account_name, :service_account_namespace, :service_account_namespace_labels, :token_name, :rbac, :namespace_creator, :role_binding_name
def ensure_project_namespace_exists def ensure_project_namespace_exists
Gitlab::Kubernetes::Namespace.new( Gitlab::Kubernetes::Namespace.new(
service_account_namespace, service_account_namespace,
kubeclient kubeclient,
labels: service_account_namespace_labels
).ensure_exists! ).ensure_exists!
end end
... ...
......
---
title: Assign labels to the GMA and project k8s namespaces
merge_request: 23027
author:
type: added
...@@ -86,6 +86,14 @@ to help summarize changes between versions. ...@@ -86,6 +86,14 @@ to help summarize changes between versions.
| Modified (in the selected version) | ![Design Modified](img/design_modified_v12_3.png) | | Modified (in the selected version) | ![Design Modified](img/design_modified_v12_3.png) |
| Added (in the selected version) | ![Design Added](img/design_added_v12_3.png) | | Added (in the selected version) | ![Design Added](img/design_added_v12_3.png) |
### Exploring designs by zooming
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/13217) in [GitLab Premium](https://about.gitlab.com/pricing/) 12.7.
Designs can be explored in greater detail by zooming in and out of the image. Control the amount of zoom with the `+` and `-` buttons at the bottom of the image. While zoomed, you can still [add new annotations](#adding-annotations-to-designs) to the image, and see any existing ones.
![Design zooming](img/design_zooming_v12_7.png)
## Deleting designs ## Deleting designs
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/11089) in [GitLab Premium](https://about.gitlab.com/pricing/) 12.4. > [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/11089) in [GitLab Premium](https://about.gitlab.com/pricing/) 12.4.
... ...
......
doc/user/project/issues/img/design_zooming_v12_7.png

577 KiB

...@@ -6,6 +6,7 @@ module Gitlab ...@@ -6,6 +6,7 @@ module Gitlab
HELM_VERSION = '2.16.1' HELM_VERSION = '2.16.1'
KUBECTL_VERSION = '1.13.12' KUBECTL_VERSION = '1.13.12'
NAMESPACE = 'gitlab-managed-apps' NAMESPACE = 'gitlab-managed-apps'
NAMESPACE_LABELS = { 'app.gitlab.com/managed_by' => :gitlab }.freeze
SERVICE_ACCOUNT = 'tiller' SERVICE_ACCOUNT = 'tiller'
CLUSTER_ROLE_BINDING = 'tiller-admin' CLUSTER_ROLE_BINDING = 'tiller-admin'
CLUSTER_ROLE = 'cluster-admin' CLUSTER_ROLE = 'cluster-admin'
... ...
......
...@@ -6,7 +6,11 @@ module Gitlab ...@@ -6,7 +6,11 @@ module Gitlab
class Api class Api
def initialize(kubeclient) def initialize(kubeclient)
@kubeclient = kubeclient @kubeclient = kubeclient
@namespace = Gitlab::Kubernetes::Namespace.new(Gitlab::Kubernetes::Helm::NAMESPACE, kubeclient) @namespace = Gitlab::Kubernetes::Namespace.new(
Gitlab::Kubernetes::Helm::NAMESPACE,
kubeclient,
labels: Gitlab::Kubernetes::Helm::NAMESPACE_LABELS
)
end end
def install(command) def install(command)
... ...
......
...@@ -3,11 +3,12 @@ ...@@ -3,11 +3,12 @@
module Gitlab module Gitlab
module Kubernetes module Kubernetes
class Namespace class Namespace
attr_accessor :name attr_accessor :name, :labels
def initialize(name, client) def initialize(name, client, labels: nil)
@name = name @name = name
@client = client @client = client
@labels = labels
end end
def exists? def exists?
...@@ -17,7 +18,7 @@ module Gitlab ...@@ -17,7 +18,7 @@ module Gitlab
end end
def create! def create!
resource = ::Kubeclient::Resource.new(metadata: { name: name }) resource = ::Kubeclient::Resource.new(metadata: { name: name, labels: labels })
log_event(:begin_create) log_event(:begin_create)
@client.create_namespace(resource) @client.create_namespace(resource)
... ...
......
...@@ -1754,6 +1754,9 @@ msgstr "" ...@@ -1754,6 +1754,9 @@ msgstr ""
msgid "An error occurred while loading filenames" msgid "An error occurred while loading filenames"
msgstr "" msgstr ""
msgid "An error occurred while loading group members."
msgstr ""
msgid "An error occurred while loading issues" msgid "An error occurred while loading issues"
msgstr "" msgstr ""
...@@ -9306,6 +9309,9 @@ msgstr "" ...@@ -9306,6 +9309,9 @@ msgstr ""
msgid "GroupSAML|Generate a SCIM token to set up your System for Cross-Domain Identity Management." msgid "GroupSAML|Generate a SCIM token to set up your System for Cross-Domain Identity Management."
msgstr "" msgstr ""
msgid "GroupSAML|Identity"
msgstr ""
msgid "GroupSAML|Identity provider single sign on URL" msgid "GroupSAML|Identity provider single sign on URL"
msgstr "" msgstr ""
...@@ -9315,6 +9321,9 @@ msgstr "" ...@@ -9315,6 +9321,9 @@ msgstr ""
msgid "GroupSAML|Manage your group’s membership while adding another level of security with SAML." msgid "GroupSAML|Manage your group’s membership while adding another level of security with SAML."
msgstr "" msgstr ""
msgid "GroupSAML|Members"
msgstr ""
msgid "GroupSAML|Members will be forwarded here when signing in to your group. Get this from your identity provider, where it can also be called \"SSO Service Location\", \"SAML Token Issuance Endpoint\", or \"SAML 2.0/W-Federation URL\"." msgid "GroupSAML|Members will be forwarded here when signing in to your group. Get this from your identity provider, where it can also be called \"SSO Service Location\", \"SAML Token Issuance Endpoint\", or \"SAML 2.0/W-Federation URL\"."
msgstr "" msgstr ""
...@@ -20152,6 +20161,9 @@ msgstr "" ...@@ -20152,6 +20161,9 @@ msgstr ""
msgid "Used to help configure your identity provider" msgid "Used to help configure your identity provider"
msgstr "" msgstr ""
msgid "User"
msgstr ""
msgid "User %{current_user_username} has started impersonating %{username}" msgid "User %{current_user_username} has started impersonating %{username}"
msgstr "" msgstr ""
... ...
......
...@@ -22,7 +22,6 @@ describe('CompareVersions', () => { ...@@ -22,7 +22,6 @@ describe('CompareVersions', () => {
store.state.diffs.diffFiles.push('test'); store.state.diffs.diffFiles.push('test');
wrapper = mount(CompareVersionsComponent, { wrapper = mount(CompareVersionsComponent, {
attachToDocument: true,
localVue, localVue,
store, store,
propsData: { propsData: {
... ...
......
...@@ -91,7 +91,6 @@ describe('DiffFileHeader component', () => { ...@@ -91,7 +91,6 @@ describe('DiffFileHeader component', () => {
}, },
localVue, localVue,
store, store,
attachToDocument: true,
}); });
}; };
... ...
......
...@@ -16,7 +16,6 @@ describe('DiffGutterAvatars', () => { ...@@ -16,7 +16,6 @@ describe('DiffGutterAvatars', () => {
propsData: { propsData: {
...props, ...props,
}, },
attachToDocument: true,
}); });
}; };
... ...
......
...@@ -9,7 +9,6 @@ describe('EditButton', () => { ...@@ -9,7 +9,6 @@ describe('EditButton', () => {
const createComponent = (props = {}) => { const createComponent = (props = {}) => {
wrapper = shallowMount(EditButton, { wrapper = shallowMount(EditButton, {
propsData: { ...props }, propsData: { ...props },
attachToDocument: true,
}); });
}; };
... ...
......
...@@ -37,7 +37,6 @@ describe('issue_comment_form component', () => { ...@@ -37,7 +37,6 @@ describe('issue_comment_form component', () => {
noteableType, noteableType,
}, },
store, store,
attachToDocument: true,
}); });
}; };
... ...
......
...@@ -5,9 +5,7 @@ describe('JumpToNextDiscussionButton', () => { ...@@ -5,9 +5,7 @@ describe('JumpToNextDiscussionButton', () => {
let wrapper; let wrapper;
beforeEach(() => { beforeEach(() => {
wrapper = shallowMount(JumpToNextDiscussionButton, { wrapper = shallowMount(JumpToNextDiscussionButton);
attachToDocument: true,
});
}); });
afterEach(() => { afterEach(() => {
... ...
......
...@@ -31,7 +31,6 @@ describe('DiscussionNotes', () => { ...@@ -31,7 +31,6 @@ describe('DiscussionNotes', () => {
slots: { slots: {
'avatar-badge': '<span class="avatar-badge-slot-content" />', 'avatar-badge': '<span class="avatar-badge-slot-content" />',
}, },
attachToDocument: true,
}); });
}; };
... ...
......
...@@ -59,7 +59,6 @@ describe('note_app', () => { ...@@ -59,7 +59,6 @@ describe('note_app', () => {
</div>`, </div>`,
}, },
{ {
attachToDocument: true,
propsData, propsData,
store, store,
}, },
... ...
......
...@@ -21,7 +21,6 @@ describe('NoteEditedText', () => { ...@@ -21,7 +21,6 @@ describe('NoteEditedText', () => {
beforeEach(() => { beforeEach(() => {
wrapper = shallowMount(NoteEditedText, { wrapper = shallowMount(NoteEditedText, {
propsData, propsData,
attachToDocument: true,
}); });
}); });
... ...
......
...@@ -6,7 +6,8 @@ describe Gitlab::Kubernetes::Helm::Api do ...@@ -6,7 +6,8 @@ describe Gitlab::Kubernetes::Helm::Api do
let(:client) { double('kubernetes client') } let(:client) { double('kubernetes client') }
let(:helm) { described_class.new(client) } let(:helm) { described_class.new(client) }
let(:gitlab_namespace) { Gitlab::Kubernetes::Helm::NAMESPACE } let(:gitlab_namespace) { Gitlab::Kubernetes::Helm::NAMESPACE }
let(:namespace) { Gitlab::Kubernetes::Namespace.new(gitlab_namespace, client) } let(:gitlab_namespace_labels) { Gitlab::Kubernetes::Helm::NAMESPACE_LABELS }
let(:namespace) { Gitlab::Kubernetes::Namespace.new(gitlab_namespace, client, labels: gitlab_namespace_labels) }
let(:application_name) { 'app-name' } let(:application_name) { 'app-name' }
let(:rbac) { false } let(:rbac) { false }
let(:files) { {} } let(:files) { {} }
...@@ -23,13 +24,17 @@ describe Gitlab::Kubernetes::Helm::Api do ...@@ -23,13 +24,17 @@ describe Gitlab::Kubernetes::Helm::Api do
subject { helm } subject { helm }
before do before do
allow(Gitlab::Kubernetes::Namespace).to receive(:new).with(gitlab_namespace, client).and_return(namespace) allow(Gitlab::Kubernetes::Namespace).to(
receive(:new).with(gitlab_namespace, client, labels: gitlab_namespace_labels).and_return(namespace)
)
allow(client).to receive(:create_config_map) allow(client).to receive(:create_config_map)
end end
describe '#initialize' do describe '#initialize' do
it 'creates a namespace object' do it 'creates a namespace object' do
expect(Gitlab::Kubernetes::Namespace).to receive(:new).with(gitlab_namespace, client) expect(Gitlab::Kubernetes::Namespace).to(
receive(:new).with(gitlab_namespace, client, labels: gitlab_namespace_labels)
)
subject subject
end end
... ...
......