k8wiz
Argo CD
Easy
Application Management

With goTemplate enabled, which Git directory generator parameter holds the right-most directory name of a matched path?

Select your answer:

Show answer and explanation

Answer: {{.path.basename}}

Explanation

For a matched directory such as apps/guestbook, {{.path.basename}} returns guestbook, while {{.path.path}} returns the full apps/guestbook path. {{.path.filename}} exists only for the files generator, and {{index .path.segments 0}} returns the first path element, apps.

Read more about Argo CD