Skip to content

Commit b4a62f2

Browse files
authored
Merge pull request #1196 from merico-dev/feat-helm
Feat: Add a New Plugin `helm-installer`
2 parents 9b026d8 + 32e3181 commit b4a62f2

42 files changed

Lines changed: 329 additions & 409 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ build-core: generate fmt lint vet mod-tidy ## Build dtm core only, without plugi
6464
.PHONY: build-plugin.%
6565
build-plugin.%: generate fmt lint vet mod-tidy ## Build one dtm plugin, like "make build-plugin.argocd".
6666
$(eval plugin_name := $(strip $*))
67-
@[ -d $(ROOT_DIR)/cmd/plugin/$(plugin_name) ] || { echo -e "\n${RED}✘ Plugin '$(plugin_name)' not found!${RESET} The valid plugin name is as follows (Eg. You can use ${YELLOW}make build-plugin.argocd${RESET} to build argocd plugin): \n\n$(shell ls ./cmd/plugin/)\n"; exit 1; }
67+
@[ -d $(ROOT_DIR)/cmd/plugin/$(plugin_name) ] || { echo -e "\n${RED}✘ Plugin '$(plugin_name)' not found!${RESET} The valid plugin name is as follows (Eg. You can use ${YELLOW}make build-plugin.argocdapp${RESET} to build argocdapp plugin): \n\n$(shell ls ./cmd/plugin/)\n"; exit 1; }
6868
@echo "$(YELLOW)Building plugin '$(plugin_name)'$(RESET)"
6969
${GO_PLUGIN_BUILD} -o ${PLUGINS_DIR}/${plugin_name}-${PLUGIN_SUFFIX}.so ${ROOT_DIR}/cmd/plugin/${plugin_name}
7070
@$(MAKE) md5-plugin.$(plugin_name)

cmd/plugin/helm-generic/main.go

Lines changed: 0 additions & 41 deletions
This file was deleted.
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,35 @@ package main
22

33
import (
44
"github.com/devstream-io/devstream/internal/pkg/configmanager"
5-
"github.com/devstream-io/devstream/internal/pkg/plugin/argocd"
5+
"github.com/devstream-io/devstream/internal/pkg/plugin/helminstaller"
66
"github.com/devstream-io/devstream/internal/pkg/statemanager"
77
"github.com/devstream-io/devstream/pkg/util/log"
88
)
99

1010
// NAME is the name of this DevStream plugin.
11-
const NAME = "argocd"
11+
const NAME = "helm-installer"
1212

1313
// Plugin is the type used by DevStream core. It's a string.
1414
type Plugin string
1515

16-
// Create implements the create of ArgoCD.
16+
// Create implements the create of helm-installer.
1717
func (p Plugin) Create(options configmanager.RawOptions) (statemanager.ResourceStatus, error) {
18-
return argocd.Create(options)
18+
return helminstaller.Create(options)
1919
}
2020

21-
// Update implements the update of ArgoCD.
21+
// Update implements the update of helm-installer.
2222
func (p Plugin) Update(options configmanager.RawOptions) (statemanager.ResourceStatus, error) {
23-
return argocd.Update(options)
23+
return helminstaller.Update(options)
2424
}
2525

26-
// Delete implements the delete of ArgoCD.
26+
// Delete implements the delete of helm-installer.
2727
func (p Plugin) Delete(options configmanager.RawOptions) (bool, error) {
28-
return argocd.Delete(options)
28+
return helminstaller.Delete(options)
2929
}
3030

31-
// Read implements the read of ArgoCD.
31+
// Read implements the read of helm-installer.
3232
func (p Plugin) Read(options configmanager.RawOptions) (statemanager.ResourceStatus, error) {
33-
return argocd.Read(options)
33+
return helminstaller.Read(options)
3434
}
3535

3636
// DevStreamPlugin is the exported variable used by the DevStream core.

docs/plugins/argocd.zh.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/plugins/helm-generic.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

docs/plugins/helm-generic.zh.md

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,26 @@
1-
# argocd Plugin
1+
# helm-installer plugin
22

3-
This plugin installs [ArgoCD](https://argoproj.github.io/cd/) in an existing Kubernetes cluster using the Helm chart.
3+
TODO(daniel-hutao): I'll update this the document after code refactoring finished.
44

55
## Usage
66

7-
The following content is an example of the "tool file".
8-
9-
For more information on the main config, the tool file and the var file of DevStream, see [Core Concepts Overview](../core-concepts/core-concepts.md#1-config) and [DevStream Configuration](../core-concepts/config.md).
10-
11-
```yaml
12-
--8<-- "argocd.yaml"
7+
``` yaml
8+
--8<-- "helm-installer.yaml"
139
```
1410

15-
### Default Configs
11+
### Argo CD
12+
13+
#### Default Configs
1614

1715
| key | default value | description |
1816
| ---------------- | ------------------------------------ | ------------------------------------------------ |
1917
| chart.chartPath | "" | local chart path |
2018
| chart.chartName | argo/argo-cd | chart name |
21-
| chart.timeout | 5m | this config will wait 5 minutes to deploy argocd |
19+
| chart.version | "" | chart version
20+
| chart.timeout | 5m | this config will wait 5 minutes to deploy Argo CD |
2221
| chart.upgradeCRDs | true | default update CRD config |
2322
| chart.releaseName | argocd | helm release name |
2423
| chart.namespace | argocd | namespace where helm to deploy |
2524
| chart.wait | true | whether to wait until installation is complete |
2625
| repo.url | https://argoproj.github.io/argo-helm | helm official repo address |
2726
| repo.name | argo | helm repo name |
28-
29-
Currently, except for `valuesYaml` and default configs, all the parameters in the example above are mandatory.

docs/plugins/helm-installer.zh.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# helm-installer 插件
2+
3+
TODO(daniel-hutao): I'll update this the document after code refactoring finished.
4+
## 用例
5+
6+
``` yaml
7+
--8<-- "helm-installer.yaml"
8+
```

docs/plugins/plugins-list.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@
1919
| CI | ci-generic | Generic CI plugin | [doc](ci-generic.md) |
2020
| CI | tekton | Tekton CI installation | [doc](tekton.md) |
2121
| Code Quality/Security | sonarqube | SonarQube | [doc](sonarqube.md)
22-
| CD/GitOps | argocd | ArgoCD installation | [doc](argocd.md) |
2322
| CD/GitOps | argocdapp | ArgoCD Application creation | [doc](argocdapp.md) |
2423
| Image Repository | artifactory | Artifactory installation | [doc](artifactory.md) |
2524
| Image Repository | harbor | Harbor helm installation | [doc](harbor.md) |
2625
| Image Repository | harbor-docker | Harbor Docker compose install | [doc](harbor-docker.md) |
27-
| Deployment | helm-generic | Helm chart install | [doc](helm-generic.md) |
26+
| Deployment | helm-installer | Helm chart install | [doc](helm-installer.md) |
2827
| Monitoring | kube-prometheus | Prometheus/Grafana K8s install | [doc](kube-prometheus.md) |
2928
| Observability | devlake | DevLake installation | [doc](devlake.md) |
3029
| LDAP | openldap | OpenLDAP installation | [doc](openldap.md) |
@@ -34,7 +33,6 @@ Or, to get a list of plugins, run:
3433

3534
```shell
3635
$ dtm list plugins
37-
argocd
3836
argocdapp
3937
artifactory
4038
ci-generic

internal/pkg/develop/plugin/template/create.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ var createGoDirTpl = "internal/pkg/plugin/[[ .Name | dirFormat ]]/"
55
var createGoContentTpl = `package [[ .Name | format ]]
66
77
import (
8+
"github.com/devstream-io/devstream/internal/pkg/configmanager"
89
"github.com/devstream-io/devstream/internal/pkg/plugininstaller"
910
"github.com/devstream-io/devstream/internal/pkg/statemanager"
1011
"github.com/devstream-io/devstream/pkg/util/log"

0 commit comments

Comments
 (0)