Just so everyone has a better idea what is involved here in attacking the Panama Canal:
YouTube - Panama Canal Timelapse
Note that there are two sets of locks at each end. Destruction of just one set does not shut the canal down. Also note that the locks are not right on the coast but inland some distance. This means having to run past a number of coast defense batteries.
At the beginning of the video also note the bouys marking the navigation channel. Ships would be required to adhere to the rules of the road in moving along these channels and are also given a time (there is frequently a delay of hours to days waiting for passage through the canal where a ship was anchored out waiting its turn to go through the locks in a specific anchorage position).