-
Notifications
You must be signed in to change notification settings - Fork 109
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
Default to ocm login via environment variables; fall back to ocm login
config
#346
Default to ocm login via environment variables; fall back to ocm login
config
#346
Conversation
ocm login
config
8faf4ed
to
302fe53
Compare
/retest |
pkg/utils/ocm.go
Outdated
@@ -120,21 +141,122 @@ func GenerateQuery(clusterIdentifier string) string { | |||
return strings.TrimSpace(fmt.Sprintf("(id like '%[1]s' or external_id like '%[1]s' or display_name like '%[1]s')", clusterIdentifier)) | |||
} | |||
|
|||
// Finds the OCM COnfiguration file and returns the path to it |
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.
Very nitpicky - "COnfiguration"
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.
Fixed!
34d3e0d
to
d56ff79
Compare
/hold |
/lgtm |
d56ff79
to
a4edee4
Compare
/lgtm |
Signed-off-by: Chris Collins <collins.christopher@gmail.com>
a4edee4
to
eba7780
Compare
Fixed an issue with OCM URL loading from config; added support for refresh tokens. |
@clcollins: all tests passed! Full PR test history. Your PR dashboard. 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. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AlexVulaj, clcollins, mjlshen 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 |
/unhold Thanks folks! |
Default to ocm login via environment variables; fall back to `ocm login` config
osdctl
currently expects an OCM connection in order to run, but itcontains the packages necessary to build that connection automatically
based on the environment, as other OCM integrations do.
This commit adds support for automatically building the OCM connection
based on the presence of the
OCM_TOKEN
andOCM_URL
environmentvariables.
This will fall back to the existing connection usage if these environment
variables are not set. This will start to help us move toward a single OCM
interface, away from
ocm-cli
and more toward the SDK.NOTE: This incorporates the fix for #344, and allows
ocm login
to set the ocmfile and login info for use here, if not using the environment variables.
In addition, this will ease development, especially in the case that the target host
doesn't have OCM CLI installed (as a user of ocm-container, I don't need
OCM installed on my host itself), or in other containerized environments
(Fedora Toolbox).
This does not replace the necessity for backplane tunnels/logins - just
the OCM API login required before gathering data about a cluster.
Signed-off-by: Chris Collins collins.christopher@gmail.com