use correct entity type when updating config-types (#1124)

use correct entity type when updating config-types. put schema in "schema" path when updating entity.
This commit is contained in:
Shawn Carey
2023-05-24 21:01:24 +00:00
committed by GitHub
parent a6a1286821
commit db78e17aa5
2 changed files with 4 additions and 3 deletions
+1
View File
@@ -216,4 +216,5 @@ Example output:
* [Issue #1013](https://github.com/openziti/ziti/issues/1013) - docker env password is renewed at each `docker-compose up`
* [Issue #1077](https://github.com/openziti/ziti/issues/1077) - Show auth-policy name on identity list instead of id
* [Issue #1119](https://github.com/openziti/ziti/issues/1119) - intercept.v1 config should permit underscores in the address
* [Issue #1123](https://github.com/openziti/ziti/issues/1123) - cannot update config types with ziti cli
+3 -3
View File
@@ -68,7 +68,7 @@ func newUpdateConfigTypeCmd(out io.Writer, errOut io.Writer) *cobra.Command {
// runUpdateConfigType update a new config on the Ziti Edge Controller
func (self *updateConfigTypeAction) run() error {
id, err := mapNameToID("configs", self.Args[0], self.Options)
id, err := mapNameToID("config-types", self.Args[0], self.Options)
if err != nil {
return err
}
@@ -108,7 +108,7 @@ func (self *updateConfigTypeAction) run() error {
fmt.Printf("Failing parsing JSON: %+v\n", err)
return errors.Errorf("unable to parse data as json: %v", err)
}
api.SetJSONValue(entityData, dataMap, "data")
api.SetJSONValue(entityData, dataMap, "schema")
change = true
}
@@ -116,7 +116,7 @@ func (self *updateConfigTypeAction) run() error {
return errors.New("no change specified. must specify at least one attribute to change")
}
_, err = patchEntityOfType(fmt.Sprintf("configs/%v", id), entityData.String(), &self.Options)
_, err = patchEntityOfType(fmt.Sprintf("config-types/%v", id), entityData.String(), &self.Options)
return err
}