@@ -121,7 +121,8 @@ func readBenchmark(ctx context.Context, c client, phase string) (object, benchma
121121 return nil , record , errors .New ("benchmark journal is malformed" )
122122 }
123123 var extra any
124- if d .Decode (& extra ) != io .EOF || ! benchmarkNamespaceMatches (record ) || record .Phase != phase || record .Image != fioImage || record .Workload != benchmarkWorkload () ||
124+ if d .Decode (& extra ) != io .EOF || ! benchmarkNamespaceMatches (record ) || record .Phase != phase ||
125+ (record .Image != fioImage && record .Image != legacyFioImage ) || record .Workload != benchmarkWorkload () ||
125126 ! validBenchmarkOwner (record .Run , record .Source ) || len (record .Machines ) != 3 ||
126127 (record .clientNode () != benchmarkClientNode && record .clientNode () != legacyBenchmarkClientNode ) {
127128 return nil , record , errors .New ("benchmark journal does not match this reviewed procedure" )
@@ -167,8 +168,8 @@ func readBenchmark(ctx context.Context, c client, phase string) (object, benchma
167168
168169func requireBenchmarkBaseline (ctx context.Context , c client , current []object ) error {
169170 _ , record , err := readBenchmark (ctx , c , "v1" )
170- if err != nil || ! record .Cleaned || len (record .Measurements ) != 18 || record .CompletedAt == "" {
171- return errors .New ("the completed, cleaned V1 baseline is required before moving any replicas" )
171+ if err != nil || record . Image != fioImage || ! record .Cleaned || len (record .Measurements ) != 18 || record .CompletedAt == "" {
172+ return errors .New ("the completed, cleaned V1 baseline with the pinned benchmark image is required before moving any replicas" )
172173 }
173174 if _ , err = time .Parse (time .RFC3339 , record .CompletedAt ); err != nil {
174175 return errors .New ("baseline completion time is invalid" )
@@ -294,16 +295,16 @@ func (c client) setBenchmarkTag(ctx context.Context, source, tag, name, expected
294295 return err
295296}
296297
297- func verifyBenchmarkPod (p object , uid , clientNode string ) error {
298+ func verifyBenchmarkPod (p object , uid , clientNode , image string ) error {
298299 containers , _ := value (p , "spec" , "containers" ).([]any )
299300 statuses , _ := value (p , "status" , "containerStatuses" ).([]any )
300301 if text (p , "metadata" , "uid" ) != uid || text (p , "spec" , "nodeName" ) != clientNode || len (containers ) != 1 || len (statuses ) != 1 {
301302 return errors .New ("benchmark consumer identity or placement differs" )
302303 }
303304 container , _ := containers [0 ].(object )
304305 status , _ := statuses [0 ].(object )
305- digest := strings .Split ( fioImage , "@" )[ 1 ]
306- if text (container , "image" ) != fioImage || ! reflect .DeepEqual (value (container , "args" ), []any {fioScript }) ||
306+ _ , digest , pinned := strings .Cut ( image , "@" )
307+ if ! pinned || digest == "" || text (container , "image" ) != image || ! reflect .DeepEqual (value (container , "args" ), []any {fioScript }) ||
307308 ! reflect .DeepEqual (value (container , "command" ), []any {"/bin/sh" , "-ec" }) || value (p , "spec" , "automountServiceAccountToken" ) != false ||
308309 value (p , "spec" , "hostUsers" ) != false ||
309310 text (status , "name" ) != "fio" || ! strings .HasSuffix (text (status , "imageID" ), digest ) {
@@ -330,6 +331,9 @@ func runBenchmark(ctx context.Context, c client, source, runID, phase string) er
330331 if err != nil || ! baseline .Cleaned {
331332 return errors .New ("the baseline's benchmark client is unverified" )
332333 }
334+ if baseline .Image != fioImage {
335+ return errors .New ("both data engines must be measured with the same pinned benchmark image" )
336+ }
333337 clientNode = baseline .clientNode ()
334338 }
335339 var v1Runtime * benchmarkV1Runtime
@@ -402,7 +406,7 @@ func runBenchmark(ctx context.Context, c client, source, runID, phase string) er
402406 if err != nil || text (current , "status" , "phase" ) != "Running" {
403407 return errors .New ("benchmark consumer is not running" )
404408 }
405- if err = verifyBenchmarkPod (current , text (pod , "metadata" , "uid" ), clientNode ); err != nil {
409+ if err = verifyBenchmarkPod (current , text (pod , "metadata" , "uid" ), clientNode , record . Image ); err != nil {
406410 return err
407411 }
408412 claim , err = c .get (ctx , "persistentvolumeclaim" , record .Namespace , "fio-data" , false )
@@ -432,7 +436,7 @@ func runBenchmark(ctx context.Context, c client, source, runID, phase string) er
432436 if err != nil {
433437 return err
434438 }
435- if err = verifyBenchmarkPod (pod , text (created ["Pod" ], "metadata" , "uid" ), clientNode ); err != nil {
439+ if err = verifyBenchmarkPod (pod , text (created ["Pod" ], "metadata" , "uid" ), clientNode , record . Image ); err != nil {
436440 return err
437441 }
438442 record .CPU , err = captureBenchmarkCPU (ctx , c , phase , pod )
@@ -461,7 +465,7 @@ func runBenchmark(ctx context.Context, c client, source, runID, phase string) er
461465 if err != nil {
462466 return err
463467 }
464- if err = verifyBenchmarkPod (current , text (pod , "metadata" , "uid" ), clientNode ); err != nil {
468+ if err = verifyBenchmarkPod (current , text (pod , "metadata" , "uid" ), clientNode , record . Image ); err != nil {
465469 return err
466470 }
467471 if _ , err = c .kubectl (ctx , nil , "exec" , "--namespace=" + record .Namespace , "fio" , "--container=fio" , "--" , "/bin/sh" , "-ec" , "touch /tmp/benchmark-start" ); err != nil {
@@ -474,7 +478,7 @@ func runBenchmark(ctx context.Context, c client, source, runID, phase string) er
474478 if err != nil {
475479 return err
476480 }
477- if err = verifyBenchmarkPod (p , text (pod , "metadata" , "uid" ), clientNode ); err != nil {
481+ if err = verifyBenchmarkPod (p , text (pod , "metadata" , "uid" ), clientNode , record . Image ); err != nil {
478482 return err
479483 }
480484 switch text (p , "status" , "phase" ) {
@@ -525,7 +529,7 @@ func runBenchmark(ctx context.Context, c client, source, runID, phase string) er
525529 if err != nil {
526530 return err
527531 }
528- if err = verifyBenchmarkPod (current , text (pod , "metadata" , "uid" ), clientNode ); err != nil {
532+ if err = verifyBenchmarkPod (current , text (pod , "metadata" , "uid" ), clientNode , record . Image ); err != nil {
529533 return err
530534 }
531535 endingCPU , err := captureBenchmarkCPU (ctx , c , phase , current )
0 commit comments