All federal spending is discretionary. The Fed's have sovereign immunity. They can cut SS payments to the wealthy, slash defense spending, etc. They can implement all manner of cuts to avoid default.
They don't want cuts, so they will raise the limit