Skip to content

Commit

Permalink
fix(manager/helm): add hostType for helm dependencies during artifact…
Browse files Browse the repository at this point in the history
…update (#17583)

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
  • Loading branch information
secustor and viceice committed Sep 2, 2022
1 parent d1dd05b commit e69a9ce
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/modules/manager/helmv3/artifacts.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ describe('modules/manager/helmv3/artifacts', () => {
hostRules.add({
username: 'basicUser',
password: 'secret',
hostType: 'helm',
matchHost: 'the_repo1_url',
});

Expand Down
2 changes: 2 additions & 0 deletions lib/modules/manager/helmv3/artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
} from '../../../util/fs';
import * as hostRules from '../../../util/host-rules';
import { DockerDatasource } from '../../datasource/docker';
import { HelmDatasource } from '../../datasource/helm';
import type { UpdateArtifact, UpdateArtifactsResult } from '../types';
import type { ChartDefinition, Repository, RepositoryRule } from './types';
import {
Expand Down Expand Up @@ -71,6 +72,7 @@ async function helmCommands(
...value,
hostRule: hostRules.find({
url: value.repository,
hostType: HelmDatasource.id,
}),
};
});
Expand Down
4 changes: 3 additions & 1 deletion lib/modules/manager/helmv3/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,16 @@ For this you use a custom `hostRules` array.
{
hostRules: [
{
// global login
// global login for 'gitlab.com' if using Helm
matchHost: 'gitlab.com',
hostType: 'helm', // this is optional, but else the credentials will be used for all request matching `matchHost`
username: '<some-username>',
password: '<some-password>',
},
{
// specific repository
matchHost: 'https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable',
hostType: 'helm', // this is optional
username: '<some-username>',
password: '<some-password>',
},
Expand Down

0 comments on commit e69a9ce

Please sign in to comment.