-
Notifications
You must be signed in to change notification settings - Fork 56
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
graph-builder/plugins/github scraper: add token authorization handling #233
graph-builder/plugins/github scraper: add token authorization handling #233
Conversation
graph-builder/src/plugins/github_openshift_secondary_metadata_scraper/plugin.rs
Outdated
Show resolved
Hide resolved
e2e flake: level=fatal msg="failed to fetch Cluster: failed to generate asset "Cluster": failed to create cluster: failed to apply using Terraform" /retest |
more flakes: level=error msg="Error: Error waiting for AMI (ami-0b526b366cf36f573) to be ready: timeout while waiting for state to become 'available' (last state: 'pending', timeout: 40m0s)" /retest |
2534549
to
3113fb0
Compare
Required to use github token in e2e runs, see openshift/cincinnati#233
dist/openshift/cincinnati.yaml
Outdated
@@ -174,7 +176,7 @@ objects: | |||
volumes: | |||
- name: secrets | |||
secret: | |||
secretName: cincinnati-registry-credentials | |||
secretName: cincinnati-credentials |
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.
hack/e2e.sh
is still using cincinnati-registry-credentials
.
I think this needs two template options:
- CREDENTIALS_SECRET_NAME (set by default to stage github token secret)
- CINCINNATI_GITHUB_SCRAPER_OAUTH_TOKEN_PATH (set to github token path by default)
and have hack/e2e.sh
adjusted to create a dummy secret and pass -p CINCINNATI_GITHUB_SCRAPER_OAUTH_TOKEN_PATH=""
in oc new-app
.
This way we can have:
- CREDENTIALS_SECRET_NAME in PR e2e set to docker credentials and CINCINNATI_GITHUB_SCRAPER_OAUTH_TOKEN_PATH set to none. e2e test for PRs won't use github token for authentication
- stage / prod deploy would mount the secret and use token-based authentication
This is similar to RUST_BACKTRACE env var
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.
Since CINCINNATI_GITHUB_SCRAPER_OAUTH_TOKEN_PATH=""
will lead to the error, I tried to find a way to leave this variable unset in the e2e environment. Please see the latest commit and let me know if it's a viable approach or not.
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.
That would work, but wouldn't template look cleaner if Cincinnati support empty path in CINCINNATI_GITHUB_SCRAPER_OAUTH_TOKEN_PATH
?
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.
In my mind that's a workaround and I would prefer to indicate the absence of the secret by the absence of the environment variable, instead of special casing the ""
value.
If you feel strongly against this exercise I can be convinced otherwise.
dbad675
to
32c5ab5
Compare
32c5ab5
to
c4f443d
Compare
/retest |
30fe23d
to
109c3b3
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: LalatenduMohanty, steveeJ 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 |
/hold cancel LGTM |
In preparation for consuming the 'version' file that graph-data grew in [1]. This gets us the first main-line commit to include the 'version' file: cincinnati-graph-data$ git --no-pager show --date=short --format='%ad %h %s' d980578d2e b87e7c2782 2020-03-18 d980578 Merge pull request openshift#125 from marun/unique-service-ca-serial 2020-05-11 b87e7c2 Merge pull request openshift#233 from wking/version-file [1]: openshift/cincinnati-graph-data#233
Consuming the 'version' file that graph-data grew in [1], so the logs will contain more useful error messages when the plugin is fed an incompatible schema version. Bumping the graph-data commit used for CI moves us to the first main-line commit to include the 'version' file: cincinnati-graph-data$ git --no-pager show --date=short --format='%ad %h %s' d980578d2e b87e7c2782 2020-03-18 d980578 Merge pull request openshift#125 from marun/unique-service-ca-serial 2020-05-11 b87e7c2 Merge pull request openshift#233 from wking/version-file [1]: openshift/cincinnati-graph-data#233
In preparation for consuming the 'version' file that graph-data grew in [1]. This gets us the first main-line commit to include the 'version' file: cincinnati-graph-data$ git --no-pager show --date=short --format='%ad %h %s' d980578d2e b87e7c2782 2020-03-18 d980578 Merge pull request openshift#125 from marun/unique-service-ca-serial 2020-05-11 b87e7c2 Merge pull request openshift#233 from wking/version-file [1]: openshift/cincinnati-graph-data#233
Consuming the 'version' file that graph-data grew in [1], so the logs will contain more useful error messages when the plugin is fed an incompatible schema version. Bumping the graph-data commit used for CI moves us to the first main-line commit to include the 'version' file: cincinnati-graph-data$ git --no-pager show --date=short --format='%ad %h %s' d980578d2e b87e7c2782 2020-03-18 d980578 Merge pull request openshift#125 from marun/unique-service-ca-serial 2020-05-11 b87e7c2 Merge pull request openshift#233 from wking/version-file [1]: openshift/cincinnati-graph-data#233
In preparation for consuming the 'version' file that graph-data grew in [1]. This gets us the first main-line commit to include the 'version' file: cincinnati-graph-data$ git --no-pager show --date=short --format='%ad %h %s' d980578d2e b87e7c2782 2020-03-18 d980578 Merge pull request openshift#125 from marun/unique-service-ca-serial 2020-05-11 b87e7c2 Merge pull request openshift#233 from wking/version-file [1]: openshift/cincinnati-graph-data#233
Consuming the 'version' file that graph-data grew in [1], so the logs will contain more useful error messages when the plugin is fed an incompatible schema version. Bumping the graph-data commit used for CI moves us to the first main-line commit to include the 'version' file: cincinnati-graph-data$ git --no-pager show --date=short --format='%ad %h %s' d980578d2e b87e7c2782 2020-03-18 d980578 Merge pull request openshift#125 from marun/unique-service-ca-serial 2020-05-11 b87e7c2 Merge pull request openshift#233 from wking/version-file [1]: openshift/cincinnati-graph-data#233
This implements reading a token from a file and setting the authorization header on the request towards the GitHub API.
It also adjusts the deployment template.