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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
9e7a0854
Commit
9e7a0854
authored
Feb 26, 2020
by
Alishan Ladhani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Put Knative into an errored state when istio cannot be configured
parent
0d5165a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
0 deletions
+36
-0
app/services/clusters/kubernetes/configure_istio_ingress_service.rb
...es/clusters/kubernetes/configure_istio_ingress_service.rb
+4
-0
spec/services/clusters/kubernetes/configure_istio_ingress_service_spec.rb
...usters/kubernetes/configure_istio_ingress_service_spec.rb
+32
-0
No files found.
app/services/clusters/kubernetes/configure_istio_ingress_service.rb
View file @
9e7a0854
...
...
@@ -27,6 +27,10 @@ module Clusters
return
configure_certificates
if
serverless_domain_cluster
configure_passthrough
rescue
Kubeclient
::
HttpError
=>
e
knative
.
make_errored!
(
_
(
'Kubernetes error: %{error_code}'
)
%
{
error_code:
e
.
error_code
})
rescue
StandardError
knative
.
make_errored!
(
_
(
'Failed to update.'
))
end
private
...
...
spec/services/clusters/kubernetes/configure_istio_ingress_service_spec.rb
View file @
9e7a0854
...
...
@@ -194,4 +194,36 @@ describe Clusters::Kubernetes::ConfigureIstioIngressService, '#execute' do
)
end
end
context
'when there is an error'
do
before
do
cluster
.
application_knative
=
create
(
:clusters_applications_knative
)
allow_next_instance_of
(
described_class
)
do
|
instance
|
allow
(
instance
).
to
receive
(
:configure_passthrough
).
and_raise
(
error
)
end
end
context
'Kubeclient::HttpError'
do
let
(
:error
)
{
Kubeclient
::
HttpError
.
new
(
404
,
nil
,
nil
)
}
it
'puts Knative into an errored state'
do
subject
expect
(
cluster
.
application_knative
).
to
be_errored
expect
(
cluster
.
application_knative
.
status_reason
).
to
eq
(
'Kubernetes error: 404'
)
end
end
context
'StandardError'
do
let
(
:error
)
{
RuntimeError
.
new
(
'something went wrong'
)
}
it
'puts Knative into an errored state'
do
subject
expect
(
cluster
.
application_knative
).
to
be_errored
expect
(
cluster
.
application_knative
.
status_reason
).
to
eq
(
'Failed to update.'
)
end
end
end
end
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