@@ -17,6 +17,7 @@ import (
17
17
networktypedclient "github.com/openshift/origin/pkg/network/generated/internalclientset/typed/network/internalversion"
18
18
osclientcmd "github.com/openshift/origin/pkg/oc/cli/util/clientcmd"
19
19
"github.com/openshift/origin/pkg/util/netutils"
20
+ "github.com/openshift/origin/pkg/version"
20
21
)
21
22
22
23
const (
@@ -37,15 +38,23 @@ const (
37
38
NetworkDiagDefaultTestPodPort = 8080
38
39
)
39
40
40
- func GetNetworkDiagDefaultPodImage ( ) string {
41
+ func getImageFromTemplate ( name string ) string {
41
42
imageTemplate := variable .NewDefaultImageTemplate ()
42
- imageTemplate .Format = variable .DefaultImagePrefix + ":${version}"
43
- return imageTemplate .ExpandOrDie ("" )
43
+ imageTemplate .Format = variable .Expand (imageTemplate .Format , func (s string ) (string , bool ) {
44
+ if s == "version" {
45
+ return strings .TrimRight ("v" + version .Get ().Major + "." + version .Get ().Minor , "+" ), true
46
+ }
47
+ return "" , false
48
+ }, variable .Identity )
49
+ return imageTemplate .ExpandOrDie (name )
50
+ }
51
+
52
+ func GetNetworkDiagDefaultPodImage () string {
53
+ return getImageFromTemplate ("control-plane" )
44
54
}
45
55
46
56
func GetNetworkDiagDefaultTestPodImage () string {
47
- imageTemplate := variable .NewDefaultImageTemplate ()
48
- return imageTemplate .ExpandOrDie ("deployer" )
57
+ return getImageFromTemplate ("deployer" )
49
58
}
50
59
51
60
func GetOpenShiftNetworkPlugin (clusterNetworkClient networktypedclient.ClusterNetworksGetter ) (string , bool , error ) {
0 commit comments