Skip to content

Commit

Permalink
remove GetProxyPluginConfig method from infomer
Browse files Browse the repository at this point in the history
  • Loading branch information
MatousJobanek committed Oct 4, 2024
1 parent 6e62189 commit 9f41832
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 29 deletions.
1 change: 0 additions & 1 deletion pkg/application/service/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ type InformerService interface {
GetMasterUserRecord(name string) (*toolchainv1alpha1.MasterUserRecord, error)
GetSpace(name string) (*toolchainv1alpha1.Space, error)
ListSpaceBindings(reqs ...labels.Requirement) ([]toolchainv1alpha1.SpaceBinding, error)
GetProxyPluginConfig(name string) (*toolchainv1alpha1.ProxyPlugin, error)
GetNSTemplateTier(name string) (*toolchainv1alpha1.NSTemplateTier, error)
ListBannedUsersByEmail(email string) ([]toolchainv1alpha1.BannedUser, error)
}
Expand Down
7 changes: 0 additions & 7 deletions pkg/informers/service/informer_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ func NewInformerService(client client.Client, namespace string) service.Informer
return si
}

func (s *ServiceImpl) GetProxyPluginConfig(name string) (*toolchainv1alpha1.ProxyPlugin, error) {
pluginConfig := &toolchainv1alpha1.ProxyPlugin{}
namespacedName := types.NamespacedName{Name: name, Namespace: s.namespace}
err := s.client.Get(context.TODO(), namespacedName, pluginConfig)
return pluginConfig, err
}

func (s *ServiceImpl) GetMasterUserRecord(name string) (*toolchainv1alpha1.MasterUserRecord, error) {
mur := &toolchainv1alpha1.MasterUserRecord{}
namespacedName := types.NamespacedName{Name: name, Namespace: s.namespace}
Expand Down
21 changes: 0 additions & 21 deletions pkg/informers/service/informer_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,27 +136,6 @@ func TestInformerService(t *testing.T) {
})
})

t.Run("proxy configs", func(t *testing.T) {
t.Run("not found", func(t *testing.T) {
// when
val, err := svc.GetProxyPluginConfig("unknown")

// then
assert.Empty(t, val)
assert.EqualError(t, err, "proxyplugins.toolchain.dev.openshift.com \"unknown\" not found")
})

t.Run("found", func(t *testing.T) {
// when
val, err := svc.GetProxyPluginConfig("tekton-results")

// then
require.NotNil(t, val)
require.NoError(t, err)
assert.Equal(t, pluginTekton.Spec, val.Spec)
})
})

t.Run("bannedusers", func(t *testing.T) {
t.Run("not found", func(t *testing.T) {
// when
Expand Down

0 comments on commit 9f41832

Please sign in to comment.