From 674423cef574af8126d4c570ce11fbbf553e6368 Mon Sep 17 00:00:00 2001 From: Chen Keinan Date: Tue, 9 Sep 2025 19:16:59 +0300 Subject: [PATCH 1/3] feat: add interface to internal client --- pkg/codefresh/codefresh.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/codefresh/codefresh.go b/pkg/codefresh/codefresh.go index 8277982..7802e7c 100644 --- a/pkg/codefresh/codefresh.go +++ b/pkg/codefresh/codefresh.go @@ -16,7 +16,11 @@ type ( AppProxy(ctx context.Context, runtime string, insecure bool) (ap.AppProxyAPI, error) GraphQL() gql.GraphQLAPI Rest() rest.RestAPI - InternalClient() *client.CfClient + InternalClient() HttpClient + } + + HttpClient interface { + NativeRestAPI(ctx context.Context, opt *client.RequestOptions) (*http.Response, error) } ClientOptions struct { @@ -63,6 +67,6 @@ func (c *codefresh) Rest() rest.RestAPI { return rest.NewRestClient(c.client) } -func (c *codefresh) InternalClient() *client.CfClient { +func (c *codefresh) InternalClient() HttpClient { return c.client } From 78be22b946040b564c3b1026049b023ee9978fd9 Mon Sep 17 00:00:00 2001 From: Chen Keinan Date: Tue, 9 Sep 2025 19:37:30 +0300 Subject: [PATCH 2/3] feat: add interface to internal client --- pkg/codefresh/codefresh.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/codefresh/codefresh.go b/pkg/codefresh/codefresh.go index 7802e7c..b6fdc4c 100644 --- a/pkg/codefresh/codefresh.go +++ b/pkg/codefresh/codefresh.go @@ -16,7 +16,8 @@ type ( AppProxy(ctx context.Context, runtime string, insecure bool) (ap.AppProxyAPI, error) GraphQL() gql.GraphQLAPI Rest() rest.RestAPI - InternalClient() HttpClient + InternalClient() *client.CfClient + HttpClient() HttpClient } HttpClient interface { @@ -67,6 +68,10 @@ func (c *codefresh) Rest() rest.RestAPI { return rest.NewRestClient(c.client) } -func (c *codefresh) InternalClient() HttpClient { +func (c *codefresh) InternalClient() *client.CfClient { + return c.client +} + +func (c *codefresh) HttpClient() HttpClient { return c.client } From e64843ceced75ab385f5d47afa83735a8e6fb61d Mon Sep 17 00:00:00 2001 From: Chen Keinan Date: Tue, 9 Sep 2025 19:40:34 +0300 Subject: [PATCH 3/3] feat: add interface to internal client --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 88e4dbe..8f27adb 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION=v1.4.11 +VERSION=v1.4.12 ifndef GOBIN ifndef GOPATH