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

Enable creating a rancher client by directly passing a *Config #296

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

git-ival
Copy link
Contributor

@git-ival git-ival commented Sep 23, 2024

Issue: N/A

Problem

It is not currently possible to create a rancher Client without relying on Shepherd's configuration file load mechanism which generates Config structs as needed.

Solution

Small refactor to the rancher client's client.go which pulls out the majority of the client creation logic into a separate function and adds the NewClientForConfig function which takes a *Config directly.

Testing

Tested locally within the rancher/dartboard project, but have not run any existing tests elsewhere.

Regressions Considerations

There should be no regressions as the flow of the NewClient function has not been modified.

Backports:

Copy link
Member

@caliskanugur caliskanugur left a comment

Choose a reason for hiding this comment

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

Left a nit, looks good Iramis

Could you create a r/r PR with DNM for integration tests, and provide a few basic freeform runs offline?

We probably will need backports for this

clients/rancher/client.go Outdated Show resolved Hide resolved
@caliskanugur caliskanugur added the automation-enhancement To indicate this is related to enhancements in code related to automation label Oct 8, 2024
@git-ival git-ival removed the request for review from igomez06 October 9, 2024 16:16
@git-ival git-ival force-pushed the direct-rancher-config branch from 2fad0b6 to 44f4bec Compare October 9, 2024 17:30
@git-ival git-ival force-pushed the direct-rancher-config branch from 44f4bec to 908d108 Compare October 15, 2024 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation-enhancement To indicate this is related to enhancements in code related to automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants