refactor: Replaced context.TODO() with request.Context() in API files (#2214)
This commit is contained in:
@@ -17,7 +17,6 @@ limitations under the License.
|
||||
package controller
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
@@ -33,7 +32,7 @@ func (a *API) SecretExists(w http.ResponseWriter, r *http.Request) {
|
||||
ns = metav1.NamespaceDefault
|
||||
}
|
||||
|
||||
_, err := a.kubernetesClient.CoreV1().Secrets(ns).Get(context.TODO(), name, metav1.GetOptions{})
|
||||
_, err := a.kubernetesClient.CoreV1().Secrets(ns).Get(r.Context(), name, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
a.logger.Error("error getting secret",
|
||||
zap.Error(err),
|
||||
|
||||
Reference in New Issue
Block a user