cryostatio / cryostat-legacy

OUTDATED - See the new repository below! -- Secure JDK Flight Recorder management for containerized JVMs
https://github.com/cryostatio/cryostat
Other
222 stars 31 forks source link

[Task] Support for editting target details #1258

Open tthvo opened 1 year ago

tthvo commented 1 year ago

It looks like the users cannot edit labels/annotations of target. Most targets now have empty labels. It would be nice to be able to support this.

{
  "alias": "io.cryostat.Cryostat",
  "annotations": {
      "cryostat": {
          "HOST": "cryostat",
          "JAVA_MAIN": "io.cryostat.Cryostat",
          "PORT": "9091",
          "REALM": "JDP"
      },
      "platform": {}
  },
  "connectUrl": "service:jmx:rmi:///jndi/rmi://cryostat:9091/jmxrmi",
  "jvmId": "71i3ivTX0ucC9BzsZTMd3ySSPX3q3azC-sgrs5-yV54=",
  "labels": {}
}
tthvo commented 1 year ago

Maybe we could extend to allow users to edit any details (i.e. alias or others if later added). I think the connectUrl can remain fixed.

andrewazores commented 1 year ago

This one I'm not totally sure about. Maybe there should be an annotations.user subfield, and labels could be split into labels.platform and labels.user as well. I don't think the user should be able to remove or modify the annotations or labels that are copied from the platform (ex. OpenShift labels). This would make it too easy for a user to desync their targets in Cryostat's view from what the platform represents them as, and it would also mean we need some way to track and re-apply these changes if the target database is updated.

Since these target definitions can be published by discovery plugins and we can't assume we have control of those plugins and the labels they publish, these "user labels" need to be stored separately and correlated to targets by name/ID.

Also, any changes to these labels would necessitate re-valuating matchExpressions for rules and credentials against the updated target and its new labels.