-
Notifications
You must be signed in to change notification settings - Fork 489
Allow plugins to apply yaml #2775
Allow plugins to apply yaml #2775
Conversation
Using Update in api service interface to create and update seems a bit odd. This PR uses update to make the api consistent with JS plugins. It can be argued to have create and update but have similar signatures and underlying implementation which can help with clarity around developers intent. |
37848a2
to
a9837a4
Compare
The breaking changes are a bit too aggressive imo. Create and Update has error handling for specific cases: e.g. create when the object already exists, update on an object which does not exist Moreover, the preferred method of fetching objects is through In theory, one can already do the conversion from YAML via something like |
I can see why typescript plugins have to do it this way because it is difficult to represent |
a9837a4
to
7381339
Compare
Based on Sam's comments, a new method ( |
7381339
to
11a2a77
Compare
11a2a77
to
4e2b081
Compare
@@ -100,6 +100,19 @@ Here is an example of setting up your plugin to know when the current namespace | |||
} | |||
``` | |||
|
|||
Besides having custom actions, there are pre-exsiting octant actions which are registered by octant internal modules and they can be leveraged to perform an action. | |||
For example: `action.octant.dev/apply` (https://github.com/vmware-tanzu/octant/blob/71e75e12b05764588d3f0aede455d143e35a3355/internal/octant/actions.go#L25) can be used to create/update resources |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd remove the link to the internal package. We can make a const in pkg/actions
for folks and reference that - https://github.com/vmware-tanzu/octant/blob/master/pkg/action/actions.go
Also I would use the above URL format (linking directly to master) even though that means links will not work on the preview site.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I apologize I forgot to comment here. I am a bit confused about this. There are multiple actions which allow users to interact with the resources in octant/actions
. Should we also move other actions to pkg/actions
as well as part of this documentation? Or may be the path forward is to have make needed functionality available through plugin API with some duplication?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think there is some transition cruft here and that we want to expose actions for users to consume via the pkg
vs. internal
2bc687a
to
6011d97
Compare
- Document actions which have similar function Signed-off-by: Vikram Yadav <yvikram@vmware.com>
6011d97
to
3f63ec5
Compare
Some notes:
This method of triggering an action requires binding to a component and an understanding of what payload metadata is needed since there is no
|
What this PR does / why we need it:
Which issue(s) this PR fixes
Special notes for your reviewer:
Please merge after #2774 is merged.