Skip to content

Commit

Permalink
remove unneeded shutdown test
Browse files Browse the repository at this point in the history
  • Loading branch information
knisbet committed Aug 25, 2024
1 parent 7a4994c commit a9a0d73
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
2 changes: 0 additions & 2 deletions pkg/agent/plugin/workloadattestor/k8s/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,6 @@ func (p *Plugin) Attest(ctx context.Context, req *workloadattestorv1.AttestReque
case <-p.clock.After(config.PollRetryInterval):
case <-ctx.Done():
return nil, status.Errorf(codes.Canceled, "no selectors found: %v", ctx.Err())
case <-p.shutdownCtx.Done():
return nil, status.Error(codes.Unavailable, "plugin is unloading")
}
}
}
Expand Down
24 changes: 0 additions & 24 deletions pkg/agent/plugin/workloadattestor/k8s/k8s_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ type Suite struct {
clientCert *x509.Certificate

oc *osConfig

plugin *Plugin
}

func (s *Suite) SetupTest() {
Expand Down Expand Up @@ -668,27 +666,6 @@ func (s *Suite) TestConfigureWithSigstore() {
}
}

func (s *Suite) TestPluginUnload() {
s.startInsecureKubelet()
p := s.loadInsecurePluginWithExtra(`poll_retry_interval = "1h"`)

s.addPodListResponse(podListNotRunningFilePath)
s.addGetContainerResponsePidInPod()

resultCh := s.goAttest(p)
go func() {
s.plugin.Close()
}()

select {
case result := <-resultCh:
s.Require().Nil(result.selectors)
s.RequireGRPCStatusContains(result.err, codes.Unavailable, "plugin is unloading")
case <-time.After(time.Second):
s.FailNow("timed out waiting for plugin to unload")
}
}

func (s *Suite) newPlugin() *Plugin {
p := New()
p.rootDir = s.dir
Expand Down Expand Up @@ -734,7 +711,6 @@ func (s *Suite) kubeletPort() int {
func (s *Suite) loadPlugin(configuration string) workloadattestor.WorkloadAttestor {
v1 := new(workloadattestor.V1)
p := s.newPlugin()
s.plugin = p

plugintest.Load(s.T(), builtin(p), v1,
plugintest.Configure(configuration),
Expand Down

0 comments on commit a9a0d73

Please sign in to comment.