Skip to content

Commit

Permalink
Get package details prototype (#2915)
Browse files Browse the repository at this point in the history
* step 1

* step 2

* step 3

* step 4

* step 5

* step 6

* step 7

* step 8
  • Loading branch information
gfichtenholt committed Jun 8, 2021
1 parent 3c0f3c9 commit a6d2a17
Show file tree
Hide file tree
Showing 17 changed files with 1,232 additions and 145 deletions.
3 changes: 2 additions & 1 deletion cmd/kubeapps-apis/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ cli-dependencies:
github.com/spf13/cobra/cobra \
google.golang.org/grpc/cmd/protoc-gen-go-grpc \
google.golang.org/protobuf/cmd/protoc-gen-go \
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 \
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway

# Not sure if it's worth having targets for buf, but at least the targets can
# be tooling agnostic.
Expand Down
8 changes: 8 additions & 0 deletions cmd/kubeapps-apis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,14 @@ Of course, you will need to have the appropriate Flux HelmRepository or Carvel P

A few extra tools will be needed to contribute to the development of this service.

### GOPATH env variable

Make sure your GOPATH environment variable is set.
You can use the value of command
```bash
go env GOPATH
```

### Install go cli deps

You should be able to install the exact versions of the various go CLI dependencies into your $GOPATH/bin with the following, after ensuring `$GOPATH/bin` is included in your `$PATH`:
Expand Down
156 changes: 142 additions & 14 deletions cmd/kubeapps-apis/docs/kubeapps-apis.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,49 @@
"application/json"
],
"paths": {
"/core/packages/v1alpha1/packagemeta": {
"get": {
"operationId": "PackagesService_GetPackageMeta",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1alpha1GetPackageMetaResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "package.name",
"description": "required package name should be unique within the scope of specified repository, if specified.",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "package.repository.name",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "package.repository.namespace",
"in": "query",
"required": false,
"type": "string"
}
],
"tags": [
"PackagesService"
]
}
},
"/core/packages/v1alpha1/packagerepositories": {
"get": {
"operationId": "PackagesService_GetPackageRepositories",
Expand Down Expand Up @@ -134,6 +177,50 @@
]
}
},
"/plugins/fluxv2/packages/v1alpha1/packagemeta": {
"get": {
"summary": "GetPackageMeta returns the package metadata managed by the 'fluxv2' plugin",
"operationId": "FluxV2PackagesService_GetPackageMeta",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1alpha1GetPackageMetaResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "package.name",
"description": "required package name should be unique within the scope of specified repository, if specified.",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "package.repository.name",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "package.repository.namespace",
"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 @@ -292,22 +379,13 @@
}
},
"definitions": {
"AvailablePackagePackageRepositoryReference": {
"GetPackageMetaResponsePackageMeta": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The fully qualified name of the package repository.",
"title": "Package repository name"
},
"namespace": {
"type": "string",
"description": "An optional namespace for namespaced package repositories.",
"title": "Package repository namespace"
"readme": {
"type": "string"
}
},
"description": "A PackageRepository is identified by a fully qualified name and\noptionally a specific namespace.",
"title": "PackageRepositoryReference"
}
},
"protobufAny": {
"type": "object",
Expand Down Expand Up @@ -363,7 +441,7 @@
"title": "Available package icon"
},
"repository": {
"$ref": "#/definitions/AvailablePackagePackageRepositoryReference",
"$ref": "#/definitions/v1alpha1AvailablePackagePackageRepositoryReference",
"description": "An optional package repository reference where this package is located. Not\nall plugins may support this back reference (eg. kapp-controller)",
"title": "Package repository reference"
},
Expand All @@ -376,6 +454,23 @@
"description": "An AvailablePackage defines a package available for installation.",
"title": "AvailablePackage"
},
"v1alpha1AvailablePackagePackageRepositoryReference": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The fully qualified name of the package repository.",
"title": "Package repository name"
},
"namespace": {
"type": "string",
"description": "An optional namespace for namespaced package repositories.",
"title": "Package repository namespace"
}
},
"description": "A PackageRepository is identified by a fully qualified name and\noptionally a specific namespace.",
"title": "PackageRepositoryReference"
},
"v1alpha1GetAvailablePackagesResponse": {
"type": "object",
"example": {
Expand Down Expand Up @@ -422,6 +517,14 @@
"description": "Response for GetConfiguredPlugins",
"title": "GetConfiguredPluginsResponse"
},
"v1alpha1GetPackageMetaResponse": {
"type": "object",
"properties": {
"meta": {
"$ref": "#/definitions/GetPackageMetaResponsePackageMeta"
}
}
},
"v1alpha1GetPackageRepositoriesResponse": {
"type": "object",
"example": {
Expand All @@ -446,6 +549,31 @@
"description": "Response for GetPackageRepositories",
"title": "GetPackageRepositories"
},
"v1alpha1PackageReference": {
"type": "object",
"properties": {
"name": {
"type": "string",
"title": "required package name should be unique within the scope of specified repository, if specified"
},
"repository": {
"$ref": "#/definitions/v1alpha1PackageReferencePackageRepositoryReference",
"title": "An optional package repository reference where this package is located. Not\nall plugins may support this back reference (eg. kapp-controller)"
}
}
},
"v1alpha1PackageReferencePackageRepositoryReference": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"namespace": {
"type": "string"
}
},
"description": "A PackageRepository is identified by a fully qualified name and\noptionally a specific namespace."
},
"v1alpha1PackageRepository": {
"type": "object",
"example": {
Expand Down
2 changes: 1 addition & 1 deletion cmd/kubeapps-apis/gen/apidocs.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a6d2a17

Please sign in to comment.