Commit 73788fa2 authored by Hordur Freyr Yngvason's avatar Hordur Freyr Yngvason

Add default_branch to KAS responses

KAS queries gitaly directly for agent configuration and GitOps.
Currently, KAS mimicks this default branch logic internally, and we
suspect it may sometimes get it wrong. So this may fix a bug, but it
will also allow us to remove duplicate logic from KAS.

See https://gitlab.com/gitlab-org/cluster-integration/gitlab-agent/-/issues/210

Changelog: changed
parent 1b3870d9
...@@ -39,6 +39,7 @@ module API ...@@ -39,6 +39,7 @@ module API
def gitaly_repository(project) def gitaly_repository(project)
{ {
default_branch: project.default_branch_or_main,
storage_name: project.repository_storage, storage_name: project.repository_storage,
relative_path: project.disk_path + '.git', relative_path: project.disk_path + '.git',
gl_repository: repo_type.identifier_for_container(project), gl_repository: repo_type.identifier_for_container(project),
......
...@@ -169,6 +169,7 @@ RSpec.describe API::Internal::Kubernetes do ...@@ -169,6 +169,7 @@ RSpec.describe API::Internal::Kubernetes do
'features' => {} 'features' => {}
), ),
'gitaly_repository' => a_hash_including( 'gitaly_repository' => a_hash_including(
'default_branch' => project.default_branch_or_main,
'storage_name' => project.repository_storage, 'storage_name' => project.repository_storage,
'relative_path' => project.disk_path + '.git', 'relative_path' => project.disk_path + '.git',
'gl_repository' => "project-#{project.id}", 'gl_repository' => "project-#{project.id}",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment