Skip to content
Open
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Cyclops can either be installed manually by applying the latest manifest, by usi
To install Cyclops using `kubectl` into your cluster, run the commands below:

```bash
kubectl apply -f https://raw.githubusercontent.com/cyclops-ui/cyclops/v0.21.0/install/cyclops-install.yaml && kubectl apply -f https://raw.githubusercontent.com/cyclops-ui/cyclops/v0.21.0/install/demo-templates.yaml
kubectl apply -f https://raw.githubusercontent.com/cyclops-ui/cyclops/v0.21.1/install/cyclops-install.yaml && kubectl apply -f https://raw.githubusercontent.com/cyclops-ui/cyclops/v0.21.1/install/demo-templates.yaml
```

It will create a new namespace called `cyclops` and deploy everything you need for your Cyclops instance to run.
Expand Down
10 changes: 7 additions & 3 deletions cyclops-ctrl/api/v1alpha1/module_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ const (
TemplateSourceTypeHelm TemplateSourceType = "helm"
TemplateSourceTypeOCI TemplateSourceType = "oci"

GitOpsWriteRepoAnnotation = "cyclops-ui.com/write-repo"
GitOpsWritePathAnnotation = "cyclops-ui.com/write-path"
GitOpsWriteRevisionAnnotation = "cyclops-ui.com/write-revision"
GitOpsWriteRepoAnnotation = "cyclops-ui.com/write-repo"
GitOpsWritePathAnnotation = "cyclops-ui.com/write-path"
GitOpsWriteRevisionAnnotation = "cyclops-ui.com/write-revision"
GitOpsWriteResourcesAnnotation = "cyclops-ui.com/write-child-resources"

ModuleManagerLabel = "cyclops-ui.com/module-manager"

Expand All @@ -60,6 +61,9 @@ type GitOpsWriteDestination struct {
Repo string `json:"repo"`
Path string `json:"path"`
Version string `json:"version"`

// +kubebuilder:validation:Optional
WriteResources bool `json:"writeResources"`
}

type TemplateRef struct {
Expand Down
1 change: 1 addition & 0 deletions cyclops-ctrl/cmd/main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ func main() {
mgr.GetScheme(),
templatesRepo,
k8sClient,
gitWriteClient,
renderer,
getMaxConcurrentReconciles(),
telemetryClient,
Expand Down
2 changes: 2 additions & 0 deletions cyclops-ctrl/config/crd/bases/cyclops-ui.com_modules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ spec:
type: string
version:
type: string
writeResources:
type: boolean
required:
- path
- repo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ spec:
type: string
version:
type: string
writeResources:
type: boolean
required:
- path
- repo
Expand Down
5 changes: 2 additions & 3 deletions cyclops-ctrl/internal/controller/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,11 @@ func (m *Modules) CreateModule(ctx *gin.Context) {
m.telemetryClient.ModuleCreation()

if module.GetAnnotations() != nil && len(module.GetAnnotations()[v1alpha1.GitOpsWriteRepoAnnotation]) != 0 {
err := m.gitWriteClient.Write(module)
err := m.gitWriteClient.WriteModule(module)
if err != nil {
fmt.Println(err)
ctx.JSON(http.StatusInternalServerError, dto.NewError("Error pushing to git", err.Error()))
}
return
}

err = m.kubernetesClient.CreateModule(module)
Expand Down Expand Up @@ -400,7 +399,7 @@ func (m *Modules) UpdateModule(ctx *gin.Context) {
module.SetAnnotations(annotations)

if len(module.GetAnnotations()[v1alpha1.GitOpsWriteRepoAnnotation]) != 0 {
err := m.gitWriteClient.Write(module)
err := m.gitWriteClient.WriteModule(module)
if err != nil {
fmt.Println(err)
ctx.JSON(http.StatusInternalServerError, dto.NewError("Error pushing to git", err.Error()))
Expand Down
Loading