mirror of https://github.com/portainer/portainer
fix(app/update_schedule): create schedule performance issues at scale (#1002)
parent
3ee20863d6
commit
5f6fa4d79f
|
@ -36,7 +36,13 @@ func HasDirectConnectivity(endpoint *portainer.Endpoint) bool {
|
||||||
// IsNewerThan225 returns true if the agent version is newer than 2.25.0
|
// IsNewerThan225 returns true if the agent version is newer than 2.25.0
|
||||||
// this is used to check if the agent is compatible with the new diagnostics feature
|
// this is used to check if the agent is compatible with the new diagnostics feature
|
||||||
func IsNewerThan225(agentVersion string) bool {
|
func IsNewerThan225(agentVersion string) bool {
|
||||||
v1, _ := version.NewVersion(agentVersion)
|
v1, err := version.NewVersion(agentVersion)
|
||||||
v2, _ := version.NewVersion("2.25.0")
|
if err != nil || v1 == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
v2, err := version.NewVersion("2.25.0")
|
||||||
|
if err != nil || v2 == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
return v1.GreaterThanOrEqual(v2)
|
return v1.GreaterThanOrEqual(v2)
|
||||||
}
|
}
|
||||||
|
|
|
@ -251,6 +251,11 @@ func TestIsNewerThan225(t *testing.T) {
|
||||||
version: "2.24.0",
|
version: "2.24.0",
|
||||||
expected: false,
|
expected: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "Not a version",
|
||||||
|
version: "NotAVersion",
|
||||||
|
expected: false,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
|
|
Loading…
Reference in New Issue