Skip to content

Commit

Permalink
Merge pull request #73 from cdk-team/fix-issue-71
Browse files Browse the repository at this point in the history
fix #71 (exp): k8s-shadow-apiserver check apiserver error in invalid to list pods
  • Loading branch information
neargle authored Jan 1, 2023
2 parents 5b28ff7 + 93fa615 commit b0ca845
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/exploit/k8s_shadow_apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func findApiServerPodInMasterNode(token string, serverAddr string) (string, erro
log.Printf("request apiserver uri `%s` error: %v, response: %s", opts.Api, err, resp)
return "", errors.New("faild to request api-server.")
}
if !strings.Contains(resp, "selfLink") {
if !strings.Contains(resp, "selfLink") && !strings.Contains(resp, "kube-apiserver") {
log.Println("api-server response:")
fmt.Println(resp)
return "", errors.New("invalid to list pods, possible caused by api-server forbidden this request.")
Expand Down

0 comments on commit b0ca845

Please sign in to comment.