1.replace autoscalingapi.CrossVersionObjectReference because we don't want to introduce autoscaling in analysis
2.rename Type to AnalysisType since this field is used by both Analytics and Recommendation
3.add struct CompletionStrategy to indicate how to complete an Analytics or Recommendation
4.add type AdoptionStrategy to indicate how to adopt a recommendation to target
5.add related time status
6. use LastSuccessfulTime refering to k8s Job api
User create a Analytics with CompletionStrategy once
, crane will auto-gen related Recommendation with CompletionStrategy once
Question 1: How to know the recommendation is done ?
if LastSuccessfulTime + period > now || LastSuccessfulTime == nil
then
doRecommend
else
Question 2: What if user change CompletionStrategy for Analytics ?
if Analytics's CompletionStrategy is changed, it will trigger updating for recommendation and do reconcile.
Question 3: If we have a Periodical Analytics, how to trigger a Analytics or a Recommendation right now?
It's simple, just create another object with Once CompletionStrategy.