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
Roadmap 2025/02 Path finder : if an object already exists in any form in the remote repo, then replace it
As an application DevOps, I want my RemoteSyncer to automatically find if the object already exists in my repo with a custom path. If it does not exists, then keep the default behavior (namespace/group/apiVersion/kind/name).
What to do
Create a new pathFinder() function that returns the path if found or an empty string if not found. The function will be called in the pathConstructor() function before the line #L104.
The function can be implemented using the DFS (depth first search) algorithm. For each file found (a leaf of a graph), open it and check the metadata of the object. If the Group, Version (eg. apiVersion: apps/v1) & Kind (eg. kind: Deployment) (GVK) is the same, then check the namespace and the name. If they are the same as well, then the resource is found and the path is the path of the current file.
If the the pathFinder() function does not return an empty string, then the pathConstructor() function can directly returns the output of the pathFinder() function.
Roadmap 2025/02 Path finder : if an object already exists in any form in the remote repo, then replace it
As an application DevOps, I want my RemoteSyncer to automatically find if the object already exists in my repo with a custom path. If it does not exists, then keep the default behavior (
namespace/group/apiVersion/kind/name
).What to do
Create a new
pathFinder()
function that returns the path if found or an empty string if not found. The function will be called in thepathConstructor()
function before the line #L104.syngit/internal/controller/git_pusher.go
Lines 101 to 104 in 0ee6e8d
The function can be implemented using the DFS (depth first search) algorithm. For each file found (a leaf of a graph), open it and check the metadata of the object. If the Group, Version (eg.
apiVersion: apps/v1
) & Kind (eg.kind: Deployment
) (GVK) is the same, then check thenamespace
and thename
. If they are the same as well, then the resource is found and the path is the path of the current file.If the the
pathFinder()
function does not return an empty string, then thepathConstructor()
function can directly returns the output of thepathFinder()
function.Additional context
If you have any questions, please tag @damsien.
The text was updated successfully, but these errors were encountered: