You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2022/12/07 09:53:27 UTC
[camel-k] 01/02: fix(e2e): use generated API methods
This is an automated email from the ASF dual-hosted git repository.
pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit b16222257cbf41d166408b83e0c28fae3ea71eba
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Fri Dec 2 14:51:54 2022 +0100
fix(e2e): use generated API methods
Closes #3818
---
e2e/global/common/scale_integration_test.go | 2 +-
.../versioned/typed/camel/v1/fake/fake_integration.go | 10 ----------
.../clientset/versioned/typed/camel/v1/integration.go | 16 ----------------
3 files changed, 1 insertion(+), 27 deletions(-)
diff --git a/e2e/global/common/scale_integration_test.go b/e2e/global/common/scale_integration_test.go
index 504e374d8..dd5c65e59 100644
--- a/e2e/global/common/scale_integration_test.go
+++ b/e2e/global/common/scale_integration_test.go
@@ -103,7 +103,7 @@ func TestIntegrationScale(t *testing.T) {
}}
payloadBytes, _ := json.Marshal(payload)
- integrationScale, err = camel.CamelV1().Integrations(ns).PatchScale(TestContext, name, types.JSONPatchType, payloadBytes, metav1.PatchOptions{})
+ _, err = camel.CamelV1().Integrations(ns).Patch(TestContext, name, types.JSONPatchType, payloadBytes, metav1.PatchOptions{}, "scale")
Expect(err).To(BeNil())
// Check the readiness condition is still truthy as down-scaling
diff --git a/pkg/client/camel/clientset/versioned/typed/camel/v1/fake/fake_integration.go b/pkg/client/camel/clientset/versioned/typed/camel/v1/fake/fake_integration.go
index 5efa7b05a..0c729b36c 100644
--- a/pkg/client/camel/clientset/versioned/typed/camel/v1/fake/fake_integration.go
+++ b/pkg/client/camel/clientset/versioned/typed/camel/v1/fake/fake_integration.go
@@ -164,13 +164,3 @@ func (c *FakeIntegrations) UpdateScale(ctx context.Context, integrationName stri
}
return obj.(*autoscalingv1.Scale), err
}
-
-func (c *FakeIntegrations) PatchScale(ctx context.Context, integrationName string, pt types.PatchType, data []byte, opts v1.PatchOptions) (result *autoscalingv1.Scale, err error) {
- obj, err := c.Fake.
- Invokes(testing.NewPatchSubresourceAction(integrationsResource, c.ns, integrationName, pt, data, "scale"), &autoscalingv1.Scale{})
-
- if obj == nil {
- return nil, err
- }
- return obj.(*autoscalingv1.Scale), err
-}
diff --git a/pkg/client/camel/clientset/versioned/typed/camel/v1/integration.go b/pkg/client/camel/clientset/versioned/typed/camel/v1/integration.go
index 52696b2c8..47b7d98a1 100644
--- a/pkg/client/camel/clientset/versioned/typed/camel/v1/integration.go
+++ b/pkg/client/camel/clientset/versioned/typed/camel/v1/integration.go
@@ -51,7 +51,6 @@ type IntegrationInterface interface {
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Integration, err error)
GetScale(ctx context.Context, integrationName string, options metav1.GetOptions) (*autoscalingv1.Scale, error)
UpdateScale(ctx context.Context, integrationName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error)
- PatchScale(ctx context.Context, integrationName string, pt types.PatchType, data []byte, opts metav1.PatchOptions) (result *autoscalingv1.Scale, err error)
IntegrationExpansion
}
@@ -228,18 +227,3 @@ func (c *integrations) UpdateScale(ctx context.Context, integrationName string,
Into(result)
return
}
-
-// PatchScale takes the top resource name and the representation of a scale and patches it. Returns the server's representation of the scale, and an error, if there is any.
-func (c *integrations) PatchScale(ctx context.Context, integrationName string, pt types.PatchType, data []byte, opts metav1.PatchOptions) (result *autoscalingv1.Scale, err error) {
- result = &autoscalingv1.Scale{}
- err = c.client.Patch(pt).
- Namespace(c.ns).
- Resource("integrations").
- Name(integrationName).
- SubResource("scale").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}