You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
command.Flags().StringVar(&opts.drySourcePath, "dry-source-path", "", "Path in repository to the app directory for the dry source")
113
116
command.Flags().StringVar(&opts.syncSourceBranch, "sync-source-branch", "", "The branch from which the app will sync")
114
117
command.Flags().StringVar(&opts.syncSourcePath, "sync-source-path", "", "The path in the repository from which the app will sync")
118
+
command.Flags().StringVar(&opts.syncSourceRepo, "sync-source-repo", "", "The repository URL from which the app will sync (defaults to dry-source-repo if not set)")
115
119
command.Flags().StringVar(&opts.hydrateToBranch, "hydrate-to-branch", "", "The branch to hydrate the app to")
120
+
command.Flags().StringVar(&opts.hydrateToRepo, "hydrate-to-repo", "", "The repository URL to hydrate the app to (defaults to sync-source-repo or dry-source-repo if not set)")
121
+
command.Flags().StringVar(&opts.hydrateToPath, "hydrate-to-path", "", "The path in the repository to hydrate the app to (defaults to sync-source-path if not set)")
116
122
command.Flags().IntVar(&opts.revisionHistoryLimit, "revision-history-limit", argoappv1.RevisionHistoryLimit, "How many items to keep in revision history")
// Hydrating to root would overwrite or delete files at the top level of the repo,
320
323
// which can break other applications or shared configuration.
321
324
// Every hydrated app must write into a subdirectory instead.
322
-
destPath:=app.Spec.SourceHydrator.SyncSource.Path
325
+
hydrateToSource:=app.Spec.GetHydrateToSource()
326
+
destPath:=hydrateToSource.Path
323
327
ifIsRootPath(destPath) {
324
-
errors[app.QualifiedName()] =fmt.Errorf("app is configured to hydrate to the repository root (branch %q, path %q) which is not allowed", app.Spec.GetHydrateToSource().TargetRevision, destPath)
328
+
errors[app.QualifiedName()] =fmt.Errorf("app is configured to hydrate to the repository root (branch %q, path %q) which is not allowed", hydrateToSource.TargetRevision, destPath)
329
+
continue
330
+
}
331
+
332
+
// Validate that the destination repo is permitted in the project
0 commit comments