From 37718a095da550f285bfbccb94fd2cd515af23c0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 14 Apr 2023 17:19:20 +0800 Subject: [PATCH] Feat: add new fields for addon metadata (#5857) Signed-off-by: Jianbo Sun (cherry picked from commit ed2cf3c742290f0dd6cc3105d81ee4be15faeafc) Co-authored-by: Jianbo Sun --- pkg/addon/type.go | 16 ++++++++++------ pkg/utils/common/common.go | 12 ++++++------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/pkg/addon/type.go b/pkg/addon/type.go index e14d8cc5b..faa49b8ea 100644 --- a/pkg/addon/type.go +++ b/pkg/addon/type.go @@ -83,17 +83,21 @@ type WholeAddonPackage struct { // Meta defines the format for a single addon type Meta struct { - Name string `json:"name" validate:"required"` - Version string `json:"version"` - Description string `json:"description"` - Icon string `json:"icon"` - URL string `json:"url,omitempty"` - Tags []string `json:"tags,omitempty"` + Name string `json:"name" validate:"required"` + Version string `json:"version"` + Description string `json:"description"` + Icon string `json:"icon"` + URL string `json:"url,omitempty"` + Tags []string `json:"tags,omitempty"` + // UXPlugins used for velaux plugins download/install with the use of addon registry. + UXPlugins map[string]string `json:"uxPlugins,omitempty"` DeployTo *DeployTo `json:"deployTo,omitempty"` Dependencies []*Dependency `json:"dependencies,omitempty"` NeedNamespace []string `json:"needNamespace,omitempty"` Invisible bool `json:"invisible"` SystemRequirements *SystemRequirements `json:"system,omitempty"` + // Annotations used for addon maintainers to add their own description or extensions to metadata. + Annotations map[string]string `json:"annotations,omitempty"` } // DeployTo defines where the addon to deploy to diff --git a/pkg/utils/common/common.go b/pkg/utils/common/common.go index 460aa63fe..ff82d4ee6 100644 --- a/pkg/utils/common/common.go +++ b/pkg/utils/common/common.go @@ -126,12 +126,12 @@ func init() { // HTTPOption define the https options type HTTPOption struct { - Username string - Password string - CaFile string - CertFile string - KeyFile string - InsecureSkipTLS bool + Username string `json:"username,omitempty"` + Password string `json:"password,omitempty"` + CaFile string `json:"caFile,omitempty"` + CertFile string `json:"certFile,omitempty"` + KeyFile string `json:"keyFile,omitempty"` + InsecureSkipTLS bool `json:"insecureSkipTLS,omitempty"` } // InitBaseRestConfig will return reset config for create controller runtime client