Often either can be used. It really depends upon whether it is easier to write y as a function of x or x as a function of y and whether the axis of rotation is parallel to the x or y axis.
If you have y as a function of x, and the axis of rotation is parallel to the x-axis, then your "disk radius" will depend on y but you will be integrating with respect to x so you will, as you want, be integrating a function of x with respect to x. That would be using the disk method.
If you have y as a function of x, and the axis of rotation is parallel to the y-axis, trying to use the disk method, your "disk radius" will depend on x but you want to integrate with respect to y and x is NOT a function of y. That will cause difficulties. Use the shell method here.
If you have x as a function of y, reverse the two above. Of course, if you can easily write both y as a function of x and x as a function of y, it doesn't matter.
This makes much more sense for a specific problem than as a general rule!