Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Renovate Bot
renovate
Commits
052e92ea
Unverified
Commit
052e92ea
authored
3 years ago
by
Rhys Arkins
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix(terraform): externalhosterror for 503 (#12760)
Co-authored-by:
Michael Kriese
<
michael.kriese@visualon.de
>
parent
65ed85a6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/datasource/terraform-module/base.ts
+14
-0
14 additions, 0 deletions
lib/datasource/terraform-module/base.ts
lib/datasource/terraform-module/index.ts
+0
-10
0 additions, 10 deletions
lib/datasource/terraform-module/index.ts
with
14 additions
and
10 deletions
lib/datasource/terraform-module/base.ts
+
14
−
0
View file @
052e92ea
import
{
ExternalHostError
}
from
'
../../types/errors/external-host-error
'
;
import
{
cache
}
from
'
../../util/cache/package/decorator
'
;
import
type
{
HttpError
}
from
'
../../util/http/types
'
;
import
{
ensureTrailingSlash
}
from
'
../../util/url
'
;
import
{
Datasource
}
from
'
../datasource
'
;
import
type
{
ServiceDiscoveryResult
}
from
'
./types
'
;
...
...
@@ -26,4 +28,16 @@ export abstract class TerraformDatasource extends Datasource {
private
static
getDiscoveryUrl
(
registryUrl
:
string
):
string
{
return
`
${
ensureTrailingSlash
(
registryUrl
)}
.well-known/terraform.json`
;
}
override
handleSpecificErrors
(
err
:
HttpError
):
void
{
const
failureCodes
=
[
'
EAI_AGAIN
'
];
// istanbul ignore if
if
(
failureCodes
.
includes
(
err
.
code
))
{
throw
new
ExternalHostError
(
err
);
}
// istanbul ignore if
if
(
err
.
response
?.
statusCode
===
503
)
{
throw
new
ExternalHostError
(
err
);
}
}
}
This diff is collapsed.
Click to expand it.
lib/datasource/terraform-module/index.ts
+
0
−
10
View file @
052e92ea
import
{
logger
}
from
'
../../logger
'
;
import
{
ExternalHostError
}
from
'
../../types/errors/external-host-error
'
;
import
{
cache
}
from
'
../../util/cache/package/decorator
'
;
import
type
{
HttpError
}
from
'
../../util/http/types
'
;
import
{
regEx
}
from
'
../../util/regex
'
;
import
*
as
hashicorpVersioning
from
'
../../versioning/hashicorp
'
;
import
type
{
GetReleasesConfig
,
ReleaseResult
}
from
'
../types
'
;
...
...
@@ -83,14 +81,6 @@ export class TerraformModuleDatasource extends TerraformDatasource {
return
dep
;
}
override
handleSpecificErrors
(
err
:
HttpError
):
void
{
const
failureCodes
=
[
'
EAI_AGAIN
'
];
// istanbul ignore if
if
(
failureCodes
.
includes
(
err
.
code
))
{
throw
new
ExternalHostError
(
err
);
}
}
private
static
getRegistryRepository
(
lookupName
:
string
,
registryUrl
:
string
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment