// PrepareForCreate receives a the incoming ServiceInstance and clears it's
// Status and Service[Class|Plan]Ref fields. These are not user settable fields.
// It also creates a UUID if the user hasn't specified one.
PrepareForCreate receives a the incoming ServiceInstance and clears it's
Status and Service[Class|Plan]Ref fields. These are not user settable fields.
It also creates a UUID if the user hasn't specified one.
// PrepareForCreate receives a the incoming ServiceInstance and clears it ' s // Status and Service [ Class|Plan ] Ref fields . These are not user settable fields . // It also creates a UUID if the user hasn ' t specified one .
func (instanceRESTStrategy) PrepareForCreate(ctx context.Context, obj runtime.Object) {
	instance, ok := obj.(*sc.ServiceInstance)
	if !ok {
		glog.Fatal("received a non-instance object to create")
	}
	if instance.Spec.ExternalID == "" {
		instance.Spec.ExternalID = string(uuid.NewUUID())
	}
	if utilfeature.DefaultFeatureGate.Enabled(scfeatures.OriginatingIdentity) {
		setServiceInstanceUserInfo(ctx, instance)
	}
	instance.Status = sc.ServiceInstanceStatus{
		Conditions:        []sc.ServiceInstanceCondition{},
		DeprovisionStatus: sc.ServiceInstanceDeprovisionStatusNotRequired,
	}
	instance.Spec.ClusterServiceClassRef = nil
	instance.Spec.ClusterServicePlanRef = nil
	instance.Finalizers = []string{sc.FinalizerServiceCatalog}
	instance.Generation = 1
}
func ( instanceRESTStrategy ) PrepareForCreate ( ctx context . Context , obj runtime . Object ) { instance , ok := obj . ( * sc . ServiceInstance ) if ! ok { glog . Fatal ( " " ) } if instance . Spec . ExternalID == " " { instance . Spec . ExternalID = string ( uuid . NewUUID ( ) ) } if utilfeature . DefaultFeatureGate . Enabled ( scfeatures . OriginatingIdentity ) { setServiceInstanceUserInfo ( ctx , instance ) } instance . Status = sc . ServiceInstanceStatus { Conditions : [ ] sc . ServiceInstanceCondition { } , DeprovisionStatus : sc . ServiceInstanceDeprovisionStatusNotRequired , } instance . Spec . ClusterServiceClassRef = nil instance . Spec . ClusterServicePlanRef = nil instance . Finalizers = [ ] string { sc . FinalizerServiceCatalog } instance . Generation = 1 }
PrepareForCreate receives a the incoming ServiceInstance and clears it's
Status and Service[Class|Plan]Ref fields.
PrepareForCreate receives a the incoming ServiceInstance and clears it ' s Status and Service [ Class|Plan ] Ref fields .
// Creating a brand new object, thus it must have no // status. We can't fail here if they passed a status in, so // we just wipe it clean. // Fill in the first entry set to "creating"?