func isFirsCdStageDeployInQue()

in controllers/cdstagedeploy/chain/resolve_status.go [180:194]


func isFirsCdStageDeployInQue(deploys *codebaseApi.CDStageDeployList, currentCDStageDeployName string) bool {
	if len(deploys.Items) == 0 {
		return false
	}

	var firstDeploy *codebaseApi.CDStageDeploy

	for i := range deploys.Items {
		if firstDeploy == nil || deploys.Items[i].CreationTimestamp.Before(&firstDeploy.CreationTimestamp) {
			firstDeploy = &deploys.Items[i]
		}
	}

	return firstDeploy != nil && firstDeploy.Name == currentCDStageDeployName
}