Skip to content

Commit

Permalink
[kubeapps-apis] Add initial helm plugin generated files (#3020)
Browse files Browse the repository at this point in the history
* Add initial helm plugin gen files

* Minor indentation fix

* Add helm plugin to dockerfile
  • Loading branch information
antgamdia committed Jun 23, 2021
1 parent b72a010 commit db037d2
Show file tree
Hide file tree
Showing 11 changed files with 812 additions and 11 deletions.
13 changes: 12 additions & 1 deletion cmd/kubeapps-apis/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,36 @@ COPY cmd cmd
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go build ./cmd/kubeapps-apis
# Build the current standard plugins

# Build 'kapp-controller' plugin, version 'v1alpha1'
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go build \
-o /kapp-controller-packages-v1alpha1-plugin.so -buildmode=plugin \
./cmd/kubeapps-apis/plugins/kapp_controller/packages/v1alpha1/*.go

## Build 'fluxv2' plugin, version 'v1alpha1'
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go build \
-o /fluxv2-packages-v1alpha1-plugin.so -buildmode=plugin \
./cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/*.go

## Build 'helm' plugin, version 'v1alpha1'
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go build \
-o /helm-packages-v1alpha1-plugin.so -buildmode=plugin \
./cmd/kubeapps-apis/plugins/helm/packages/v1alpha1/*.go

# Note: unlike the other docker images for go, we cannot use scratch as the plugins
# are loaded using the dynamic linker.
FROM bitnami/minideb:buster
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /go/src/github.com/kubeapps/kubeapps/kubeapps-apis /kubeapps-apis
COPY --from=builder /kapp-controller-packages-v1alpha1-plugin.so /plugins/
COPY --from=builder /fluxv2-packages-v1alpha1-plugin.so /plugins/
COPY --from=builder /helm-packages-v1alpha1-plugin.so /plugins/

EXPOSE 50051
USER 1001
Expand Down
1 change: 1 addition & 0 deletions cmd/kubeapps-apis/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
build-plugins:
go build -o devel/kapp-controller-packages-v1alpha1-plugin.so -buildmode=plugin plugins/kapp_controller/packages/v1alpha1/*.go
go build -o devel/fluxv2-packages-v1alpha1-plugin.so -buildmode=plugin plugins/fluxv2/packages/v1alpha1/*.go
go build -o devel/helm-packages-v1alpha1-plugin.so -buildmode=plugin plugins/helm/packages/v1alpha1/*.go


# Ensure the required version of cli tooling in tools/tools.go is installed.
Expand Down
135 changes: 126 additions & 9 deletions cmd/kubeapps-apis/docs/kubeapps-apis.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
{
"name": "FluxV2PackagesService"
},
{
"name": "HelmPackagesService"
},
{
"name": "KappControllerPackagesService"
}
Expand Down Expand Up @@ -68,7 +71,7 @@
},
{
"name": "availablePackageRef.context.namespace",
"description": "Namespace. A namespace can be provided if the packaging system allows namespaced packages.",
"description": "Namespace. A namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.",
"in": "query",
"required": false,
"type": "string"
Expand Down Expand Up @@ -138,7 +141,7 @@
},
{
"name": "context.namespace",
"description": "Namespace. A namespace can be provided if the packaging system allows namespaced packages.",
"description": "Namespace. A namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.",
"in": "query",
"required": false,
"type": "string"
Expand Down Expand Up @@ -208,7 +211,7 @@
},
{
"name": "availablePackageRef.context.namespace",
"description": "Namespace. A namespace can be provided if the packaging system allows namespaced packages.",
"description": "Namespace. A namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.",
"in": "query",
"required": false,
"type": "string"
Expand Down Expand Up @@ -279,7 +282,7 @@
},
{
"name": "context.namespace",
"description": "Namespace. A namespace can be provided if the packaging system allows namespaced packages.",
"description": "Namespace. A namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.",
"in": "query",
"required": false,
"type": "string"
Expand Down Expand Up @@ -322,7 +325,7 @@
},
{
"name": "context.namespace",
"description": "Namespace. A namespace can be provided if the packaging system allows namespaced packages.",
"description": "Namespace. A namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.",
"in": "query",
"required": false,
"type": "string"
Expand All @@ -333,6 +336,120 @@
]
}
},
"/plugins/helm/packages/v1alpha1/availablepackagedetails": {
"get": {
"summary": "GetAvailablePackageDetail returns the package details managed by the 'helm' plugin",
"operationId": "HelmPackagesService_GetAvailablePackageDetail",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1alpha1GetAvailablePackageDetailResponse"
}
},
"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": "availablePackageRef.context.cluster",
"description": "Cluster. A cluster name can be provided to target a specific cluster if multiple\nclusters are configured, otherwise all clusters will be assumed.",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "availablePackageRef.context.namespace",
"description": "Namespace. A namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "availablePackageRef.identifier",
"description": "Available package identifier. The fully qualified identifier for the available package\n(ie. a unique name for the context). For some packaging systems\n(particularly those where an available package is backed by a CR) this\nwill just be the name, but for others such as those where an available\npackage is not backed by a CR (eg. standard helm) it may be necessary\nto include the repository in the name or even the repo namespace\nto ensure this is unique. \nFor example two helm repositories can define\nan \"apache\" chart that is available globally, the names would need to\nencode that to be unique (ie. \"repoA:apache\" and \"repoB:apache\").",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "availablePackageRef.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": "availablePackageRef.plugin.version",
"description": "Plugin version. The version of the plugin, such as v1alpha1",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "version",
"description": "Optional specific version (or version reference) to request.\nBy default the latest version (or latest version matching the reference)\nwill be returned.",
"in": "query",
"required": false,
"type": "string"
}
],
"tags": [
"HelmPackagesService"
]
}
},
"/plugins/helm/packages/v1alpha1/availablepackagesummaries": {
"get": {
"summary": "GetAvailablePackageSummaries returns the available packages managed by the 'helm' plugin",
"operationId": "HelmPackagesService_GetAvailablePackageSummaries",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1alpha1GetAvailablePackageSummariesResponse"
}
},
"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": "context.cluster",
"description": "Cluster. A cluster name can be provided to target a specific cluster if multiple\nclusters are configured, otherwise all clusters will be assumed.",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "context.namespace",
"description": "Namespace. A namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.",
"in": "query",
"required": false,
"type": "string"
}
],
"tags": [
"HelmPackagesService"
]
}
},
"/plugins/kapp_controller/packages/v1alpha1/availablepackagedetails": {
"get": {
"summary": "GetAvailablePackageDetail returns the package details managed by the 'kapp_controller' plugin",
Expand Down Expand Up @@ -365,7 +482,7 @@
},
{
"name": "availablePackageRef.context.namespace",
"description": "Namespace. A namespace can be provided if the packaging system allows namespaced packages.",
"description": "Namespace. A namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.",
"in": "query",
"required": false,
"type": "string"
Expand Down Expand Up @@ -436,7 +553,7 @@
},
{
"name": "context.namespace",
"description": "Namespace. A namespace can be provided if the packaging system allows namespaced packages.",
"description": "Namespace. A namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.",
"in": "query",
"required": false,
"type": "string"
Expand Down Expand Up @@ -479,7 +596,7 @@
},
{
"name": "context.namespace",
"description": "Namespace. A namespace can be provided if the packaging system allows namespaced packages.",
"description": "Namespace. A namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.",
"in": "query",
"required": false,
"type": "string"
Expand Down Expand Up @@ -762,7 +879,7 @@
},
"namespace": {
"type": "string",
"description": "A namespace can be provided if the packaging system allows namespaced packages.",
"description": "A namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.",
"title": "Namespace"
}
},
Expand Down

0 comments on commit db037d2

Please sign in to comment.