Skip to content

Commit

Permalink
Merge pull request #373 from kube-tarian/feature/tekton_ui_kubiz_lb
Browse files Browse the repository at this point in the history
tekton version change with launch ui
  • Loading branch information
vramk23 authored Jan 16, 2024
2 parents 6c95197 + ce95069 commit a806a2c
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 9 deletions.
3 changes: 0 additions & 3 deletions capten/agent/internal/crossplane/package_providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,6 @@ func (h *ProvidersSyncHandler) updateCrossplaneProvider(k8sProviders []model.Pro
ProviderName: dbProvider.ProviderName,
}

v, _ := json.Marshal(provider)
fmt.Println("Provider ===>" + string(v))

if err := h.dbStore.UpdateCrossplaneProvider(&provider); err != nil {
h.log.Errorf("failed to update provider %s details in db, %v", k8sProvider.Name, err)
continue
Expand Down
29 changes: 26 additions & 3 deletions capten/config-worker/internal/crossplane/config_cluster_updates.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import (
"fmt"
"os"
"path/filepath"
"strings"

"github.com/intelops/go-common/logging"
"github.com/kube-tarian/kad/capten/common-pkg/credential"
"github.com/kube-tarian/kad/capten/common-pkg/k8s"
fileutil "github.com/kube-tarian/kad/capten/config-worker/internal/file_util"
"github.com/kube-tarian/kad/capten/model"
Expand Down Expand Up @@ -79,7 +81,11 @@ func (cp *CrossPlaneApp) configureClusterUpdate(ctx context.Context, req *model.
return string(agentmodel.WorkFlowStatusFailed), errors.WithMessage(err, "failed to sync default app value files")
}

templateValues := cp.prepareTemplateVaules(req.ManagedClusterName)
templateValues, err := cp.prepareTemplateVaules(ctx, req.ManagedClusterName)
if err != nil {
return string(agentmodel.WorkFlowStatusFailed), errors.WithMessage(err, "failed to prepare template values")
}

if err := fileutil.UpdateFilesInFolderWithTempaltes(clusterDefaultAppValPath, templateValues); err != nil {
return string(agentmodel.WorkFlowStatusFailed), errors.WithMessage(err, "failed to update default app template values")
}
Expand Down Expand Up @@ -279,12 +285,29 @@ func removeClusterValues(valuesFileName, clusterName string) error {
return err
}

func (cp *CrossPlaneApp) prepareTemplateVaules(clusterName string) map[string]string {
func (cp *CrossPlaneApp) prepareTemplateVaules(ctx context.Context, clusterName string) (map[string]string, error) {
val := map[string]string{
"DomainName": cp.cfg.DomainName,
"ClusterName": clusterName,
}
return val

cred, err := credential.GetClusterGlobalValues(ctx)
if err != nil {
return nil, err
}

var gvMap map[string]interface{}

decoder := yaml.NewDecoder(strings.NewReader(cred))
if err := decoder.Decode(&gvMap); err != nil {
return nil, err
}

for key, value := range gvMap {
val[key] = value.(string)
}

return val, nil
}

func prepareClusterData(clusterName, endpoint string, defaultApps []DefaultApps) Cluster {
Expand Down
3 changes: 2 additions & 1 deletion server/data/store-apps/app_list.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ enabledApps:
- crossplane-v1.0.1
- testkube-v1.0.0
- testkube-v1.0.1
- tekton-v0.1.5
- tekton-v0.1.7

disabledApps:
- tekton-v0.1.1
- tekton-v0.1.4
- tekton-v0.1.5
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ RepoName: "tools"
RepoURL: "https://kube-tarian.github.io/helmrepo-supporting-tools"
Namespace: "tekton"
ReleaseName: "tekton"
Version: "0.1.5"
Version: "0.1.7"
PluginName: "Tekton"
PluginDescription: "Configure Build pipeline with Tekton"
CreateNamespace: true
Icon: "tekton.svg"
LaunchURL: https://tekton.{{.DomainName}}/tekton/
LaunchURL: https://tekton.{{.DomainName}}/
LaunchUIDescription: "Intelops Tekton"
LaunchUIIcon: "tekton.svg"
OverrideValues:
Expand Down

0 comments on commit a806a2c

Please sign in to comment.