Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/dashboard/stylelint-…
Browse files Browse the repository at this point in the history
…15.11.0
  • Loading branch information
antgamdia authored Dec 12, 2023
2 parents ff5e629 + 63e490f commit 6ce9482
Show file tree
Hide file tree
Showing 47 changed files with 1,195 additions and 690 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: 1.19
if: ${{ matrix.language == 'go' }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/kubeapps-general.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ env.GOLANG_VERSION }}
- name: Run go unit tests
Expand Down Expand Up @@ -245,7 +245,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GOLANG_VERSION }}
- name: "Install helm (minimum and stable)"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
golang-linter:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ inputs.golang_version }}
- uses: actions/checkout@v4
Expand All @@ -41,7 +41,7 @@ jobs:
license-headers-linter:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ inputs.golang_version }}
- uses: actions/checkout@v4
Expand Down
8 changes: 4 additions & 4 deletions chart/kubeapps/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
dependencies:
- name: redis
repository: oci://registry-1.docker.io/bitnamicharts
version: 18.2.1
version: 18.4.0
- name: postgresql
repository: oci://registry-1.docker.io/bitnamicharts
version: 13.2.2
version: 13.2.14
- name: common
repository: oci://registry-1.docker.io/bitnamicharts
version: 2.13.3
digest: sha256:b793bccb71592d2ce5c7ec037e1adf9d8cf066f18c94bedb96b54cc8fbc8ff5f
generated: "2023-11-08T15:24:41.447670912Z"
digest: sha256:7bede05a463745ea72d332aaaf406d84e335d8af09dce403736f4e4e14c3554d
generated: "2023-11-21T18:18:20.024990735Z"
12 changes: 6 additions & 6 deletions chart/kubeapps/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ annotations:
licenses: Apache-2.0
images: |
- name: kubeapps-apis
image: docker.io/bitnami/kubeapps-apis:2.9.0-debian-11-r12
image: docker.io/bitnami/kubeapps-apis:2.9.0-debian-11-r13
- name: kubeapps-apprepository-controller
image: docker.io/bitnami/kubeapps-apprepository-controller:2.9.0-debian-11-r11
image: docker.io/bitnami/kubeapps-apprepository-controller:2.9.0-debian-11-r12
- name: kubeapps-asset-syncer
image: docker.io/bitnami/kubeapps-asset-syncer:2.9.0-debian-11-r12
image: docker.io/bitnami/kubeapps-asset-syncer:2.9.0-debian-11-r13
- name: kubeapps-oci-catalog
image: docker.io/bitnami/kubeapps-oci-catalog:2.9.0-debian-11-r6
- name: kubeapps-pinniped-proxy
image: docker.io/bitnami/kubeapps-pinniped-proxy:2.9.0-debian-11-r10
- name: kubeapps-dashboard
image: docker.io/bitnami/kubeapps-dashboard:2.9.0-debian-11-r16
- name: nginx
image: docker.io/bitnami/nginx:1.25.3-debian-11-r0
image: docker.io/bitnami/nginx:1.25.3-debian-11-r1
- name: oauth2-proxy
image: docker.io/bitnami/oauth2-proxy:7.5.1-debian-11-r10
image: docker.io/bitnami/oauth2-proxy:7.5.1-debian-11-r11
apiVersion: v2
appVersion: DEVEL
dependencies:
Expand Down Expand Up @@ -52,4 +52,4 @@ maintainers:
name: kubeapps
sources:
- https://github.com/bitnami/charts/tree/main/bitnami/kubeapps
version: 14.1.2-dev
version: 14.1.3-dev
14 changes: 6 additions & 8 deletions chart/kubeapps/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<!--- app-name: Kubeapps -->

# Kubeapps packaged by Bitnami
# Bitnami package for Kubeapps

Kubeapps is a web-based UI for launching and managing applications on Kubernetes. It allows users to deploy trusted applications and operators to control users access to the cluster.

Expand All @@ -9,12 +7,14 @@ Kubeapps is a web-based UI for launching and managing applications on Kubernetes
## TL;DR

```console
helm install my-release oci://REGISTRY_NAME/REPOSITORY_NAME/kubeapps --namespace kubeapps --create-namespace
helm install my-release oci://registry-1.docker.io/bitnamicharts/kubeapps --namespace kubeapps --create-namespace
```

> Note: You need to substitute the placeholders `REGISTRY_NAME` and `REPOSITORY_NAME` with a reference to your Helm chart registry and repository. For example, in the case of Bitnami, you need to use `REGISTRY_NAME=registry-1.docker.io` and `REPOSITORY_NAME=bitnamicharts`.
> Check out the [getting started](https://github.com/vmware-tanzu/kubeapps/blob/main/site/content/docs/latest/tutorials/getting-started.md) to start deploying apps with Kubeapps.
Looking to use Kubeapps in production? Try [VMware Tanzu Application Catalog](https://bitnami.com/enterprise), the enterprise edition of Bitnami Application Catalog.

## Introduction

This chart bootstraps a [Kubeapps](https://kubeapps.dev) deployment on a [Kubernetes](https://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
Expand All @@ -32,8 +32,6 @@ With Kubeapps you can:

It also packages the [Bitnami PostgreSQL chart](https://github.com/bitnami/charts/tree/main/bitnami/postgresql), which is required for bootstrapping a deployment for the database requirements of the Kubeapps application.

Looking to use Kubeapps in production? Try [VMware Tanzu Application Catalog](https://bitnami.com/enterprise), the enterprise edition of Bitnami Application Catalog.

## Prerequisites

- Kubernetes 1.23+
Expand Down Expand Up @@ -654,7 +652,7 @@ helm install kubeapps --namespace kubeapps -f custom-values.yaml oci://REGISTRY_

### Configuring Initial Repositories

By default, Kubeapps will track the [Bitnami Application Catalog](https://github.com/bitnami/charts). To change these defaults, override with your desired parameters the `apprepository.initialRepos` object present in the [values.yaml](values.yaml) file.
By default, Kubeapps will track the [Bitnami Application Catalog](https://github.com/bitnami/charts). To change these defaults, override with your desired parameters the `apprepository.initialRepos` object present in the [values.yaml](https://github.com/bitnami/charts/tree/main/bitnami/kubeapps/values.yaml) file.

### Enabling Operators

Expand Down Expand Up @@ -1145,4 +1143,4 @@ Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
4 changes: 2 additions & 2 deletions chart/kubeapps/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ frontend:
image:
registry: docker.io
repository: bitnami/nginx
tag: 1.25.3-debian-11-r0
tag: 1.25.3-debian-11-r1
digest: ""
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
Expand Down Expand Up @@ -1181,7 +1181,7 @@ authProxy:
image:
registry: docker.io
repository: bitnami/oauth2-proxy
tag: 7.5.1-debian-11-r10
tag: 7.5.1-debian-11-r11
digest: ""
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
Expand Down
24 changes: 23 additions & 1 deletion cmd/kubeapps-apis/core/packages/v1alpha1/packages.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,29 @@ func (s packagesServer) DeleteInstalledPackage(ctx context.Context, request *con
}

func (s packagesServer) GetAvailablePackageMetadatas(ctx context.Context, request *connect.Request[packages.GetAvailablePackageMetadatasRequest]) (*connect.Response[packages.GetAvailablePackageMetadatasResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, fmt.Errorf("Unimplemented"))
log.InfoS("+core GetAvailablePackageVersions", "cluster", request.Msg.GetAvailablePackageRef().GetContext().GetCluster(), "namespace", request.Msg.GetAvailablePackageRef().GetContext().GetNamespace())

if request.Msg.GetAvailablePackageRef().GetPlugin() == nil {
return nil, connect.NewError(connect.CodeInvalidArgument, fmt.Errorf("Unable to retrieve the plugin (missing AvailablePackageRef.Plugin)"))
}

// Retrieve the plugin with server matching the requested plugin name
pluginWithServer := s.getPluginWithServer(request.Msg.AvailablePackageRef.Plugin)
if pluginWithServer == nil {
return nil, connect.NewError(connect.CodeInternal, fmt.Errorf("Unable to get the plugin %v", request.Msg.AvailablePackageRef.Plugin))
}

// Get the response from the requested plugin
ctxForPlugin := updateContextWithAuthz(ctx, request.Header())
response, err := pluginWithServer.server.GetAvailablePackageMetadatas(ctxForPlugin, request)
if err != nil {
return nil, connect.NewError(connect.CodeOf(err), fmt.Errorf("Unable to get the available package metadatas for the package %q using the plugin %q: %w", request.Msg.AvailablePackageRef.Identifier, request.Msg.AvailablePackageRef.Plugin.Name, err))
}

// Build the response
return connect.NewResponse(&packages.GetAvailablePackageMetadatasResponse{
PackageMetadata: response.Msg.PackageMetadata,
}), nil
}

// getPluginWithServer returns the *pkgPluginsWithServer from a given packagesServer
Expand Down
78 changes: 78 additions & 0 deletions cmd/kubeapps-apis/core/packages/v1alpha1/packages_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ var ignoreUnexportedOpts = cmpopts.IgnoreUnexported(
corev1.AvailablePackageSummary{},
corev1.Context{},
corev1.GetAvailablePackageDetailResponse{},
corev1.GetAvailablePackageMetadatasResponse{},
corev1.GetAvailablePackageSummariesResponse{},
corev1.GetAvailablePackageVersionsResponse{},
corev1.GetInstalledPackageResourceRefsResponse{},
Expand All @@ -43,6 +44,7 @@ var ignoreUnexportedOpts = cmpopts.IgnoreUnexported(
corev1.InstalledPackageSummary{},
corev1.Maintainer{},
corev1.PackageAppVersion{},
corev1.PackageMetadata{},
corev1.VersionReference{},
corev1.ResourceRef{},
plugins.Plugin{},
Expand All @@ -57,6 +59,9 @@ func makeDefaultTestPackagingPlugin(pluginName string) pkgPluginWithServer {
plugin_test.MakeAvailablePackageSummary("pkg-2", pluginDetails),
}
packagingPluginServer.AvailablePackageDetail = plugin_test.MakeAvailablePackageDetail("pkg-1", pluginDetails)
packagingPluginServer.AvailablePackageMetadatas = []*corev1.PackageMetadata{
plugin_test.MakeAvailablePackageMetadata("media-type-1", "name-1", "description-1", "oci://location-1"),
}
packagingPluginServer.InstalledPackageSummaries = []*corev1.InstalledPackageSummary{
plugin_test.MakeInstalledPackageSummary("pkg-1", pluginDetails),
plugin_test.MakeInstalledPackageSummary("pkg-2", pluginDetails),
Expand Down Expand Up @@ -373,6 +378,79 @@ func TestGetAvailablePackageDetail(t *testing.T) {
}
}

func TestGetAvailablePackageMetadatas(t *testing.T) {
testCases := []struct {
name string
configuredPlugins []pkgPluginWithServer
errorCode connect.Code
request *corev1.GetAvailablePackageMetadatasRequest
expectedResponse *corev1.GetAvailablePackageMetadatasResponse
}{
{
name: "it should successfully call the core GetAvailablePackageMetadatas operation",
configuredPlugins: []pkgPluginWithServer{
mockedPackagingPlugin1,
},
request: &corev1.GetAvailablePackageMetadatasRequest{
AvailablePackageRef: &corev1.AvailablePackageReference{
Context: &corev1.Context{
Cluster: "",
Namespace: globalPackagingNamespace,
},
Identifier: "pkg-1",
Plugin: mockedPackagingPlugin1.plugin,
},
PkgVersion: "1.0",
},

expectedResponse: &corev1.GetAvailablePackageMetadatasResponse{
PackageMetadata: []*corev1.PackageMetadata{
plugin_test.MakeAvailablePackageMetadata("media-type-1", "name-1", "description-1", "oci://location-1"),
},
},
},
{
name: "it should fail when calling the core GetAvailablePackageMetadatas operation when the package is not present in a plugin",
configuredPlugins: []pkgPluginWithServer{
mockedNotFoundPackagingPlugin,
},
request: &corev1.GetAvailablePackageMetadatasRequest{
AvailablePackageRef: &corev1.AvailablePackageReference{
Context: &corev1.Context{
Cluster: "",
Namespace: globalPackagingNamespace,
},
Identifier: "pkg-1",
Plugin: mockedNotFoundPackagingPlugin.plugin,
},
PkgVersion: "",
},

expectedResponse: &corev1.GetAvailablePackageMetadatasResponse{},
errorCode: connect.CodeNotFound,
},
}

for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
server := &packagesServer{
pluginsWithServers: tc.configuredPlugins,
}
availablePackageDetail, err := server.GetAvailablePackageMetadatas(context.Background(), connect.NewRequest(tc.request))

if got, want := connect.CodeOf(err), tc.errorCode; err != nil && got != want {
t.Fatalf("got: %+v, want: %+v, err: %+v", got, want, err)
}

if tc.errorCode == 0 {
if got, want := availablePackageDetail.Msg, tc.expectedResponse; !cmp.Equal(got, want, ignoreUnexportedOpts) {
t.Errorf("mismatch (-want +got):\n%s", cmp.Diff(want, got, ignoreUnexportedOpts))
}
}
})
}
}

func TestGetInstalledPackageSummaries(t *testing.T) {
testCases := []struct {
name string
Expand Down
10 changes: 10 additions & 0 deletions cmd/kubeapps-apis/docs/kubeapps-apis.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -5453,6 +5453,16 @@
"description": "Media type of this metadata",
"title": "Media type"
},
"artifactType": {
"type": "string",
"description": "Artifact type of this metadata",
"title": "Artifact type"
},
"digest": {
"type": "string",
"description": "Digest of this metadata",
"title": "Digest"
},
"name": {
"type": "string",
"description": "Human readable name for this metadata.",
Expand Down
Loading

0 comments on commit 6ce9482

Please sign in to comment.