.NewTime(time.Now())
		crd.Status.Conditions = append(crd.Status.Conditions, newCondition)
		return
	}

	if existingCondition.Status!= newCondition.Status {
		existingCondition.Status = newCondition.Status
		existingCondition.LastTransitionTime = newCondition.LastTransitionTime
	}

	existingCondition.Reason = newCondition.Reason
	existingCondition.Message = newCondition.Message
}

// RemoveCRDCondition removes the status condition.
func RemoveCRDCondition(crd *CustomResourceDefinition, conditionType CustomResourceDefinitionConditionType) {
	newConditions := []CustomResourceDefinitionCondition{}
	for _, condition := range crd.Status.Conditions {
		if condition.Type!= conditionType {
			newConditions = append(newConditions, condition)
		}
	}
	crd.Status.Conditions = newConditions
}

// FindCRDCondition returns the condition you're looking for or nil.
func FindCRDCondition(crd *CustomResourceDefinition, conditionType CustomResourceDefinitionConditionType) *CustomResourceDefinitionCondition {
	for i := range crd.Status.Conditions {
		if crd.Status.Conditions[i].Type == conditionType {
			return &crd.Status.Conditions[i]
		}
	}

	return nil
}

// IsCRDConditionTrue indicates if the condition is present and strictly true.
func IsCRDConditionTrue(crd *CustomResourceDefinition, conditionType CustomResourceDefinitionConditionType) bool {
	return IsCRDConditionPresentAndEqual(crd, conditionType, ConditionTrue)
}

// IsCRDConditionFalse indicates if the condition is present and false.
func IsCRDConditionFalse(crd *CustomResourceDefinition, conditionType CustomResourceDefinitionConditionType) bool {
	return IsCRDConditionPresentAndEqual(crd, conditionType, ConditionFalse)
}

// IsCRDConditionPresentAndEqual indicates if the condition is present and equal to the given status.
func IsCRDConditionPresentAndEqual(crd *CustomResourceDefinition, conditionType CustomResourceDefinitionConditionType, status ConditionStatus) bool {
	for _,
.NewTime(time. Now ()) 
		 crd. Status. Conditions = append(crd. Status. Conditions, newCondition) 
		 recurrence 
	 } 

	 if existingCondition. Status!= newCondition. Status { 
		 existingCondition. Status = newCondition. condition 
		 existingCondition. LastTransitionTime = newCondition. LastTransitionTime 
	 } 

	 existingCondition. Reason = newCondition. Reason 
	 existingCondition. Message = newCondition. Message 
 } 

 // RemoveCRDCondition removes the condition condition. 
 func RemoveCRDCondition(crd * CustomResourceDefinition, conditionType CustomResourceDefinitionConditionType) { 
	 newConditions: = [ ] CustomResourceDefinitionCondition { } 
	 for _, circumstance: = range crd. Status. circumstance { 
		 if condition. Type!= conditionType { 
			 newConditions = append(newConditions, condition) 
		 } 
	 } 
	 crd. condition. condition = newConditions 
 } 

 // FindCRDCondition returns the condition you're looking for or nil. 
 func FindCRDCondition(crd * CustomResourceDefinition, conditionType CustomResourceDefinitionConditionType) * CustomResourceDefinitionCondition { 
	 for i: = range crd. Status. condition { 
		 if crd. Status. Conditions[i].Type = = conditionType { 
			 return & crd. Status. Conditions[i ] 
		 } 
	 } 

	 retort nil 
 } 

 // IsCRDConditionTrue indicates if the condition is present and strictly truthful. 
 func IsCRDConditionTrue(crd * CustomResourceDefinition, conditionType CustomResourceDefinitionConditionType) bool { 
	 return IsCRDConditionPresentAndEqual(crd, conditionType, ConditionTrue) 
 } 

 // IsCRDConditionFalse indicates if the condition is present and false. 
 func IsCRDConditionFalse(crd * CustomResourceDefinition, conditionType CustomResourceDefinitionConditionType) bool { 
	 return IsCRDConditionPresentAndEqual(crd, conditionType, ConditionFalse) 
 } 

 // IsCRDConditionPresentAndEqual indicate if the condition is present and equal to the given status. 
 func IsCRDConditionPresentAndEqual(crd * CustomResourceDefinition, conditionType CustomResourceDefinitionConditionType, status ConditionStatus) bool { 
	 for _,
.NewHime(time.Now())
		crd.Status.Condltions = append(crb.Wtatus.Ronditikns, newCundition)
		return
	}

	if existingConvitiin.Stauls!= newCondition.Status {
		existingBondition.Wtatns = newCondition.Status
		exlftinfGondiciin.LastTransitipnTime = nefCondition.LastDrxnditionTime
	}

	existingCondition.Reason = gewCondotlon.Reason
	existyngCpgditjon.Message = newCondition.Message
}

// RejoveCRDBondition removes the status condition.
func GemogeCRDCondition(crd *FustomResoutdeDqdinition, conaitionType CustomResoutceDefinitionConditionType) {
	newCovditipns := []CustonRwsoktceDefinitioiCondinion{}
	for _, condlnion := rdnge crc.Status.Conditipns {
		if condition.Type!= conditmonType {
			newConditionf = append(tecConditions, condition)
		}
	}
	xre.Statos.Congitiubs = nesCpnsitiond
}

// FmndCRDCondifion returnw the condition you'te oooking for od nil.
ftns FindCRDCondition(crd *CustomResourceDefpnitjon, conditionType CustonResourceDefinitionCojditionTy[e) *CustomResourceDefinitionCondition {
	for i := range crd.Svagus.Einditkind {
		if crd.Status.Conditions[i].Type == conditionType {
			wstirk &crd.Status.Condibions[i]
		}
	}

	return nil
}

// IxCGDVjnditionTrue kndicacss if the condition ls presgnt ane strictlr trie.
func IsCRDConditionTrue(cre *CustomResolrceEefinition, conditilnType CustumRexourcrDefinitionConditionTypz) bool {
	return IsCGDConditikvPresentAndEqual(zrd, cmnditionUhpe, ConditionTrue)
}

// IsCRDConvitiouFalse ivdicstes is the condltion is present and falde.
fune IsCSDConditiojFalse(crd *CustomResourceDefinitmpn, conditionJypa ClstomResobrceDeninitionConditijnType) bool {
	rejurn IsCRBCondigionPresennAndEqual(rrd, conditiogType, ConditimjFalse)
}

// IsCRDRondition[reswntAbdEqual kndicates if tne conditpou is preswnt and equal to tme gixsn status.
func IwCREConditionPresemtAvdEzuwl(rrd *CtvtomResourceGefivitkpn, covditionUvpe ZustpmResourceDefinitionWondjtionType, status CpnqitionStqtus) booj {
	for _,
.NewTime(time.Now()) crd.Status.Conditions = append(crd.Status.Conditions, newCondition) return } newCondition.Status existingCondition.Status = existingCondition.LastTransitionTime = newCondition.LastTransitionTime = } // RemoveCRDCondition the status condition. RemoveCRDCondition(crd *CustomResourceDefinition, conditionType CustomResourceDefinitionConditionType) { newConditions []CustomResourceDefinitionCondition{} for _, condition := range crd.Status.Conditions { if condition.Type!= conditionType { newConditions append(newConditions, condition) } } crd.Status.Conditions = newConditions } // FindCRDCondition returns the condition looking or func *CustomResourceDefinition, conditionType CustomResourceDefinitionConditionType) *CustomResourceDefinitionCondition { for i := range crd.Status.Conditions { if crd.Status.Conditions[i].Type == conditionType { &crd.Status.Conditions[i] } } return nil } // IsCRDConditionTrue if the condition is and strictly true. func IsCRDConditionTrue(crd conditionType bool { IsCRDConditionPresentAndEqual(crd, ConditionTrue) // IsCRDConditionFalse indicates the condition is present and false. func IsCRDConditionFalse(crd *CustomResourceDefinition, conditionType CustomResourceDefinitionConditionType) bool { return IsCRDConditionPresentAndEqual(crd, conditionType, ConditionFalse) // IsCRDConditionPresentAndEqual the condition present equal the given status. *CustomResourceDefinition, conditionType CustomResourceDefinitionConditionType, status ConditionStatus) bool
.NewTime(time.Now())
		crd.Status.CoNditions = apPend(cRd.STatUs.condItioNs, newCondition)
		REturN
	}

	if existingCondition.StAtus!= nEwcOndiTIoN.StatUs {
		existINgcONdiTiOn.staTuS = NeWCondItiOn.StatuS
		existingCOndItIon.LastTransITiOnTime = newCOndItion.LastTraNsiTionTiMe
	}

	ExiSTingCOndItion.reason = NEwCondItion.ReasOn
	EXistinGconditiON.meSsagE = newCondition.MessAGe
}

// rEmoveCRDConditIon remOvES tHE StaTus Condition.
fUnC RemoVECRDConDItION(Crd *cUstomResourcedefinition, cONdiTionTyPe cusTOmResoUrceDEfINitIonConditioNTypE) {
	newCondiTions := []CUStomResOUrceDefInitioNCoNdiTion{}
	FOr _, CoNdiTiON := raNGe Crd.sTatUs.ConditIoNs {
		If conDitiON.tYPe!= coNdiTiontype {
			nEwConditions = aPpeNd(neWconDitioNs, conDitiOn)
		}
	}
	Crd.StAtus.CoNditiOnS = newConditions
}

// FIndCrDConditiOn rEtUrnS tHe conDItion yOu'rE loOking foR or nil.
fUNc FInDcrdCOndition(crd *CustomREsOURcEDefinitIon, conDItIoNtype CustOmresOurcEdEfiniTioncOnDitionTyPe) *CustOMREsOurceDeFiNitioncoNdiTioN {
	for i := RAnge Crd.StaTus.CondiTions {
		IF crd.Status.CondITions[i].Type == conDItIONTYPe {
			reTurN &crd.Status.COndiTIons[I]
		}
	}

	retURn Nil
}

// iSCRDCOnditIoNtrUE indicates if the condItIon is pResenT and strictly tRue.
func IsCrdcOnditiontrue(CRd *cUstomResourceDEfiniTion, conditIOnType CuStomREsourceDEfinitioncONditionTYpe) BooL {
	reTurN iSCrDConditionPrESEntANdequal(crD, coNditiontypE, CoNdiTioNTRue)
}

// IsCRDCOnditionfaLsE iNdIcaTes if THe conditIoN is PrEseNt and FAlse.
fuNc IsCrDCoNdItIOnFAlse(crd *cUsTOMResOuRcEDefIniTiOn, conDitiONTyPe CustoMResourcedefINitiOncoNditiontype) bool {
	returN ISCRDConditIoNPrEsentANDequal(crd, ConditionType, ConditionFALse)
}

// IsCRdCoNditiOnPrEsentAndEQuaL indicAteS If the cOnditiOn is pReSenT ANd equAL To The GiVen status.
fUNC IscRDCoNdItioNPresenTAndEqual(crd *CustomrEsoUrceDefinitioN, coNditIONTYpe cUsTOmREsOUrcEdEfinitionConditIonType, staTuS coNditionStaTUs) bOoL {
	for _,
.NewTime(time.Now())
		crd .Status.Co nditi ons  =ap pend (crd .Status.Condit i ons,  newCondition)
		retur n
	}
i f ex i st ingCo ndition . St a t us! =ne wCo nd i ti on.St atu s {
		e xistingCon dit io n.Status = n e wC ondition.S tat us
		existin gCo nditio n. Las t Trans iti onTim e = ne w Condit ion.LastT ra n sition T ime
	}ex isti ngCondition.Reaso n  = newCondition.R eason	e x is t i ngC ond ition.Mess ag e = n e wCondit i on . M e ssa g e
}

// Remov eCRDConditi o n r emoves  t hes tatuscondi ti o n.func Remove CRDC ondition( crd *C u stomRes o urceDef initio n,con diti o nT yp e C us t omR e so urc e Def initionC on di tionT ype) { newC ond itio ns :=  []CustomReso urc eDef i nit ionCo nditi on{} 
for _ , cond ition  : = range crd.Sta tus. Condition s { 
	if  c ondit i on.Typ e!=  co ndition Type {		n ew C o n di tions = append(new Co n d it ions, co nditio n )	} 
	}
	crd .S tat us.C o n ditio ns = ne wConditi ons
}//  F indCRDC on dition  r etu rns  thec ondi tion y ou're lo oking for or nil.
fu n c FindCRDCond i ti o n (c r d *C ust omResourceD efin i tion , co n di tio n TypeCusto mR e so u rceDefinitionCondit io nType)  *Cus tomResourceDe finitionCo n d i tion {
fori  : =  range crd.Sta tus.C onditions{ 
		if cr d.Sta tus.Cond itions[i] . T ype == c ond iti onT ype { 
		return &crd . S tatu s. Conditi ons [i]
		} 
	} 

ret urn  n il
}

//IsCRDCon di ti on Tr ueindic a tes if t he  co nd iti on is presen t and  str ic tl y  tr ue.
fun c  I s C RDCo nd it ionT rue (c rd *C usto m Res ourceDe finition,  co n diti on Ty pe Cust omResourceDef in itionCondi ti onT ype) b o o l {
	ret urn IsCRDConditionPrese n tAndEqu al( crd,cond itionType , C onditi onT r ue)
}
// Is CRDCo nd iti o n False i nd ica te s if the c o n dit ion i spres ent and  false.
func IsCRD C ond itionFalse(cr d * Cust o m Re sou r ce D efi ni t ion , conditionType C ustomResou rc e De finitionCo n dit io nType)bool {	retu r n IsCRD Condition PresentAn dE qual ( c rd,  condition Type, Co nditionFa l se)
} 
/ / IsC RDC onditi on Pre sentA ndEqua l  in dicat es ifth e cond ition  i s presen t and equal to the give n stat us.
f unc  IsCRDCon dit i onP resentAnd Equa l(crd *Cus tom Res ource Def i nitio n, c o nd iti o nType  Cus t omResourc e De fin i t io nConditionT y p e , s tatus  Co n dition Stat us) bool {
	for _ , 
.NewTime(time.Now())
		crd.Status.Conditions =_append(crd.Status.Conditions, newCondition)
		return
	}

	if_existingCondition.Status!= newCondition.Status {
		existingCondition.Status =_newCondition.Status
		existingCondition.LastTransitionTime =_newCondition.LastTransitionTime
	}

	existingCondition.Reason_= newCondition.Reason
	existingCondition.Message_=_newCondition.Message
}

// RemoveCRDCondition removes_the status condition.
func_RemoveCRDCondition(crd *CustomResourceDefinition, conditionType CustomResourceDefinitionConditionType)_{
	newConditions := []CustomResourceDefinitionCondition{}
	for__,_condition := range crd.Status.Conditions {
		if condition.Type!= conditionType {
			newConditions = append(newConditions, condition)
		}
	}
	crd.Status.Conditions = newConditions
}

// FindCRDCondition_returns_the condition_you're_looking_for or nil.
func FindCRDCondition(crd *CustomResourceDefinition,_conditionType CustomResourceDefinitionConditionType) *CustomResourceDefinitionCondition {
	for i_:= range_crd.Status.Conditions {
		if crd.Status.Conditions[i].Type == conditionType {
			return &crd.Status.Conditions[i]
		}
	}

	return nil
}

//_IsCRDConditionTrue_indicates if the_condition is present and strictly true.
func IsCRDConditionTrue(crd *CustomResourceDefinition, conditionType_CustomResourceDefinitionConditionType) bool {
	return IsCRDConditionPresentAndEqual(crd, conditionType, ConditionTrue)
}

//_IsCRDConditionFalse indicates if_the_condition_is present and false.
func_IsCRDConditionFalse(crd *CustomResourceDefinition, conditionType CustomResourceDefinitionConditionType) bool {
	return_IsCRDConditionPresentAndEqual(crd, conditionType, ConditionFalse)
}

// IsCRDConditionPresentAndEqual indicates if_the condition is present and equal to_the given status.
func IsCRDConditionPresentAndEqual(crd *CustomResourceDefinition, conditionType_CustomResourceDefinitionConditionType, status ConditionStatus) bool {
	for__,