From 39002d32fee5385333f471c1b90881d91fcd4616 Mon Sep 17 00:00:00 2001 From: "R.I.Pienaar" Date: Wed, 27 Nov 2024 10:58:49 +0100 Subject: [PATCH] Simplify asset versioning Signed-off-by: R.I.Pienaar --- api/jetstream.go | 8 +++----- go.mod | 6 +++--- go.sum | 12 ++++++------ jsm.go | 5 +---- 4 files changed, 13 insertions(+), 18 deletions(-) diff --git a/api/jetstream.go b/api/jetstream.go index 1b3c1ca..eed215d 100644 --- a/api/jetstream.go +++ b/api/jetstream.go @@ -29,11 +29,9 @@ const ( // also update FilterServerMetadata when this changes - JSMetaCreatedServerLevel = "_nats.created.server.api_level" - JSMetaCreatedServerVersion = "_nats.created.server.version" - JSMetaCurrentServerLevel = "_nats.server.api_level" - JSMetaCurrentServerVersion = "_nats.server.version" - JsMetaRequiredServerLevel = "_nats.server.require.api_level" + JSMetaCurrentServerLevel = "_nats.level" + JSMetaCurrentServerVersion = "_nats.ver" + JsMetaRequiredServerLevel = "_nats.req.level" ) // Responses to requests sent to a server from a client. diff --git a/go.mod b/go.mod index 65e970f..7b3395f 100644 --- a/go.mod +++ b/go.mod @@ -6,12 +6,12 @@ require ( github.com/dustin/go-humanize v1.0.1 github.com/expr-lang/expr v1.16.9 github.com/google/go-cmp v0.6.0 - github.com/jedib0t/go-pretty/v6 v6.6.2 + github.com/jedib0t/go-pretty/v6 v6.6.3 github.com/klauspost/compress v1.17.11 github.com/nats-io/jwt/v2 v2.7.2 - github.com/nats-io/nats-server/v2 v2.11.0-dev.0.20241126010352-fa50c751ab3c + github.com/nats-io/nats-server/v2 v2.11.0-dev.0.20241127165413-cfaad68e19db github.com/nats-io/nats.go v1.37.0 - github.com/nats-io/nkeys v0.4.7 + github.com/nats-io/nkeys v0.4.8 github.com/nats-io/nuid v1.0.1 github.com/prometheus/client_golang v1.20.5 github.com/prometheus/common v0.60.1 diff --git a/go.sum b/go.sum index 7eee3c8..5f0c95b 100644 --- a/go.sum +++ b/go.sum @@ -15,8 +15,8 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-tpm v0.9.1 h1:0pGc4X//bAlmZzMKf8iz6IsDo1nYTbYJ6FZN/rg4zdM= github.com/google/go-tpm v0.9.1/go.mod h1:h9jEsEECg7gtLis0upRBQU+GhYVH6jMjrFxI8u6bVUY= -github.com/jedib0t/go-pretty/v6 v6.6.2 h1:27bLj3nRODzaiA7tPIxy9UVWHoPspFfME9XxgwiiNsM= -github.com/jedib0t/go-pretty/v6 v6.6.2/go.mod h1:zbn98qrYlh95FIhwwsbIip0LYpwSG8SUOScs+v9/t0E= +github.com/jedib0t/go-pretty/v6 v6.6.3 h1:nGqgS0tgIO1Hto47HSaaK4ac/I/Bu7usmdD3qvs0WvM= +github.com/jedib0t/go-pretty/v6 v6.6.3/go.mod h1:zbn98qrYlh95FIhwwsbIip0LYpwSG8SUOScs+v9/t0E= github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -31,12 +31,12 @@ 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/jwt/v2 v2.7.2 h1:SCRjfDLJ2q8naXp8YlGJJS5/yj3wGSODFYVi4nnwVMw= github.com/nats-io/jwt/v2 v2.7.2/go.mod h1:kB6QUmqHG6Wdrzj0KP2L+OX4xiTPBeV+NHVstFaATXU= -github.com/nats-io/nats-server/v2 v2.11.0-dev.0.20241126010352-fa50c751ab3c h1:Lq24aOAbP9Pr4E5Sqvghr6NNxV+FUGMM3ojHFzno8Js= -github.com/nats-io/nats-server/v2 v2.11.0-dev.0.20241126010352-fa50c751ab3c/go.mod h1:nI8h87Ryi/zcaQcDLSSVbMfomhyck+0oDqxR7NoZX0Y= +github.com/nats-io/nats-server/v2 v2.11.0-dev.0.20241127165413-cfaad68e19db h1:XSsKLcdTjNwRhhiPS2G193zgh7yCHjT5IRzRyTuI/Y0= +github.com/nats-io/nats-server/v2 v2.11.0-dev.0.20241127165413-cfaad68e19db/go.mod h1:nI8h87Ryi/zcaQcDLSSVbMfomhyck+0oDqxR7NoZX0Y= github.com/nats-io/nats.go v1.37.0 h1:07rauXbVnnJvv1gfIyghFEo6lUcYRY0WXc3x7x0vUxE= github.com/nats-io/nats.go v1.37.0/go.mod h1:Ubdu4Nh9exXdSz0RVWRFBbRfrbSxOYd26oF0wkWclB8= -github.com/nats-io/nkeys v0.4.7 h1:RwNJbbIdYCoClSDNY7QVKZlyb/wfT6ugvFCiKy6vDvI= -github.com/nats-io/nkeys v0.4.7/go.mod h1:kqXRgRDPlGy7nGaEDMuYzmiJCIAAWDK0IMBtDmGD0nc= +github.com/nats-io/nkeys v0.4.8 h1:+wee30071y3vCZAYRsnrmIPaOe47A/SkK/UBDPdIV70= +github.com/nats-io/nkeys v0.4.8/go.mod h1:kqXRgRDPlGy7nGaEDMuYzmiJCIAAWDK0IMBtDmGD0nc= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= diff --git a/jsm.go b/jsm.go index 52d49d6..36a7f22 100644 --- a/jsm.go +++ b/jsm.go @@ -312,7 +312,7 @@ func ParseDuration(d string) (time.Duration, error) { return time.Duration(neg) * r, nil } -// FilterServerMetadata removes a copy of metadata with the server generated metadata removed +// FilterServerMetadata copies metadata with the server generated metadata removed func FilterServerMetadata(metadata map[string]string) map[string]string { if metadata == nil { return nil @@ -322,10 +322,7 @@ func FilterServerMetadata(metadata map[string]string) map[string]string { reserved := []string{ api.JSMetaCurrentServerVersion, api.JSMetaCurrentServerLevel, - api.JSMetaCreatedServerVersion, - api.JSMetaCreatedServerVersion, api.JsMetaRequiredServerLevel, - api.JSMetaCreatedServerLevel, } for k, v := range metadata {