github.com/kubeshop/testkube@v1.17.23/pkg/tcl/mappertcl/testsuiteexecutions/mapper.go (about)

     1  // Copyright 2024 Testkube.
     2  //
     3  // Licensed as a Testkube Pro file under the Testkube Community
     4  // License (the "License"); you may not use this file except in compliance with
     5  // the License. You may obtain a copy of the License at
     6  //
     7  //     https://github.com/kubeshop/testkube/blob/main/licenses/TCL.txt
     8  
     9  package testsuiteexecutions
    10  
    11  import (
    12  	testsuiteexecutionv1 "github.com/kubeshop/testkube-operator/api/testsuiteexecution/v1"
    13  	"github.com/kubeshop/testkube/pkg/api/v1/testkube"
    14  )
    15  
    16  // MapExecutionCRD maps OpenAPI spec Execution to CRD
    17  func MapExecutionCRD(sourceRequest *testkube.Execution,
    18  	destinationRequest *testsuiteexecutionv1.Execution) *testsuiteexecutionv1.Execution {
    19  	if sourceRequest == nil || destinationRequest == nil {
    20  		return destinationRequest
    21  	}
    22  
    23  	destinationRequest.ExecutionNamespace = sourceRequest.ExecutionNamespace
    24  	return destinationRequest
    25  }