Skip to content

Commit a37d858

Browse files
authored
Merge pull request #2319 from openziti/fix-patch-app-data
fix patch app data
2 parents 5af919f + 92b28cb commit a37d858

File tree

6 files changed

+38
-8
lines changed

6 files changed

+38
-8
lines changed

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
# Release 1.1.9
2+
3+
* Bug fixes, enhancements and continuing progress on controller HA
4+
5+
## Component Updates and Bug Fixes
6+
7+
* github.com/openziti/agent: [v1.0.16 -> v1.0.17](https://github.com/openziti/agent/compare/v1.0.16...v1.0.17)
8+
* github.com/openziti/channel/v2: [v2.0.136 -> v2.0.137](https://github.com/openziti/channel/compare/v2.0.136...v2.0.137)
9+
* github.com/openziti/foundation/v2: [v2.0.47 -> v2.0.48](https://github.com/openziti/foundation/compare/v2.0.47...v2.0.48)
10+
* github.com/openziti/identity: [v1.0.81 -> v1.0.82](https://github.com/openziti/identity/compare/v1.0.81...v1.0.82)
11+
* github.com/openziti/metrics: [v1.2.56 -> v1.2.57](https://github.com/openziti/metrics/compare/v1.2.56...v1.2.57)
12+
* github.com/openziti/runzmd: [v1.0.49 -> v1.0.50](https://github.com/openziti/runzmd/compare/v1.0.49...v1.0.50)
13+
* github.com/openziti/sdk-golang: [v0.23.39 -> v0.23.40](https://github.com/openziti/sdk-golang/compare/v0.23.39...v0.23.40)
14+
* [Issue #601](https://github.com/openziti/sdk-golang/issues/601) - Only send config types on service list if controller version supports it
15+
16+
* github.com/openziti/transport/v2: [v2.0.138 -> v2.0.139](https://github.com/openziti/transport/compare/v2.0.138...v2.0.139)
17+
* github.com/openziti/ziti: [v1.1.8 -> v1.1.9](https://github.com/openziti/ziti/compare/v1.1.8...v1.1.9)
18+
* [Issue #2318](https://github.com/openziti/ziti/issues/2318) - Unable to update appData on existing edge routers using PATCH
19+
* [Issue #2281](https://github.com/openziti/ziti/issues/2281) - Session Certificates Should Return a Chain
20+
* [Issue #2285](https://github.com/openziti/ziti/issues/2285) - routers sometimes report link metrics for closed links
21+
* [Issue #2282](https://github.com/openziti/ziti/issues/2282) - Investigate OIDC TOTP Redirect w/ application/json
22+
* [Issue #2279](https://github.com/openziti/ziti/issues/2279) - Ensure xweb initialized before RAFT
23+
* [Issue #2277](https://github.com/openziti/ziti/issues/2277) - docker controller and router deployments - generate a config by default
24+
* [Issue #2154](https://github.com/openziti/ziti/issues/2154) - HA MFA Enrollment returns 500
25+
* [Issue #2159](https://github.com/openziti/ziti/issues/2159) - API Session in HA return 400
26+
127
# Release 1.1.8
228

329
## What's New

controller/db/edge_router_store.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func (store *edgeRouterStoreImpl) FillEntity(entity *EdgeRouter, bucket *boltz.T
179179
entity.UnverifiedCertPem = bucket.GetString(FieldEdgeRouterUnverifiedCertPEM)
180180

181181
entity.RoleAttributes = bucket.GetStringList(FieldRoleAttributes)
182-
entity.AppData = bucket.GetMap(FieldIdentityAppData)
182+
entity.AppData = bucket.GetMap(FieldEdgeRouterAppData)
183183

184184
}
185185

controller/internal/routes/edge_router_api_model.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ import (
2424
"github.com/go-openapi/strfmt"
2525
"github.com/michaelquigley/pfxlog"
2626
"github.com/openziti/edge-api/rest_model"
27+
"github.com/openziti/foundation/v2/stringz"
2728
"github.com/openziti/ziti/controller/env"
2829
"github.com/openziti/ziti/controller/model"
29-
"github.com/openziti/ziti/controller/response"
3030
"github.com/openziti/ziti/controller/models"
31-
"github.com/openziti/foundation/v2/stringz"
31+
"github.com/openziti/ziti/controller/response"
3232
)
3333

3434
const (

controller/internal/routes/edge_router_router.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,16 @@ package routes
1919
import (
2020
"github.com/go-openapi/runtime/middleware"
2121
"github.com/openziti/edge-api/rest_management_api_server/operations/edge_router"
22+
"github.com/openziti/storage/ast"
23+
"github.com/openziti/storage/boltz"
2224
"github.com/openziti/ziti/controller/apierror"
25+
"github.com/openziti/ziti/controller/db"
2326
"github.com/openziti/ziti/controller/env"
27+
"github.com/openziti/ziti/controller/fields"
2428
"github.com/openziti/ziti/controller/internal/permissions"
2529
"github.com/openziti/ziti/controller/model"
26-
"github.com/openziti/ziti/controller/response"
27-
"github.com/openziti/ziti/controller/fields"
2830
"github.com/openziti/ziti/controller/models"
29-
"github.com/openziti/storage/ast"
31+
"github.com/openziti/ziti/controller/response"
3032
)
3133

3234
func init() {
@@ -132,7 +134,8 @@ func (r *EdgeRouterRouter) Update(ae *env.AppEnv, rc *response.RequestContext, p
132134

133135
func (r *EdgeRouterRouter) Patch(ae *env.AppEnv, rc *response.RequestContext, params edge_router.PatchEdgeRouterParams) {
134136
Patch(rc, func(id string, fields fields.UpdatedFields) error {
135-
return ae.Managers.EdgeRouter.Update(MapPatchEdgeRouterToModel(params.ID, params.EdgeRouter), false, fields.FilterMaps("tags"), rc.NewChangeContext())
137+
fieldChecker := fields.FilterMaps(boltz.FieldTags, db.FieldEdgeRouterAppData)
138+
return ae.Managers.EdgeRouter.Update(MapPatchEdgeRouterToModel(params.ID, params.EdgeRouter), false, fieldChecker, rc.NewChangeContext())
136139
})
137140
}
138141

controller/model/edge_router_manager.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ func NewEdgeRouterManager(env Env) *EdgeRouterManager {
4747
db.FieldRouterCost: struct{}{},
4848
db.FieldRouterNoTraversal: struct{}{},
4949
db.FieldRouterDisabled: struct{}{},
50+
db.FieldEdgeRouterAppData: struct{}{},
5051
},
5152
}
5253

ziti/cmd/edge/create_edge_router.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func NewCreateEdgeRouterCmd(out io.Writer, errOut io.Writer) *cobra.Command {
6262
cmd.Flags().StringSliceVarP(&options.roleAttributes, "role-attributes", "a", nil, "comma-separated role attributes for the new router")
6363
cmd.Flags().BoolVarP(&options.isTunnelerEnabled, "tunneler-enabled", "t", false, "Can this edge router be used as a tunneler")
6464
cmd.Flags().StringVarP(&options.jwtOutputFile, "jwt-output-file", "o", "", "File to which to output the JWT used for enrolling the edge router")
65-
cmd.Flags().StringToStringVar(&options.appData, "app-Data", nil, "Custom application data")
65+
cmd.Flags().StringToStringVar(&options.appData, "app-data", nil, "Custom application data")
6666
cmd.Flags().Uint16Var(&options.cost, "cost", 0, "Specifies the router cost. Default 0.")
6767
cmd.Flags().BoolVar(&options.noTraversal, "no-traversal", false, "Disallow traversal for this edge router. Default to allowed(false).")
6868
cmd.Flags().BoolVar(&options.disabled, "disabled", false, "Disabled routers can't connect to controllers")

0 commit comments

Comments
 (0)