Rework Plan CRD generation to add docs and kubectl explain support #369 
   Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.    
 
Ref: SURE-10336
With the current deployment defaults, upgrade jobs fail if not complete after 15 minutes, and are then cleaned up (deleted) 15 minutes later. The Plan does not trigger a recreate of the failed job, and the Plan must be modified in order for the Job to be retried. This is the expected behavior, as the default SUC deployment creates Jobs with activeDeadlineSeconds: 900 and ttlSecondsAfterFinished: 900.
Prior releases of the SUC (I tested with 0.13.4) had a bug where failed Jobs would be infinitely deleted and recreated, causing the Job to effectively ignore the configured deadline. There were no specific changes made to SUC that fixed this, but I suspect it was resolved by the bump from Wrangler v1 to v3, which contained many changes.
Apparently some users were relying on the unexpected behavior of Plans continuously recreating failed jobs, and their workflow was broken by this change in behavior (see https://xkcd.com/1172/). The correct fix is NOT for the SUC to continuously recreate failed jobs, but rather for the Plan's jobActiveDeadlineSecs to be set to an appropriately high value, or 0 for no deadline.
This change to align CRD building with rancher improves the docs by not only publishing the annotated CRD spec as markdown, but also makes
kubectl explainwork properly for Plan fields. Documentation for thejobActiveDeadlineSecsfield now covers expected behavior:Example of docs available via
kubectl explain: