Skip to content

Commit

Permalink
Update app cr define. (#5207)
Browse files Browse the repository at this point in the history
* Update app menu types.

Signed-off-by: zzjin <[email protected]>

* rebase code.

Signed-off-by: zzjin <[email protected]>

* Fix typo.

Signed-off-by: zzjin <[email protected]>

* Update template cr design.

Signed-off-by: zzjin <[email protected]>

---------

Signed-off-by: zzjin <[email protected]>
  • Loading branch information
zzjin authored Nov 19, 2024
1 parent b8dbdf5 commit 58830b1
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 14 deletions.
35 changes: 23 additions & 12 deletions controllers/app/api/v1/template_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

type I18nData struct {
Title string `json:"title,omitempty"`
URL string `json:"url,omitempty"`
GitRepo string `json:"gitRepo,omitempty"`
Description string `json:"description,omitempty"`
Readme string `json:"readme,omitempty"`
Icon string `json:"icon,omitempty"`
}

type TemplateType string

const (
Expand Down Expand Up @@ -57,18 +66,20 @@ type InputData struct {
type Inputs map[string]InputData

type TemplateData struct {
Title string `json:"title"`
URL string `json:"url,omitempty"`
GitRepo string `json:"gitRepo,omitempty"`
Author string `json:"author,omitempty"`
Description string `json:"description,omitempty"`
Readme string `json:"readme,omitempty"`
Icon string `json:"icon,omitempty"`
TemplateType TemplateType `json:"templateType"`
Draft bool `json:"draft,omitempty"`
Categories []string `json:"categories,omitempty"`
Defaults Defaults `json:"defaults,omitempty"`
Inputs Inputs `json:"inputs,omitempty"`
Title string `json:"title"`
URL string `json:"url,omitempty"`
GitRepo string `json:"gitRepo,omitempty"`
Author string `json:"author,omitempty"`
Description string `json:"description,omitempty"`
Readme string `json:"readme,omitempty"`
Icon string `json:"icon,omitempty"`
TemplateType TemplateType `json:"templateType"`
Locale string `json:"locale,omitempty"`
I18n map[string]I18nData `json:"i18n,omitempty"`
Draft bool `json:"draft,omitempty"`
Categories []string `json:"categories,omitempty"`
Defaults Defaults `json:"defaults,omitempty"`
Inputs Inputs `json:"inputs,omitempty"`
}

// TemplateSpec defines the desired state of Template
Expand Down
22 changes: 22 additions & 0 deletions controllers/app/api/v1/zz_generated.deepcopy.go

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

21 changes: 20 additions & 1 deletion controllers/app/config/crd/bases/app.sealos.io_instances.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright © 2023 sealos.
# Copyright © 2024 sealos.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -72,6 +72,23 @@ spec:
type: boolean
gitRepo:
type: string
i18n:
additionalProperties:
properties:
description:
type: string
gitRepo:
type: string
icon:
type: string
readme:
type: string
title:
type: string
url:
type: string
type: object
type: object
icon:
type: string
inputs:
Expand All @@ -89,6 +106,8 @@ spec:
- type
type: object
type: object
locale:
type: string
readme:
type: string
templateType:
Expand Down
21 changes: 20 additions & 1 deletion controllers/app/config/crd/bases/app.sealos.io_templates.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright © 2023 sealos.
# Copyright © 2024 sealos.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -72,6 +72,23 @@ spec:
type: boolean
gitRepo:
type: string
i18n:
additionalProperties:
properties:
description:
type: string
gitRepo:
type: string
icon:
type: string
readme:
type: string
title:
type: string
url:
type: string
type: object
type: object
icon:
type: string
inputs:
Expand All @@ -89,6 +106,8 @@ spec:
- type
type: object
type: object
locale:
type: string
readme:
type: string
templateType:
Expand Down

0 comments on commit 58830b1

Please sign in to comment.