Skip to content

Commit

Permalink
Merge pull request #1724 from siliconbrain/patch-1
Browse files Browse the repository at this point in the history
馃悰 avoid panic in envtest by checking before dereferencing
  • Loading branch information
k8s-ci-robot committed Nov 29, 2021
2 parents 067c1dc + 74e68b5 commit 8f43f26
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/internal/testing/controlplane/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,10 @@ func (s *APIServer) populateAPIServerCerts() error {
// Stop stops this process gracefully, waits for its termination, and cleans up
// the CertDir if necessary.
func (s *APIServer) Stop() error {
if s.processState.DirNeedsCleaning {
s.CertDir = "" // reset the directory if it was randomly allocated, so that we can safely restart
}
if s.processState != nil {
if s.processState.DirNeedsCleaning {
s.CertDir = "" // reset the directory if it was randomly allocated, so that we can safely restart
}
if err := s.processState.Stop(); err != nil {
return err
}
Expand Down

0 comments on commit 8f43f26

Please sign in to comment.