Skip to content

Commit

Permalink
Made suborgs created copy the default repositories used for the paren…
Browse files Browse the repository at this point in the history
…t org
  • Loading branch information
frikky committed Jun 9, 2024
1 parent da481cf commit aebd610
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -5476,6 +5476,8 @@ func diffWorkflows(oldWorkflow Workflow, newWorkflow Workflow, update bool) {
descriptionChanged := false
tagsChanged := false

backupsChanged := false

addedActions := []string{}
removedActions := []string{}
updatedActions := []Action{}
Expand All @@ -5496,6 +5498,10 @@ func diffWorkflows(oldWorkflow Workflow, newWorkflow Workflow, update bool) {
descriptionChanged = true
}

if oldWorkflow.BackupConfig.UploadRepo != newWorkflow.BackupConfig.UploadRepo || oldWorkflow.BackupConfig.UploadBranch != newWorkflow.BackupConfig.UploadBranch || oldWorkflow.BackupConfig.UploadUsername != newWorkflow.BackupConfig.UploadUsername || oldWorkflow.BackupConfig.UploadToken != newWorkflow.BackupConfig.UploadToken {
backupsChanged = true
}

if len(oldWorkflow.Tags) != len(newWorkflow.Tags) {
tagsChanged = true
}
Expand Down Expand Up @@ -5657,6 +5663,10 @@ func diffWorkflows(oldWorkflow Workflow, newWorkflow Workflow, update bool) {
childWorkflow.Tags = newWorkflow.Tags
}

if backupsChanged {
childWorkflow.BackupConfig = newWorkflow.BackupConfig
}

if len(addedActions) > 0 {
actions := []Action{}
for _, action := range newWorkflow.Actions {
Expand Down Expand Up @@ -10080,11 +10090,15 @@ func HandleCreateSubOrg(resp http.ResponseWriter, request *http.Request) {
Region: parentOrg.Region,
RegionUrl: parentOrg.RegionUrl,

Defaults: parentOrg.Defaults,

// FIXME: Should this be here? Makes things slow~
// Should only append apps owned by the parentorg itself
ActiveApps: newApps,
}

newOrg.Defaults.KmsId = ""

parentOrg.ChildOrgs = append(parentOrg.ChildOrgs, OrgMini{
Name: tmpData.Name,
Id: orgId,
Expand Down

0 comments on commit aebd610

Please sign in to comment.