File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import (
1313 "net/http/cookiejar"
1414 "net/url"
1515 "os"
16+ "regexp"
1617 "strings"
1718 "time"
1819
@@ -167,6 +168,19 @@ func (keycloakClient *KeycloakClient) login(ctx context.Context) error {
167168 serverVersion := info .SystemInfo .ServerVersion
168169 if strings .Contains (serverVersion , ".GA" ) {
169170 serverVersion = strings .ReplaceAll (info .SystemInfo .ServerVersion , ".GA" , "" )
171+ } else {
172+ regex , err := regexp .Compile (`\.redhat-\w+` )
173+
174+ if err != nil {
175+ fmt .Println ("Error compiling regex:" , err )
176+ return err
177+ }
178+
179+ // Check if the pattern is found in serverVersion
180+ if regex .MatchString (serverVersion ) {
181+ // Replace the matched pattern with an empty string
182+ serverVersion = regex .ReplaceAllString (serverVersion , "" )
183+ }
170184 }
171185
172186 v , err := version .NewVersion (serverVersion )
You can’t perform that action at this time.
0 commit comments