Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Applications: helms support registry with autentification #10570

Merged
merged 5 commits into from Jul 29, 2022

Conversation

vgramer
Copy link
Contributor

@vgramer vgramer commented Jul 29, 2022

What does this PR do / Why do we need it:
This PR adds support for Helm registry with authentication. There is 2 kinds of auth method:

  • basic (user /password) for HTTP repository
  • registryConfigFile for oci repository ( registryConfigFile is a dockercfg file that follows the same format rules as ~/.docker/config.json)

Does this PR close any issues?:
Fixes #9550
Fixes #9776

Special notes for your reviewer:
I recommend a first review by commit because some commits are just refactoring.

Test of HelmTemplate could be improved with authentification tests. But I think I would be better to do it in another PR, it would be the opportunity to switch from ginko to go test

Documentation:

Does this PR introduce a user-facing change?:

NONE

…Manager only if necessary (i.e. only if chartLoc is a directory)

Signed-off-by: Vincent Gramer <vincent@kubermatic.com>
@kubermatic-bot kubermatic-bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. sig/app-management Denotes a PR or issue as being assigned to SIG App Management. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 29, 2022
@kubermatic-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vgramer

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubermatic-bot kubermatic-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 29, 2022
@vgramer vgramer changed the title Helm auth Applications: helms support registry with autentification Jul 29, 2022
There is 2 kind of possible authentification one with basic auth for http and one that use registryConfigFile for oci.

tests has been refactor: ociregistry now take a fileGlob of chart to upload

Signed-off-by: Vincent Gramer <vincent@kubermatic.com>
Signed-off-by: Vincent Gramer <vincent@kubermatic.com>
…e we will use it for HelmSource

Signed-off-by: Vincent Gramer <vincent@kubermatic.com>
Signed-off-by: Vincent Gramer <vincent@kubermatic.com>
}

// AuthFromCredentials builds helmclient.AuthSettings from source.Credentials. registryConfigFilePath is the path of the file that stores credentials for OCI registry.
func AuthFromCredentials(ctx context.Context, client ctrlruntimeclient.Client, registryConfigFilePath string, secretNamespace string, source *appskubermaticv1.HelmSource) (helmclient.AuthSettings, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tiniest nitpick (just because I have nothing else to complain about, because everything's so nice :D)

This could inlcude Helm in the name of the func, since it is in a generic package called util and it does helm specific things

@kubermatic-bot kubermatic-bot added the lgtm Indicates that a PR is ready to be merged. label Jul 29, 2022
@kubermatic-bot
Copy link
Contributor

LGTM label has been added.

Git tree hash: f5677264cb68828d81e30e58bc5fb3e948067e73

@kubermatic-bot
Copy link
Contributor

kubermatic-bot commented Jul 29, 2022

@vgramer: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pre-kubermatic-api-e2e f4b7ff7 link unknown /test pre-kubermatic-api-e2e

Full PR test history

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@vgramer
Copy link
Contributor Author

vgramer commented Jul 29, 2022

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. sig/app-management Denotes a PR or issue as being assigned to SIG App Management. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fetch helm source with credentials Applications: add authentification in helm client
3 participants