This repository was archived by the owner on May 26, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 52
support private quay instance #171
Open
jkandasa
wants to merge
2
commits into
operator-framework:master
Choose a base branch
from
jkandasa:quay_private_instance
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,14 +21,20 @@ class PushCmd(): | |
| def __init__(self): | ||
| pass | ||
|
|
||
| def push(self, bundle_dir, namespace, repository, release, auth_token): | ||
| def push(self, bundle_dir, namespace, repository, release, auth_token, | ||
| quay_host, verify_host): | ||
| """Push takes a bundle and pushes it to the specified app registry repository. | ||
|
|
||
| :param bundle_dir: Path to generated local directory that contains the bundle. | ||
| :param namespace: Namespace that contains the repository for the application. | ||
| :param repository: Repository name of the application described by the bundle. | ||
| :param release: Release version of the bundle. | ||
| :param auth_token: Authentication token used to push to Quay.io. | ||
| :param quay_host: Can be 'quay.io' or your private instance hostname. | ||
| :param verify_host: Either a boolean, in which case it controls whether we verify | ||
| the server's TLS certificate, or a string, in which case | ||
| it must be a path to a CA bundle to use. | ||
| Defaults to ``True``. | ||
| """ | ||
| logger.info('Generating 64 bit bundle and pushing to app registry.') | ||
| filterOutFiles(bundle_dir, BLACK_LIST) | ||
|
|
@@ -45,14 +51,16 @@ def _create_base64_bundle(self, bundle_dir, repository): | |
| result64 = base64.b64encode(result).decode("utf-8") | ||
| return result64 | ||
|
|
||
| def _push_to_registry(self, namespace, repository, release, bundle, auth_token): | ||
| push_uri = 'https://quay.io/cnr/api/v1/packages/%s/%s' % (namespace, repository) | ||
| def _push_to_registry(self, namespace, repository, release, bundle, auth_token, | ||
| quay_host, verify_host): | ||
| push_uri = 'https://%s/cnr/api/v1/packages/%s/%s' % (quay_host, namespace, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we are going to do this, rather than just support additional
|
||
| repository) | ||
| logger.info('Pushing bundle to %s' % push_uri) | ||
| headers = {'Content-Type': 'application/json', 'Authorization': auth_token} | ||
| json = {'blob': bundle, 'release': release, "media_type": "helm"} | ||
|
|
||
| try: | ||
| r = requests.post(push_uri, json=json, headers=headers) | ||
| r = requests.post(push_uri, json=json, headers=headers, verify=verify_host) | ||
| except requests.RequestException as e: | ||
| msg = str(e) | ||
| logger.error(msg) | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just below this, don't you also need to update the call to
_push_to_registry()to actually pass the new parameters along?