package kubernetes import ( "net/http" httperror "github.com/portainer/portainer/pkg/libhttp/error" "github.com/portainer/portainer/pkg/libhttp/request" "github.com/portainer/portainer/pkg/libhttp/response" ) func (handler *Handler) getKubernetesConfigMapsAndSecrets(w http.ResponseWriter, r *http.Request) *httperror.HandlerError { namespace, err := request.RetrieveRouteVariableValue(r, "namespace") if err != nil { return httperror.BadRequest("Invalid namespace identifier route variable", err) } cli, handlerErr := handler.getProxyKubeClient(r) if handlerErr != nil { return handlerErr } configmaps, err := cli.GetConfigMapsAndSecrets(namespace) if err != nil { return httperror.InternalServerError("Unable to retrieve configmaps and secrets", err) } return response.JSON(w, configmaps) }