Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
9c406687
Commit
9c406687
authored
Nov 01, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/gitlab@master
parent
77a73903
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
184 additions
and
57 deletions
+184
-57
app/assets/javascripts/create_cluster/gke_cluster_namespace/index.js
...javascripts/create_cluster/gke_cluster_namespace/index.js
+0
-0
app/assets/javascripts/create_cluster/init_create_cluster.js
app/assets/javascripts/create_cluster/init_create_cluster.js
+37
-0
app/assets/javascripts/pages/admin/clusters/index.js
app/assets/javascripts/pages/admin/clusters/index.js
+2
-18
app/assets/javascripts/pages/groups/index.js
app/assets/javascripts/pages/groups/index.js
+2
-18
app/assets/javascripts/pages/projects/clusters/show/index.js
app/assets/javascripts/pages/projects/clusters/show/index.js
+1
-1
app/assets/javascripts/pages/projects/index.js
app/assets/javascripts/pages/projects/index.js
+2
-17
spec/features/admin/clusters/eks_spec.rb
spec/features/admin/clusters/eks_spec.rb
+29
-0
spec/features/groups/clusters/eks_spec.rb
spec/features/groups/clusters/eks_spec.rb
+35
-0
spec/features/projects/clusters/eks_spec.rb
spec/features/projects/clusters/eks_spec.rb
+1
-1
spec/frontend/create_cluster/gke_cluster_namespace/gke_cluster_namespace_spec.js
...uster/gke_cluster_namespace/gke_cluster_namespace_spec.js
+2
-2
spec/frontend/create_cluster/init_create_cluster_spec.js
spec/frontend/create_cluster/init_create_cluster_spec.js
+73
-0
No files found.
app/assets/javascripts/
projects
/gke_cluster_namespace/index.js
→
app/assets/javascripts/
create_cluster
/gke_cluster_namespace/index.js
View file @
9c406687
File moved
app/assets/javascripts/
pages/projects/clusters/new/index
.js
→
app/assets/javascripts/
create_cluster/init_create_cluster
.js
View file @
9c406687
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
import
initGkeDropdowns
from
'
./gke_cluster
'
;
import
initGkeNamespace
from
'
./gke_cluster_namespace
'
;
import
PersistentUserCallout
from
'
~/persistent_user_callout
'
;
const
newClusterViews
=
[
'
:clusters:new
'
,
'
:clusters:create_gcp
'
,
'
:clusters:create_user
'
];
const
isProjectLevelCluster
=
page
=>
page
.
startsWith
(
'
project:clusters
'
);
export
default
(
document
,
gon
)
=>
{
const
{
page
}
=
document
.
body
.
dataset
;
const
isNewClusterView
=
newClusterViews
.
some
(
view
=>
page
.
endsWith
(
view
));
if
(
!
isNewClusterView
)
{
return
;
}
const
callout
=
document
.
querySelector
(
'
.gcp-signup-offer
'
);
PersistentUserCallout
.
factory
(
callout
);
initGkeDropdowns
();
if
(
gon
.
features
.
createEksClusters
)
{
import
(
/* webpackChunkName: 'eks_cluster' */
'
~/create_cluster/eks_cluster
'
)
.
then
(({
default
:
initCreateEKSCluster
})
=>
{
...
...
@@ -10,4 +30,8 @@ document.addEventListener('DOMContentLoaded', () => {
})
.
catch
(()
=>
{});
}
});
if
(
isProjectLevelCluster
(
page
))
{
initGkeNamespace
();
}
};
app/assets/javascripts/pages/admin/clusters/index.js
View file @
9c406687
import
PersistentUserCallout
from
'
~/persistent_user_callout
'
;
import
initGkeDropdowns
from
'
~/create_cluster/gke_cluster
'
;
function
initGcpSignupCallout
()
{
const
callout
=
document
.
querySelector
(
'
.gcp-signup-offer
'
);
PersistentUserCallout
.
factory
(
callout
);
}
import
initCreateCluster
from
'
~/create_cluster/init_create_cluster
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
const
{
page
}
=
document
.
body
.
dataset
;
const
newClusterViews
=
[
'
admin:clusters:new
'
,
'
admin:clusters:create_gcp
'
,
'
admin:clusters:create_user
'
,
];
if
(
newClusterViews
.
indexOf
(
page
)
>
-
1
)
{
initGcpSignupCallout
();
initGkeDropdowns
();
}
initCreateCluster
(
document
,
gon
);
});
app/assets/javascripts/pages/groups/index.js
View file @
9c406687
import
PersistentUserCallout
from
'
~/persistent_user_callout
'
;
import
initGkeDropdowns
from
'
~/create_cluster/gke_cluster
'
;
function
initGcpSignupCallout
()
{
const
callout
=
document
.
querySelector
(
'
.gcp-signup-offer
'
);
PersistentUserCallout
.
factory
(
callout
);
}
import
initCreateCluster
from
'
~/create_cluster/init_create_cluster
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
const
{
page
}
=
document
.
body
.
dataset
;
const
newClusterViews
=
[
'
groups:clusters:new
'
,
'
groups:clusters:create_gcp
'
,
'
groups:clusters:create_user
'
,
];
if
(
newClusterViews
.
indexOf
(
page
)
>
-
1
)
{
initGcpSignupCallout
();
initGkeDropdowns
();
}
initCreateCluster
(
document
,
gon
);
});
app/assets/javascripts/pages/projects/clusters/show/index.js
View file @
9c406687
import
ClustersBundle
from
'
~/clusters/clusters_bundle
'
;
import
initGkeNamespace
from
'
~/
projects
/gke_cluster_namespace
'
;
import
initGkeNamespace
from
'
~/
create_cluster
/gke_cluster_namespace
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
new
ClustersBundle
();
// eslint-disable-line no-new
...
...
app/assets/javascripts/pages/projects/index.js
View file @
9c406687
import
initGkeDropdowns
from
'
~/create_cluster/gke_cluster
'
;
import
initGkeNamespace
from
'
~/projects/gke_cluster_namespace
'
;
import
PersistentUserCallout
from
'
../../persistent_user_callout
'
;
import
Project
from
'
./project
'
;
import
ShortcutsNavigation
from
'
../../behaviors/shortcuts/shortcuts_navigation
'
;
import
initCreateCluster
from
'
~/create_cluster/init_create_cluster
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
const
{
page
}
=
document
.
body
.
dataset
;
const
newClusterViews
=
[
'
projects:clusters:new
'
,
'
projects:clusters:create_gcp
'
,
'
projects:clusters:create_user
'
,
];
if
(
newClusterViews
.
indexOf
(
page
)
>
-
1
)
{
const
callout
=
document
.
querySelector
(
'
.gcp-signup-offer
'
);
PersistentUserCallout
.
factory
(
callout
);
initGkeDropdowns
();
initGkeNamespace
();
}
initCreateCluster
(
document
,
gon
);
new
Project
();
// eslint-disable-line no-new
new
ShortcutsNavigation
();
// eslint-disable-line no-new
...
...
spec/features/admin/clusters/eks_spec.rb
0 → 100644
View file @
9c406687
# frozen_string_literal: true
require
'spec_helper'
describe
'Instance-level AWS EKS Cluster'
,
:js
do
let
(
:user
)
{
create
(
:admin
)
}
before
do
sign_in
(
user
)
end
context
'when user does not have a cluster and visits group clusters page'
do
before
do
visit
admin_clusters_path
click_link
'Add Kubernetes cluster'
end
context
'when user creates a cluster on AWS EKS'
do
before
do
click_link
'Amazon EKS'
end
it
'user sees a form to create an EKS cluster'
do
expect
(
page
).
to
have_content
(
'Create new Cluster on EKS'
)
end
end
end
end
spec/features/groups/clusters/eks_spec.rb
0 → 100644
View file @
9c406687
# frozen_string_literal: true
require
'spec_helper'
describe
'Group AWS EKS Cluster'
,
:js
do
let
(
:group
)
{
create
(
:group
)
}
let
(
:user
)
{
create
(
:user
)
}
before
do
group
.
add_maintainer
(
user
)
gitlab_sign_in
(
user
)
allow
(
Groups
::
ClustersController
).
to
receive
(
:STATUS_POLLING_INTERVAL
)
{
100
}
allow_any_instance_of
(
Clusters
::
Kubernetes
::
CreateOrUpdateNamespaceService
).
to
receive
(
:execute
)
allow_any_instance_of
(
Clusters
::
Cluster
).
to
receive
(
:retrieve_connection_status
).
and_return
(
:connected
)
end
context
'when user does not have a cluster and visits group clusters page'
do
before
do
visit
group_clusters_path
(
group
)
click_link
'Add Kubernetes cluster'
end
context
'when user creates a cluster on AWS EKS'
do
before
do
click_link
'Amazon EKS'
end
it
'user sees a form to create an EKS cluster'
do
expect
(
page
).
to
have_content
(
'Create new Cluster on EKS'
)
end
end
end
end
spec/features/projects/clusters/eks_spec.rb
View file @
9c406687
...
...
@@ -27,7 +27,7 @@ describe 'AWS EKS Cluster', :js do
end
it
'user sees a form to create an EKS cluster'
do
expect
(
page
).
to
have_
selector
(
:css
,
'.js-create-eks-cluster
'
)
expect
(
page
).
to
have_
content
(
'Create new Cluster on EKS
'
)
end
end
end
...
...
spec/frontend/
projects
/gke_cluster_namespace/gke_cluster_namespace_spec.js
→
spec/frontend/
create_cluster
/gke_cluster_namespace/gke_cluster_namespace_spec.js
View file @
9c406687
import
initGkeNamespace
from
'
~/
projects
/gke_cluster_namespace
'
;
import
initGkeNamespace
from
'
~/
create_cluster
/gke_cluster_namespace
'
;
describe
(
'
GKE cluster namespace
'
,
()
=>
{
const
changeEvent
=
new
Event
(
'
change
'
);
...
...
spec/frontend/create_cluster/init_create_cluster_spec.js
0 → 100644
View file @
9c406687
import
initCreateCluster
from
'
~/create_cluster/init_create_cluster
'
;
import
initGkeDropdowns
from
'
~/create_cluster/gke_cluster
'
;
import
initGkeNamespace
from
'
~/create_cluster/gke_cluster_namespace
'
;
import
PersistentUserCallout
from
'
~/persistent_user_callout
'
;
jest
.
mock
(
'
~/create_cluster/gke_cluster
'
,
()
=>
jest
.
fn
());
jest
.
mock
(
'
~/create_cluster/gke_cluster_namespace
'
,
()
=>
jest
.
fn
());
jest
.
mock
(
'
~/persistent_user_callout
'
,
()
=>
({
factory
:
jest
.
fn
(),
}));
describe
(
'
initCreateCluster
'
,
()
=>
{
let
document
;
let
gon
;
beforeEach
(()
=>
{
document
=
{
body
:
{
dataset
:
{}
},
querySelector
:
jest
.
fn
(),
};
gon
=
{
features
:
{}
};
});
afterEach
(()
=>
{
initGkeDropdowns
.
mockReset
();
initGkeNamespace
.
mockReset
();
PersistentUserCallout
.
factory
.
mockReset
();
});
describe
.
each
`
pageSuffix | page
${
'
:clusters:new
'
}
|
${
'
project:clusters:new
'
}
${
'
:clusters:create_gcp
'
}
|
${
'
groups:clusters:create_gcp
'
}
${
'
:clusters:create_user
'
}
|
${
'
admin:clusters:create_user
'
}
`
(
'
when cluster page ends in $pageSuffix
'
,
({
page
})
=>
{
beforeEach
(()
=>
{
document
.
body
.
dataset
=
{
page
};
initCreateCluster
(
document
,
gon
);
});
it
(
'
initializes create GKE cluster app
'
,
()
=>
{
expect
(
initGkeDropdowns
).
toHaveBeenCalled
();
});
it
(
'
initializes gcp signup offer banner
'
,
()
=>
{
expect
(
PersistentUserCallout
.
factory
).
toHaveBeenCalled
();
});
});
describe
(
'
when creating a project level cluster
'
,
()
=>
{
it
(
'
initializes gke namespace app
'
,
()
=>
{
document
.
body
.
dataset
.
page
=
'
project:clusters:new
'
;
initCreateCluster
(
document
,
gon
);
expect
(
initGkeNamespace
).
toHaveBeenCalled
();
});
});
describe
.
each
`
clusterLevel | page
${
'
group level
'
}
|
${
'
groups:clusters:new
'
}
${
'
instance level
'
}
|
${
'
admin:clusters:create_gcp
'
}
`
(
'
when creating a $clusterLevel cluster
'
,
({
page
})
=>
{
it
(
'
does not initialize gke namespace app
'
,
()
=>
{
document
.
body
.
dataset
=
{
page
};
initCreateCluster
(
document
,
gon
);
expect
(
initGkeNamespace
).
not
.
toHaveBeenCalled
();
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment