Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
anil-sarodh committed Jan 21, 2024
1 parent 774d9bf commit d4db326
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions capten/config-worker/internal/crossplane/config_provider_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package crossplane
import (
"context"
"fmt"
"os"
"strings"

"github.com/kube-tarian/kad/capten/model"
Expand All @@ -18,9 +19,19 @@ const (
func (cp *CrossPlaneApp) configureConfigProviderUpdate(ctx context.Context, req *model.CrossplaneProviderUpdate) (status string, err error) {
logger.Infof("configuring config provider %s update", req.CloudType)

customerRepo, err := cp.helper.CloneUserRepo(ctx, req.RepoURL, req.GitProjectId)
if err != nil {
return string(agentmodel.WorkFlowStatusFailed), errors.WithMessage(err, "failed to clone repos")
}
logger.Infof("cloned default templates to project %s", req.RepoURL)

defer os.RemoveAll(customerRepo)

cloudType := strings.ToLower(req.CloudType)
syncPath := fmt.Sprintf("/infra/crossplane/argocd-apps/templates/package-k8s/%s-package/%s-k8s-package.yaml", cloudType, cloudType)

fmt.Println(syncPath)

ns, resName, err := getAppNameNamespace(ctx, syncPath)
if err != nil {
return string(agentmodel.WorkFlowStatusFailed), errors.WithMessage(err, "failed to get name and namespace from")
Expand Down

0 comments on commit d4db326

Please sign in to comment.