Skip to content

Commit

Permalink
do not sanitise component name to have a match
Browse files Browse the repository at this point in the history
  • Loading branch information
Maksym Trofimenko committed Dec 31, 2024
1 parent 18bc711 commit 3c98f11
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 9 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ envtest: $(ENVTEST) ## Download setup-envtest locally if necessary.
$(ENVTEST): $(LOCALBIN)
$(call go-install-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest,$(ENVTEST_VERSION))

.PHONY: generate-docs
generate-docs:
crd-ref-docs --source-path ./api --renderer=markdown --config=crd-api-doc-config.yaml --output-path=api-docs.md


.PHONY: golangci-lint
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
$(GOLANGCI_LINT): $(LOCALBIN)
Expand Down
24 changes: 22 additions & 2 deletions api-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,23 @@ _Appears in:_
| `status` _[TinyModuleStatus](#tinymodulestatus)_ | |


#### TinyModuleComponentStatus





_Appears in:_
- [TinyModuleStatus](#tinymodulestatus)

| Field | Description |
| --- | --- |
| `name` _string_ | |
| `description` _string_ | |
| `info` _string_ | |
| `tags` _string array_ | |


#### TinyModuleList


Expand Down Expand Up @@ -95,6 +112,9 @@ _Appears in:_
| Field | Description |
| --- | --- |
| `addr` _string_ | INSERT ADDITIONAL STATUS FIELD - define observed state of cluster<br /><br />Important: Run "make" to regenerate code after modifying this file |
| `name` _string_ | |
| `version` _string_ | |
| `components` _[TinyModuleComponentStatus](#tinymodulecomponentstatus) array_ | |


#### TinyNode
Expand Down Expand Up @@ -147,7 +167,7 @@ _Appears in:_
| `id` _string_ | Edge id |
| `port` _string_ | Current node's port name<br /><br />Source port |
| `to` _string_ | Other node's full port name |
| `extras` _object (keys:string, values:string)_ | |
| `flowID` _string_ | |


#### TinyNodeList
Expand Down Expand Up @@ -198,7 +218,7 @@ _Appears in:_
| `port` _string_ | |
| `schema` _[byte](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#byte-v1-meta) array_ | Schema JSON schema of the port |
| `configuration` _[byte](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#byte-v1-meta) array_ | Configuration JSON data of the port's configuration |
| `extras` _object (keys:string, values:string)_ | |
| `flowID` _string_ | |


#### TinyNodePortStatus
Expand Down
3 changes: 1 addition & 2 deletions internal/controller/tinymodule_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"context"
clientpool "github.com/tiny-systems/module/internal/client"
"github.com/tiny-systems/module/module"
"github.com/tiny-systems/module/pkg/utils"
"github.com/tiny-systems/module/registry"
"k8s.io/apimachinery/pkg/api/errors"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
Expand Down Expand Up @@ -83,7 +82,7 @@ func (r *TinyModuleReconciler) Reconcile(ctx context.Context, req ctrl.Request)
for i, cmp := range components {
info := cmp.GetInfo()
statusComponents[i] = operatorv1alpha1.TinyModuleComponentStatus{
Name: utils.SanitizeResourceName(info.Name),
Name: info.Name,
Description: info.Description,
Info: info.Info,
Tags: info.Tags,
Expand Down
5 changes: 0 additions & 5 deletions module/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package module

import (
"context"
"github.com/tiny-systems/module/pkg/utils"
)

type ComponentInfo struct {
Expand All @@ -12,10 +11,6 @@ type ComponentInfo struct {
Tags []string
}

func (c ComponentInfo) GetResourceName() string {
return utils.SanitizeResourceName(c.Name)
}

type Component interface {
GetInfo() ComponentInfo
//Handle handles incoming requests
Expand Down

0 comments on commit 3c98f11

Please sign in to comment.