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

Replace wif models and client with sdk #643

Merged
merged 6 commits into from
Jul 31, 2024

Conversation

JakobGray
Copy link
Contributor

@JakobGray JakobGray commented Jul 19, 2024

This PR will

  • Update to the latest version of the ocm-sdk
  • Remove old WIF models and custom client code and replace them with the sdk
  • Update all reference to the old models in cmd/ocm/gcp with the official SDK models and client

It is not intended to introduce changes in functionality; however some changes were necessary to handle custom roles.

@JakobGray
Copy link
Contributor Author

@ckandag @renan-campos

@JakobGray JakobGray marked this pull request as ready for review July 29, 2024 14:24
Copy link
Collaborator

@renan-campos renan-campos left a comment

Choose a reason for hiding this comment

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

Please use audience and impersonator email from the sdk.

@JakobGray JakobGray requested a review from renan-campos July 30, 2024 16:04
@JakobGray
Copy link
Contributor Author

I found issues with the wif templates that need to be addressed before this is merged

@JakobGray JakobGray marked this pull request as draft July 30, 2024 16:05
if err != nil {
log.Fatalf("failed to create backend client: %v", err)
log.Fatal(err)
Copy link
Collaborator

@ckandag ckandag Jul 30, 2024

Choose a reason for hiding this comment

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

what does the end user see when this happens ? error stack ?

Copy link
Collaborator

@ckandag ckandag Jul 30, 2024

Choose a reason for hiding this comment

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

I thought we previously discussed bubbling up the errors to the caller and allow the top level "Run" function decide how to handle/display the error.

I dont see these kind of Fatal log msgs anywhere in the else in the ocm or rosa cli code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

An example error:

➜  go run ./cmd/ocm gcp delete wif-config 2crdacmjbo3jmdgfn4dq791a7nig04qg
2024/07/30 14:25:07 Not logged in, credentials aren't set, run the 'login' command
exit status 1

This is the top level Run function.

@ckandag
Copy link
Collaborator

ckandag commented Jul 30, 2024

@JakobGray : Across the board please fix error handling to be similar to be rest of ocm cli.
Please remove all the Fatal stmt and bubble errors up to caller. This allows for the error handling/ display to be addressed better and consistently across the CLI

@JakobGray
Copy link
Contributor Author

@JakobGray : Across the board please fix error handling to be similar to be rest of ocm cli. Please remove all the Fatal stmt and bubble errors up to caller. This allows for the error handling/ display to be addressed better and consistently across the CLI

Because this PR is not intended to introduce changes in functionality I don't want to extend it's scope to address all error handling. I believe we have a ticket already to address error handling more gracefully so I think that kind of change is better addressed there.

@ckandag
Copy link
Collaborator

ckandag commented Jul 30, 2024

@JakobGray : Across the board please fix error handling to be similar to be rest of ocm cli. Please remove all the Fatal stmt and bubble errors up to caller. This allows for the error handling/ display to be addressed better and consistently across the CLI

Because this PR is not intended to introduce changes in functionality I don't want to extend it's scope to address all error handling. I believe we have a ticket already to address error handling more gracefully so I think that kind of change is better addressed there.

@JakobGray I raised this in the original MR as well
#619 (comment)

Can we please sort this out now rather than later you are anyway touching all the same files
, may be you can do it in a separate commit .
I am not sure why we decided to let this go during the initial checkin, now seems like the time to get this right.

@JakobGray
Copy link
Contributor Author

The original MR addressed it by removing any panics and surfacing all errors to the top level function. This latest commit takes it a step further by removing all log.Fatal's from the top level function as well.

@JakobGray JakobGray marked this pull request as ready for review July 31, 2024 12:37
@JakobGray JakobGray requested a review from ckandag July 31, 2024 14:20
@renan-campos
Copy link
Collaborator

@renan-campos renan-campos merged commit 21ff6b8 into openshift-online:main Jul 31, 2024
4 of 5 checks passed
@JakobGray JakobGray deleted the OCM-9646 branch July 31, 2024 14:36
ckandag added a commit that referenced this pull request Aug 8, 2024
-416843e OSD-24332 Adding CNI Type to the printed output.
-ca71863 Introduce gcp WIF sub-commands to manage wif-configs (#619)
-5f9697b multi arch release images (#631)
-951d7cd Red Hat Konflux update ocm-cli (#633)
-2604647 Limit Konflux Pipeline Runs (#634)
-9645301 Update Konflux references (#635)
-c797dfb Update Konflux references to 0dc3087
-28b521d support hermetic build (#636)
-3117d6b Update Konflux references to 9eee3cf
-d228140 Update Konflux references to 71270c3
-0ff233b update konflux pipeline (#641)
-ae2093b Update Konflux references
-2ae4aa0 Update Konflux references
-bdd172b Update Konflux references to f93024e
-d750acc Red Hat Konflux update ocm-cli Signed-off-by: red-hat-konflux <[email protected]>
-0bbcf6e Update Konflux references
-21ff6b8 Replace wif models and client with sdk (#643)
-c3d52e2 Update Konflux build (#651)
-8073ef8 release_version (#652)
-e9a014d Update Konflux references
-78317e9 Add 'wif-config' flag as cluster create option
-49f4e41 Set project number on wif config creation
-e441c1b Update Konflux references
-ca8d9db Support listing and parameters in 'gcp get wif-config' (#656)
ckandag added a commit that referenced this pull request Aug 8, 2024
-416843e OSD-24332 Adding CNI Type to the printed output.
-ca71863 Introduce gcp WIF sub-commands to manage wif-configs (#619)
-5f9697b multi arch release images (#631)
-951d7cd Red Hat Konflux update ocm-cli (#633)
-2604647 Limit Konflux Pipeline Runs (#634)
-9645301 Update Konflux references (#635)
-c797dfb Update Konflux references to 0dc3087
-28b521d support hermetic build (#636)
-3117d6b Update Konflux references to 9eee3cf
-d228140 Update Konflux references to 71270c3
-0ff233b update konflux pipeline (#641)
-ae2093b Update Konflux references
-2ae4aa0 Update Konflux references
-bdd172b Update Konflux references to f93024e
-d750acc Red Hat Konflux update ocm-cli Signed-off-by: red-hat-konflux <[email protected]>
-0bbcf6e Update Konflux references
-21ff6b8 Replace wif models and client with sdk (#643)
-c3d52e2 Update Konflux build (#651)
-8073ef8 release_version (#652)
-e9a014d Update Konflux references
-78317e9 Add 'wif-config' flag as cluster create option
-49f4e41 Set project number on wif config creation
-e441c1b Update Konflux references
-ca8d9db Support listing and parameters in 'gcp get wif-config' (#656)
@ckandag ckandag mentioned this pull request Aug 8, 2024
renan-campos pushed a commit that referenced this pull request Aug 8, 2024
-416843e OSD-24332 Adding CNI Type to the printed output.
-ca71863 Introduce gcp WIF sub-commands to manage wif-configs (#619)
-5f9697b multi arch release images (#631)
-951d7cd Red Hat Konflux update ocm-cli (#633)
-2604647 Limit Konflux Pipeline Runs (#634)
-9645301 Update Konflux references (#635)
-c797dfb Update Konflux references to 0dc3087
-28b521d support hermetic build (#636)
-3117d6b Update Konflux references to 9eee3cf
-d228140 Update Konflux references to 71270c3
-0ff233b update konflux pipeline (#641)
-ae2093b Update Konflux references
-2ae4aa0 Update Konflux references
-bdd172b Update Konflux references to f93024e
-d750acc Red Hat Konflux update ocm-cli Signed-off-by: red-hat-konflux <[email protected]>
-0bbcf6e Update Konflux references
-21ff6b8 Replace wif models and client with sdk (#643)
-c3d52e2 Update Konflux build (#651)
-8073ef8 release_version (#652)
-e9a014d Update Konflux references
-78317e9 Add 'wif-config' flag as cluster create option
-49f4e41 Set project number on wif config creation
-e441c1b Update Konflux references
-ca8d9db Support listing and parameters in 'gcp get wif-config' (#656)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants