From bfbecb8073a2916969cf9190ebb249fc14476d12 Mon Sep 17 00:00:00 2001 From: reubenninan Date: Fri, 26 Jul 2024 17:17:24 +0000 Subject: [PATCH 1/2] Fix whitespace check to look for newlines as well Signed-off-by: reubenninan --- internal/audit/cluster_checks.go | 4 ++-- internal/audit/server_checks.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/audit/cluster_checks.go b/internal/audit/cluster_checks.go index c53211c7..9deb1471 100644 --- a/internal/audit/cluster_checks.go +++ b/internal/audit/cluster_checks.go @@ -221,7 +221,7 @@ func makeCheckClusterHighHAAssets(haAssetsThreshold int) checkFunc { func checkClusterNamesForWhitespace(reader *archive.Reader, examples *ExamplesCollection) (Outcome, error) { for _, clusterName := range reader.GetClusterNames() { - if strings.Contains(clusterName, " ") { + if strings.ContainsAny(clusterName, " \n") { examples.add("Cluster: %s", clusterName) } } @@ -253,7 +253,7 @@ func checkLeafnodeServerNamesForWhitespace(r *archive.Reader, examples *Examples for _, leaf := range serverLeafz.Leafs { // check if leafnode name contains whitespace - if strings.Contains(leaf.Name, " ") { + if strings.ContainsAny(leaf.Name, " \n") { leafnodesWithWhitespace[leaf.Name] = struct{}{} } } diff --git a/internal/audit/server_checks.go b/internal/audit/server_checks.go index 88634c9a..47b07bbd 100644 --- a/internal/audit/server_checks.go +++ b/internal/audit/server_checks.go @@ -249,7 +249,7 @@ func checkJetStreamDomainsForWhitespace(r *archive.Reader, examples *ExamplesCol } // check if jetstream domain contains whitespace - if strings.Contains(serverJsz.Config.Domain, " ") { + if strings.ContainsAny(serverJsz.Config.Domain, " \n") { examples.add("Cluster %s Server %s Domain %s", clusterName, serverName, serverJsz.Config.Domain) } } From f82202bf2a18adc7901c5a4f2f35b796f9f664e5 Mon Sep 17 00:00:00 2001 From: "R.I.Pienaar" Date: Mon, 29 Jul 2024 20:54:11 +0300 Subject: [PATCH 2/2] Prepare release v0.1.5 Signed-off-by: R.I.Pienaar --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 19ac5f42..03482af6 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 github.com/klauspost/compress v1.17.9 github.com/mattn/go-isatty v0.0.20 - github.com/nats-io/jsm.go v0.1.1 + github.com/nats-io/jsm.go v0.1.2 github.com/nats-io/jwt/v2 v2.5.8 github.com/nats-io/nats-server/v2 v2.10.18 github.com/nats-io/nats.go v1.36.0 diff --git a/go.sum b/go.sum index a9af1081..8aa81097 100644 --- a/go.sum +++ b/go.sum @@ -77,6 +77,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/nats-io/jsm.go v0.1.1 h1:6vjllz276SdC+3Fb3XI71p9B6toxkCruuB1K6unQEr0= github.com/nats-io/jsm.go v0.1.1/go.mod h1:cFz5wR1pW0zLFotntS4HA7V8Wm+sf8zpF+iQJHbsS6M= +github.com/nats-io/jsm.go v0.1.2 h1:T4Fq88a03sPAPWYwrOLQ85oanYsC2Bs6517rUiWBMpQ= +github.com/nats-io/jsm.go v0.1.2/go.mod h1:tnubE70CAKi5TNfQiq6XHFqWTuSIe1H7X4sDwfq6ZK8= github.com/nats-io/jwt/v2 v2.5.8 h1:uvdSzwWiEGWGXf+0Q+70qv6AQdvcvxrv9hPM0RiPamE= github.com/nats-io/jwt/v2 v2.5.8/go.mod h1:ZdWS1nZa6WMZfFwwgpEaqBV8EPGVgOTDHN/wTbz0Y5A= github.com/nats-io/nats-server/v2 v2.10.18 h1:tRdZmBuWKVAFYtayqlBB2BuCHNGAQPvoQIXOKwU3WSM=