I am a South African travelling to Canada with 2 passports. Passport one is expiring 2 days after I leave Canada and has a valid visa in it. Passport 2 is a new passport. is this okay
Canada does not have a rule requiring that a passport be valid for any specific length of time, just valid for your stay. So passport one would in fact be sufficient.
However in most cases a passport is invalidated when a new one is issued to the same person by the same country. If this is the case with yours then you will need to have both passport 2 present (for validity) and passport 1 (for the visa).
This assumes that you mean both passports are South African.