Your logic is correct.
By default, melee attacks, including unarmed strikes, tend to have a reach of 5 feet:
Most creatures have a 5-foot reach and can thus attack targets within 5 feet of them when making a melee attack. Certain creatures (typically those larger than Medium) have melee attacks with a greater reach than 5 feet, as noted in their descriptions.
Instead of using a weapon to make a melee weapon attack, you can use an unarmed strike: a punch, kick, head-butt, or similar forceful blow (none of which count as weapons). On a hit, an unarmed strike deals bludgeoning damage equal to 1 + your Strength modifier. You are proficient with your unarmed strikes.
A creature provokes an opportunity attack when it moves out of your melee attack's reach:
You can make an opportunity attack when a hostile creature that you can see moves out of your reach. To make the opportunity attack, you use your reaction to make one melee attack against the provoking creature. The attack occurs right before the creature leaves your reach.
The War Caster feat (PHB, p. 170) says, in part:
When a hostile creature's movement provokes an opportunity attack from you, you can use your reaction to cast a spell at the creature, rather than making an opportunity attack. The spell must have a casting time of 1 action and must target only that creature.
While you may provoke opportunity attacks with your whip only at 10 feet, you can always make unarmed strikes. This is normally a subpar option for almost anyone except monks. However, the War Caster feat lets you cast a spell instead, which can definitely be useful.
Note that ranged spell attacks, such as eldritch blast, will still be at disadvantage if the opportunity attack it's replacing is provoked when a creature moves from 5 feet away to further away, as the attack is still made just before the creature leaves your reach. Thus, you probably want to cast a melee spell attack or a spell that has no attack roll.
Also, the intent is that War Caster can't replace an opportunity attack made with a weapon with the "reach" property, such as the whip.
As Miniman's answer to the linked question points out, the "reach" weapon property defines your reach for opportunity attacks made with the weapon.
In addition, rules designer Jeremy Crawford unofficially confirmed this interpretation on Twitter in 2015:
The intent is that any OA triggered because you're wielding a polearm is then made with that polearm.
And again in 2016:
The War Caster feat relies on your normal reach for the opportunity attack.
This indicates that the design intent, and arguably the rule as written, is that War Caster lets you replace regular opportunity attacks with a spell targeting the creature, not opportunity attacks with reach weapons.