  A graph $G$ is called $H$-free, if it does not contain $H$ as a subgraph. In
2010, Nikiforov proposed a Brualdi-Solheid-Tur\'{a}n type problem: what is the
maximum spectral radius of an $H$-free graph of order $n$? In this paper, we
consider the Brualdi-Solheid-Tur\'{a}n type problem for non-bipartite graphs.
Let $K_{a, b}\bullet K_3$ denote the graph obtained by identifying a vertex of
$K_{a,b}$ in the part of size $b$ and a vertex of $K_3$. We prove that if $G$
is a non-bipartite graph of order $n$ satisfying $\rho(G)\geq
\rho(K_{\lceil\frac{n-2}{2}\rceil, \lfloor\frac{n-2}{2}\rfloor}\bullet K_3)$,
then $G$ contains all odd cycles $C_{2l+1}$ for each integer $l\in[2,k]$ unless
$G\cong K_{\lceil\frac{n-2}{2}\rceil, \lfloor\frac{n-2}{2}\rfloor}\bullet K_3$,
provided that $n$ is sufficiently large with respect to $k$. This resolves the
problem posed by Guo, Lin and Zhao (2021).
