From 078dca33b8abc64f5da0f32921d7d7fddb085c81 Mon Sep 17 00:00:00 2001 From: Yajith Dayarathna Date: Thu, 12 Jun 2025 13:39:15 +1200 Subject: [PATCH 1/3] fix(api-documentation): swagger document genration error (#794) --- api/http/handler/kubernetes/event.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/http/handler/kubernetes/event.go b/api/http/handler/kubernetes/event.go index 0e226d5ec..25f024303 100644 --- a/api/http/handler/kubernetes/event.go +++ b/api/http/handler/kubernetes/event.go @@ -20,7 +20,7 @@ import ( // @param id path int true "Environment identifier" // @param namespace path string true "The namespace name the events are associated to" // @param resourceId query string false "The resource id of the involved kubernetes object" example:"e5b021b6-4bce-4c06-bd3b-6cca906797aa" -// @success 200 {object} models.Event[] "Success" +// @success 200 {object} []kubernetes.K8sEvent "Success" // @failure 400 "Invalid request payload, such as missing required fields or fields not meeting validation criteria." // @failure 401 "Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions." // @failure 403 "Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions." @@ -68,7 +68,7 @@ func (handler *Handler) getKubernetesEventsForNamespace(w http.ResponseWriter, r // @produce json // @param id path int true "Environment identifier" // @param resourceId query string false "The resource id of the involved kubernetes object" example:"e5b021b6-4bce-4c06-bd3b-6cca906797aa" -// @success 200 {object} models.Event[] "Success" +// @success 200 {object} []kubernetes.K8sEvent "Success" // @failure 400 "Invalid request payload, such as missing required fields or fields not meeting validation criteria." // @failure 401 "Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions." // @failure 403 "Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions." From 4b5b682d0cf97a5256680f8fea6d0e101c5c3f75 Mon Sep 17 00:00:00 2001 From: James Player Date: Wed, 18 Jun 2025 09:06:58 +1200 Subject: [PATCH 2/3] feat(k8s): CRD in applications list and details 2.31.1 - [R8S-357] (#806) Co-authored-by: stevensbkang --- api/http/models/kubernetes/application.go | 26 +++++++++++++++---- .../components/ViewLoading/ViewLoading.tsx | 10 +------ 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/api/http/models/kubernetes/application.go b/api/http/models/kubernetes/application.go index fcb49b23d..4759d9214 100644 --- a/api/http/models/kubernetes/application.go +++ b/api/http/models/kubernetes/application.go @@ -38,14 +38,30 @@ type K8sApplication struct { Labels map[string]string `json:"Labels,omitempty"` Resource K8sApplicationResource `json:"Resource,omitempty"` HorizontalPodAutoscaler *autoscalingv2.HorizontalPodAutoscaler `json:"HorizontalPodAutoscaler,omitempty"` + CustomResourceMetadata CustomResourceMetadata `json:"CustomResourceMetadata,omitempty"` } type Metadata struct { Labels map[string]string `json:"labels"` } +type CustomResourceMetadata struct { + Kind string `json:"kind"` + APIVersion string `json:"apiVersion"` + Plural string `json:"plural"` +} + type Pod struct { - Status string `json:"Status"` + Name string `json:"Name"` + ContainerName string `json:"ContainerName"` + Image string `json:"Image"` + ImagePullPolicy string `json:"ImagePullPolicy"` + Status string `json:"Status"` + NodeName string `json:"NodeName"` + PodIP string `json:"PodIP"` + UID string `json:"Uid"` + Resource K8sApplicationResource `json:"Resource,omitempty"` + CreationDate time.Time `json:"CreationDate"` } type Configuration struct { @@ -72,8 +88,8 @@ type TLSInfo struct { // Existing types type K8sApplicationResource struct { - CPURequest float64 `json:"CpuRequest"` - CPULimit float64 `json:"CpuLimit"` - MemoryRequest int64 `json:"MemoryRequest"` - MemoryLimit int64 `json:"MemoryLimit"` + CPURequest float64 `json:"CpuRequest,omitempty"` + CPULimit float64 `json:"CpuLimit,omitempty"` + MemoryRequest int64 `json:"MemoryRequest,omitempty"` + MemoryLimit int64 `json:"MemoryLimit,omitempty"` } diff --git a/app/react/components/ViewLoading/ViewLoading.tsx b/app/react/components/ViewLoading/ViewLoading.tsx index 5ade961bb..139c67637 100644 --- a/app/react/components/ViewLoading/ViewLoading.tsx +++ b/app/react/components/ViewLoading/ViewLoading.tsx @@ -1,7 +1,4 @@ import clsx from 'clsx'; -import { Settings } from 'lucide-react'; - -import { Icon } from '@@/Icon'; import styles from './ViewLoading.module.css'; @@ -18,12 +15,7 @@ export function ViewLoading({ message }: Props) {
- {message && ( - - {message} - - - )} + {message && {message}}
); } From 3019e8ec11b6e0158d1c410a28560be13e7c2c59 Mon Sep 17 00:00:00 2001 From: Malcolm Lockyer Date: Thu, 19 Jun 2025 11:15:00 +1200 Subject: [PATCH 3/3] chore: bump version to 2.31.1 (#815) --- api/datastore/test_data/output_24_to_latest.json | 4 ++-- api/http/handler/handler.go | 2 +- api/portainer.go | 2 +- package.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/datastore/test_data/output_24_to_latest.json b/api/datastore/test_data/output_24_to_latest.json index 41a1b49df..14f350d8b 100644 --- a/api/datastore/test_data/output_24_to_latest.json +++ b/api/datastore/test_data/output_24_to_latest.json @@ -611,7 +611,7 @@ "RequiredPasswordLength": 12 }, "KubeconfigExpiry": "0", - "KubectlShellImage": "portainer/kubectl-shell:2.31.0", + "KubectlShellImage": "portainer/kubectl-shell:2.31.1", "LDAPSettings": { "AnonymousMode": true, "AutoCreateUsers": true, @@ -939,7 +939,7 @@ } ], "version": { - "VERSION": "{\"SchemaVersion\":\"2.31.0\",\"MigratorCount\":1,\"Edition\":1,\"InstanceID\":\"463d5c47-0ea5-4aca-85b1-405ceefee254\"}" + "VERSION": "{\"SchemaVersion\":\"2.31.1\",\"MigratorCount\":0,\"Edition\":1,\"InstanceID\":\"463d5c47-0ea5-4aca-85b1-405ceefee254\"}" }, "webhooks": null } \ No newline at end of file diff --git a/api/http/handler/handler.go b/api/http/handler/handler.go index 1ae55a002..b5d65dfde 100644 --- a/api/http/handler/handler.go +++ b/api/http/handler/handler.go @@ -81,7 +81,7 @@ type Handler struct { } // @title PortainerCE API -// @version 2.31.0 +// @version 2.31.1 // @description.markdown api-description.md // @termsOfService diff --git a/api/portainer.go b/api/portainer.go index b3b917a08..63db60868 100644 --- a/api/portainer.go +++ b/api/portainer.go @@ -1728,7 +1728,7 @@ type ( const ( // APIVersion is the version number of the Portainer API - APIVersion = "2.31.0" + APIVersion = "2.31.1" // Support annotation for the API version ("STS" for Short-Term Support or "LTS" for Long-Term Support) APIVersionSupport = "STS" // Edition is what this edition of Portainer is called diff --git a/package.json b/package.json index d9c180698..ca537c1c8 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Portainer.io", "name": "portainer", "homepage": "http://portainer.io", - "version": "2.31.0", + "version": "2.31.1", "repository": { "type": "git", "url": "git@github.com:portainer/portainer.git"