rstudio / rstudioapi

Safely access RStudio's API (when available)
http://rstudio.github.io/rstudioapi
Other
165 stars 35 forks source link

Add example of using launcherContainer with runAsUserId, runAsGroupId #205

Open gtritchie opened 3 years ago

gtritchie commented 3 years ago

Should include an example showing you have to include "L" on the end of the userid and/or groupid or an error is thrown.

container = launcherContainer(image='my-container', runAsUserId = 1005L, runAsGroupId = 1005L)

kevinushey commented 3 years ago

Should RStudio coerce these values to integers (so that both regular floats and integers can be accepted)?

gtritchie commented 3 years ago

Should RStudio coerce these values to integers (so that both regular floats and integers can be accepted)?

Probably, yes. I think this is a regression in RStudio 1.3, maybe due to the JSON framework changes, but haven't confirmed that yet.

kevinushey commented 3 years ago

@gtritchie, I made a change here to support numeric values:

https://github.com/rstudio/rstudioapi/commit/4ef16ec7bde9edb9b4ad11258988daa2c706cb44

Do you think it's worth doing something similar on the RSP side as well (coerce numeric to integer as appropriate)?

gtritchie commented 3 years ago

Do you think it's worth doing something similar on the RSP side as well (coerce numeric to integer as appropriate)?

@kevinushey Probably not necessary (though wouldn't hurt); we don't officially support using the internal APIs to get at this, only this rstudioapi.

Thanks for making the tweak to the API, though!