Skip to content

Commit 635f218

Browse files
maksymlumenclaude
andcommitted
Add project description field to TinyProject CRD and export format
Adds Description string to TinyProjectSpec, updates CRD schema, bumps chart to 0.1.40, extends ProjectExport with description field, and adds UpdateProjectDescription to resource manager. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3cfd0be commit 635f218

File tree

7 files changed

+26
-8
lines changed

7 files changed

+26
-8
lines changed

api/v1alpha1/tinyproject_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ import (
2727
type TinyProjectSpec struct {
2828
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
2929
// Important: Run "make" to regenerate code after modifying this file
30+
31+
// Description is a markdown description of the project
32+
Description string `json:"description,omitempty"`
3033
}
3134

3235
// TinyProjectStatus defines the observed state of TinyProject

charts/tinysystems-crd/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type: application
1313
# This is the chart version. This version number should be incremented each time you make changes
1414
# to the chart and its templates, including the app version.
1515
# Versions are expected to follow Semantic Versioning (https://semver.org/)
16-
version: 0.1.39
16+
version: 0.1.40
1717
# This is the version number of the application being deployed. This version number should be
1818
# incremented each time you make changes to the application. Versions are not expected to
1919
# follow Semantic Versioning. They should reflect the version the application is using.

charts/tinysystems-crd/templates/tinyproject-crd.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ spec:
3939
type: object
4040
spec:
4141
description: TinyProjectSpec defines the desired state of TinyProject
42+
properties:
43+
description:
44+
type: string
4245
type: object
4346
status:
4447
description: TinyProjectStatus defines the observed state of TinyProject

config/crd/bases/operator.tinysystems.io_tinyprojects.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ spec:
3838
type: object
3939
spec:
4040
description: TinyProjectSpec defines the desired state of TinyProject
41+
properties:
42+
description:
43+
description: Description is a markdown description of the project
44+
type: string
4145
type: object
4246
status:
4347
description: TinyProjectStatus defines the observed state of TinyProject

config/rbac/role.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ rules:
4747
resources:
4848
- tinymodules
4949
- tinynodes
50-
- tinytrackers
5150
verbs:
5251
- create
5352
- delete
@@ -63,7 +62,6 @@ rules:
6362
- tinymodules/finalizers
6463
- tinynodes/finalizers
6564
- tinysignals/finalizers
66-
- tinytrackers/finalizers
6765
verbs:
6866
- update
6967
- apiGroups:
@@ -72,7 +70,6 @@ rules:
7270
- tinymodules/status
7371
- tinynodes/status
7472
- tinysignals/status
75-
- tinytrackers/status
7673
verbs:
7774
- get
7875
- patch

pkg/resource/manager.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,16 @@ func (m Manager) GetProject(ctx context.Context, name string, namespace string)
854854
return project, nil
855855
}
856856

857+
func (m Manager) UpdateProjectDescription(ctx context.Context, name string, namespace string, description string) error {
858+
project := &v1alpha1.TinyProject{}
859+
key := types.NamespacedName{Name: name, Namespace: namespace}
860+
if err := m.client.Get(ctx, key, project); err != nil {
861+
return err
862+
}
863+
project.Spec.Description = description
864+
return m.client.Update(ctx, project)
865+
}
866+
857867
func (m Manager) RenameProject(ctx context.Context, name string, namespace string, newName string) error {
858868

859869
project := &v1alpha1.TinyProject{}

pkg/utils/project_export.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ type ExportWidget struct {
3434

3535
// ProjectExport represents the full project export format
3636
type ProjectExport struct {
37-
Version int `json:"version"`
38-
TinyFlows []ExportFlow `json:"tinyFlows"`
39-
Elements []map[string]interface{} `json:"elements"`
40-
Pages []ExportPage `json:"pages"`
37+
Version int `json:"version"`
38+
Description string `json:"description,omitempty"`
39+
TinyFlows []ExportFlow `json:"tinyFlows"`
40+
Elements []map[string]interface{} `json:"elements"`
41+
Pages []ExportPage `json:"pages"`
4142
}
4243

4344
// CurrentExportVersion is the current version of the export format

0 commit comments

Comments
 (0)