Skip to content

Commit

Permalink
Merge pull request #589 from ripienaar/meta_simplify
Browse files Browse the repository at this point in the history
Simplify asset versioning
  • Loading branch information
ripienaar authored Nov 28, 2024
2 parents b609521 + 39002d3 commit da16cd2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 18 deletions.
8 changes: 3 additions & 5 deletions api/jetstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand All @@ -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=
Expand Down
5 changes: 1 addition & 4 deletions jsm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down

0 comments on commit da16cd2

Please sign in to comment.