mirror of
https://github.com/jenkinsci/kubernetes-operator.git
synced 2026-10-04 07:01:16 +02:00
Receive plugins' versions with underscores. (#699)
* Receive plugins versions with underscores. New jenkins plugin versions have underscores in them (example: https://plugins.jenkins.io/credentials/). The operator refuses configuration for such plug-ins as they do not match the existing regex. * Add tests to underscores in plugin versions Adds a new test to check that versions with underscores are valid. * Synchronise regexps character order to avoid range Make two related regexps more evidently similar to each other and re-order the symbols so that the - is not interpreted.
This commit is contained in:
@@ -36,6 +36,10 @@ func TestValidatePlugin(t *testing.T) {
|
||||
got := validatePlugin(validPluginName, "3.1.20180605-140134.c2e96c4", "")
|
||||
assert.NoError(t, got)
|
||||
})
|
||||
t.Run("version 1074.v60e6c29b_b_44b_", func(t *testing.T) {
|
||||
got := validatePlugin(validPluginName, "1074.v60e6c29b_b_44b_", "")
|
||||
assert.NoError(t, got)
|
||||
})
|
||||
t.Run("invalid version !", func(t *testing.T) {
|
||||
got := validatePlugin(validPluginName, "0.5.1!", "")
|
||||
assert.Error(t, got)
|
||||
|
||||
Reference in New Issue
Block a user