-
Notifications
You must be signed in to change notification settings - Fork 100
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
Add recipe engine #8180
Add recipe engine #8180
Access has been restricted
You have triggered a rate limit.
Please wait a few minutes before you try again;
in some cases this may take up to an hour.
Conversation
limitations under the License. | ||
*/ | ||
|
||
package kubernetesclientprovider |
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.
Similar to previous changes, moving the functionality to access a Kubernetes client into a "provider". By deferring and standardizing the initialization that makes it easier to override in tests.
01e54b5
to
a425853
Compare
@@ -35,6 +35,8 @@ data: | |||
port: 6062 | |||
secretProvider: | |||
provider: kubernetes | |||
kubernetes: | |||
kind: default |
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.
This is only needed for dynamic-rp. UCP doesn't talk directly to Kubernetes, and applications-rp doesn't have the same expectations for testing.
a425853
to
c8296ae
Compare
@@ -92,6 +97,9 @@ func Start(t *testing.T, opts ...TestHostOption) (*TestHost, *ucptesthost.TestHo | |||
options, err := dynamicrp.NewOptions(context.Background(), config) | |||
require.NoError(t, err) | |||
|
|||
// Prevent the default recipe drivers from being registered. | |||
options.Recipes.Drivers = map[string]func(options *dynamicrp.Options) (driver.Driver, error){} | |||
|
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.
Now we can load/use/mock the recipe engine in tests.
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.
This will be used in the next PR, where we're actually going to test a resource that uses recipes.
} | ||
|
||
// WithLegacy implements discovery.DiscoveryInterface. | ||
func (d *DiscoveryClient) WithLegacy() discovery.DiscoveryInterface { |
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.
These functions were missing from our mock. The discovery package defines a ton of different interfaces. I changed from a really scenario-specific one to a more general one.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8180 +/- ##
==========================================
- Coverage 60.16% 59.99% -0.17%
==========================================
Files 587 588 +1
Lines 38943 39116 +173
==========================================
+ Hits 23429 23469 +40
- Misses 13785 13910 +125
- Partials 1729 1737 +8 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Ryan Nowak <nowakra@gmail.com>
c8296ae
to
4306c51
Compare
Radius functional test overview
Click here to see the list of tools in the current test run
Test Status⌛ Building Radius and pushing container images for functional tests... |
Going to merge when the CI completes. Will resolve any additional feedback in a follow-up. |
Description
This change adds the recipe engine to the dynamic-rp. There's no usage of the recipe engine yet in this PR, it's a prerequisite for what's coming next.
The main problem being solved is improving the initialization code so that it can be used in our integration tests.
Type of change
Part of: #6688
Contributor checklist
Please verify that the PR meets the following requirements, where applicable: