Skip to content

Commit

Permalink
Add GetInstalledPackageResourceRefs to packages API and implement in …
Browse files Browse the repository at this point in the history
…Helm. (#3581)

* Add GetResourceRefs to packages API and plugins.

Signed-off-by: Michael Nelson <minelson@vmware.com>

* Add implementation for helm GetResources.

Signed-off-by: Michael Nelson <minelson@vmware.com>

* Move context from ResourceRef, depend on context of installed package.

Signed-off-by: Michael Nelson <minelson@vmware.com>

* Add version to ResourceRef.

Signed-off-by: Michael Nelson <minelson@vmware.com>

* Implement GetResources for core packages API.

Signed-off-by: Michael Nelson <minelson@vmware.com>

* Update to the naming from the design doc.

Signed-off-by: Michael Nelson <minelson@vmware.com>

* Re-run buf generate after rebase.

Signed-off-by: Michael Nelson <minelson@vmware.com>
  • Loading branch information
absoludity authored Nov 9, 2021
1 parent 77a7c7e commit 1bcdedb
Show file tree
Hide file tree
Showing 35 changed files with 3,822 additions and 2,034 deletions.
292 changes: 291 additions & 1 deletion cmd/kubeapps-apis/docs/kubeapps-apis.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,69 @@
]
}
},
"/core/packages/v1alpha1/installedpackages/plugin/{installedPackageRef.plugin.name}/{installedPackageRef.plugin.version}/c/{installedPackageRef.context.cluster}/ns/{installedPackageRef.context.namespace}/{installedPackageRef.identifier}/resourcerefs": {
"get": {
"operationId": "PackagesService_GetInstalledPackageResourceRefs",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1alpha1GetInstalledPackageResourceRefsResponse"
}
},
"401": {
"description": "Returned when the user does not have permission to access the resource.",
"schema": {}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "installedPackageRef.plugin.name",
"description": "Plugin name\n\nThe name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "installedPackageRef.plugin.version",
"description": "Plugin version\n\nThe version of the plugin, such as v1alpha1",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "installedPackageRef.context.cluster",
"description": "Cluster\n\nA cluster name can be provided to target a specific cluster if multiple\nclusters are configured, otherwise all clusters will be assumed.",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "installedPackageRef.context.namespace",
"description": "Namespace\n\nA namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.\nFor requests to list items, not including a namespace here implies that the context\nfor the request is everything the requesting user can read, though the result can\nbe filtered by any filtering options of the request. Plugins may choose to return\nUnimplemented for some queries for which we do not yet have a need.",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "installedPackageRef.identifier",
"description": "The fully qualified identifier for the installed package\n(ie. a unique name for the context).",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"PackagesService"
]
}
},
"/core/plugins/v1alpha1/configured-plugins": {
"get": {
"summary": "GetConfiguredPlugins returns a map of short and longnames for the configured plugins.",
Expand Down Expand Up @@ -1109,6 +1172,70 @@
]
}
},
"/plugins/fluxv2/packages/v1alpha1/installedpackages/c/{installedPackageRef.context.cluster}/ns/{installedPackageRef.context.namespace}/{installedPackageRef.identifier}/resourcerefs": {
"get": {
"summary": "GetInstalledPackageResourceRefs returns the references for the Kubernetes\nresources created by an installed package.",
"operationId": "FluxV2PackagesService_GetInstalledPackageResourceRefs",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1alpha1GetInstalledPackageResourceRefsResponse"
}
},
"401": {
"description": "Returned when the user does not have permission to access the resource.",
"schema": {}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "installedPackageRef.context.cluster",
"description": "Cluster\n\nA cluster name can be provided to target a specific cluster if multiple\nclusters are configured, otherwise all clusters will be assumed.",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "installedPackageRef.context.namespace",
"description": "Namespace\n\nA namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.\nFor requests to list items, not including a namespace here implies that the context\nfor the request is everything the requesting user can read, though the result can\nbe filtered by any filtering options of the request. Plugins may choose to return\nUnimplemented for some queries for which we do not yet have a need.",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "installedPackageRef.identifier",
"description": "The fully qualified identifier for the installed package\n(ie. a unique name for the context).",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "installedPackageRef.plugin.name",
"description": "Plugin name. The name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "installedPackageRef.plugin.version",
"description": "Plugin version. The version of the plugin, such as v1alpha1",
"in": "query",
"required": false,
"type": "string"
}
],
"tags": [
"FluxV2PackagesService"
]
}
},
"/plugins/fluxv2/packages/v1alpha1/packagerepositories": {
"get": {
"summary": "GetPackageRepositories returns the repositories managed by the 'fluxv2' plugin",
Expand Down Expand Up @@ -1670,6 +1797,70 @@
]
}
},
"/plugins/helm/packages/v1alpha1/installedpackages/c/{installedPackageRef.context.cluster}/ns/{installedPackageRef.context.namespace}/{installedPackageRef.identifier}/resourcerefs": {
"get": {
"summary": "GetInstalledPackageResourceRefs returns the references for the Kubernetes resources created by\nan installed package.",
"operationId": "HelmPackagesService_GetInstalledPackageResourceRefs",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1alpha1GetInstalledPackageResourceRefsResponse"
}
},
"401": {
"description": "Returned when the user does not have permission to access the resource.",
"schema": {}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "installedPackageRef.context.cluster",
"description": "Cluster\n\nA cluster name can be provided to target a specific cluster if multiple\nclusters are configured, otherwise all clusters will be assumed.",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "installedPackageRef.context.namespace",
"description": "Namespace\n\nA namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.\nFor requests to list items, not including a namespace here implies that the context\nfor the request is everything the requesting user can read, though the result can\nbe filtered by any filtering options of the request. Plugins may choose to return\nUnimplemented for some queries for which we do not yet have a need.",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "installedPackageRef.identifier",
"description": "The fully qualified identifier for the installed package\n(ie. a unique name for the context).",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "installedPackageRef.plugin.name",
"description": "Plugin name. The name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "installedPackageRef.plugin.version",
"description": "Plugin version. The version of the plugin, such as v1alpha1",
"in": "query",
"required": false,
"type": "string"
}
],
"tags": [
"HelmPackagesService"
]
}
},
"/plugins/helm/packages/v1alpha1/installedpackages/c/{installedPackageRef.context.cluster}/ns/{installedPackageRef.context.namespace}/{installedPackageRef.identifier}/rollback": {
"put": {
"summary": "RollbackInstalledPackage updates an installed package based on the request.",
Expand Down Expand Up @@ -2246,6 +2437,70 @@
]
}
},
"/plugins/kapp_controller/packages/v1alpha1/installedpackages/c/{installedPackageRef.context.cluster}/ns/{installedPackageRef.context.namespace}/{installedPackageRef.identifier}/resourcerefs": {
"get": {
"summary": "GetInstalledPackageResourceRefs returns the references for the Kubernetes resources created by\nan installed package.",
"operationId": "KappControllerPackagesService_GetInstalledPackageResourceRefs",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1alpha1GetInstalledPackageResourceRefsResponse"
}
},
"401": {
"description": "Returned when the user does not have permission to access the resource.",
"schema": {}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "installedPackageRef.context.cluster",
"description": "Cluster\n\nA cluster name can be provided to target a specific cluster if multiple\nclusters are configured, otherwise all clusters will be assumed.",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "installedPackageRef.context.namespace",
"description": "Namespace\n\nA namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.\nFor requests to list items, not including a namespace here implies that the context\nfor the request is everything the requesting user can read, though the result can\nbe filtered by any filtering options of the request. Plugins may choose to return\nUnimplemented for some queries for which we do not yet have a need.",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "installedPackageRef.identifier",
"description": "The fully qualified identifier for the installed package\n(ie. a unique name for the context).",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "installedPackageRef.plugin.name",
"description": "Plugin name. The name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "installedPackageRef.plugin.version",
"description": "Plugin version. The version of the plugin, such as v1alpha1",
"in": "query",
"required": false,
"type": "string"
}
],
"tags": [
"KappControllerPackagesService"
]
}
},
"/plugins/kapp_controller/packages/v1alpha1/packagerepositories": {
"get": {
"summary": "GetPackageRepositories returns the repositories managed by the 'kapp_controller' plugin",
Expand Down Expand Up @@ -2788,6 +3043,22 @@
"description": "Response for GetInstalledPackageDetail",
"title": "GetInstalledPackageDetailResponse"
},
"v1alpha1GetInstalledPackageResourceRefsResponse": {
"type": "object",
"properties": {
"context": {
"$ref": "#/definitions/v1alpha1Context"
},
"resourceRefs": {
"type": "array",
"items": {
"$ref": "#/definitions/v1alpha1ResourceRef"
}
}
},
"description": "Response for GetInstalledPackageResourceRefs",
"title": "GetInstalledPackageResourceRefsResponse"
},
"v1alpha1GetInstalledPackageSummariesResponse": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -3058,7 +3329,7 @@
},
"suspend": {
"type": "boolean",
"description": "Whether reconciliation should be suspended until otherwise enabled.",
"description": "Whether reconciliation should be suspended until otherwise enabled.\nThis can be utilized to e.g. temporarily ignore chart changes, and\nprevent a Helm release from getting upgraded",
"title": "Suspend"
},
"serviceAccountName": {
Expand All @@ -3070,6 +3341,25 @@
"description": "ReconciliationOptions enable specifying standard fields for backends that continuously\nreconcile a package install as new matching versions are released. Most of the naming\nis from the flux HelmReleaseSpec though it maps directly to equivalent fields on Carvel's\nInstalledPackage.",
"title": "ReconciliationOptions"
},
"v1alpha1ResourceRef": {
"type": "object",
"properties": {
"apiVersion": {
"type": "string",
"description": "The APIVersion directly from the resource has the group and version, eg. \"apps/v1\"\nor just the version for core resources."
},
"kind": {
"type": "string",
"description": "The Kind directly from the templated manifest. Together with the APIVersion this\nforms the GroupVersionKind."
},
"name": {
"type": "string",
"description": "The name of the specific resource in the context of the installed package."
}
},
"description": "A reference to a Kubernetes resource related to a specific installed package.\nThe context (cluster, namespace) for each resource is that of the related\ninstalled package.",
"title": "Resource reference"
},
"v1alpha1RollbackInstalledPackageRequest": {
"type": "object",
"properties": {
Expand Down
Loading

0 comments on commit 1bcdedb

Please sign in to comment.