Skip to content

Commit

Permalink
[ENHANCEMENT] Removed the unused client
Browse files Browse the repository at this point in the history
Signed-off-by: Akshay Iyyadurai Balasundaram <akshay.iyyadurai.balasundaram@sap.com>
  • Loading branch information
ibakshay committed Nov 27, 2024
1 parent 3849b48 commit 9847bb1
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions internal/perses/common/perses_client_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (f *PersesClientFactoryWithConfig) CreateClient(perses persesv1alpha1.Perse
}

restClient, err := clientConfig.NewRESTClient(clientConfig.RestConfigClient{
URL: parsedURL,
URL: &common.URL{URL: parsedURL.URL},
})
if err != nil {
return nil, err
Expand All @@ -45,33 +45,6 @@ func (f *PersesClientFactoryWithConfig) CreateClient(perses persesv1alpha1.Perse
return persesClient, nil
}

type PersesClientFactoryWithURL struct {
url string
}

func NewWithURL(url string) PersesClientFactory {
return &PersesClientFactoryWithURL{url: url}
}

func (f *PersesClientFactoryWithURL) CreateClient(config persesv1alpha1.Perses) (v1.ClientInterface, error) {
urStr := f.url
parsedURL, err := common.ParseURL(urStr)
if err != nil {
return nil, err
}
restClient, err := clientConfig.NewRESTClient(clientConfig.RestConfigClient{
URL: parsedURL,
})

if err != nil {
return nil, err
}

persesClient := v1.NewWithClient(restClient)

return persesClient, nil
}

type PersesClientFactoryWithClient struct {
client v1.ClientInterface
}
Expand Down

0 comments on commit 9847bb1

Please sign in to comment.