mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-10-31 10:18:13 +00:00 
			
		
		
		
	Impose length limit when concatenating revision history
This commit is contained in:
		| @@ -1274,13 +1274,19 @@ func TestAnnotationUtils(t *testing.T) { | ||||
|  | ||||
| 	//Test Case 1: Check if anotations are copied properly from deployment to RS | ||||
| 	t.Run("SetNewReplicaSetAnnotations", func(t *testing.T) { | ||||
| 		//Try to set the increment revision from 1 through 20 | ||||
| 		for i := 0; i < 20; i++ { | ||||
| 		//Try to set the increment revision from 11 through 20 | ||||
| 		for i := 10; i < 20; i++ { | ||||
|  | ||||
| 			nextRevision := fmt.Sprintf("%d", i+1) | ||||
| 			SetNewReplicaSetAnnotations(&tDeployment, &tRS, nextRevision, true) | ||||
| 			SetNewReplicaSetAnnotations(&tDeployment, &tRS, nextRevision, true, 5) | ||||
| 			//Now the ReplicaSets Revision Annotation should be i+1 | ||||
|  | ||||
| 			if i >= 12 { | ||||
| 				expectedHistoryAnnotation := fmt.Sprintf("%d,%d", i-1, i) | ||||
| 				if tRS.Annotations[RevisionHistoryAnnotation] != expectedHistoryAnnotation { | ||||
| 					t.Errorf("Revision History Expected=%s Obtained=%s", expectedHistoryAnnotation, tRS.Annotations[RevisionHistoryAnnotation]) | ||||
| 				} | ||||
| 			} | ||||
| 			if tRS.Annotations[RevisionAnnotation] != nextRevision { | ||||
| 				t.Errorf("Revision Expected=%s Obtained=%s", nextRevision, tRS.Annotations[RevisionAnnotation]) | ||||
| 			} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Ted Yu
					Ted Yu