diff options
Diffstat (limited to 'lib/api/internal/kubernetes.rb')
-rw-r--r-- | lib/api/internal/kubernetes.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/api/internal/kubernetes.rb b/lib/api/internal/kubernetes.rb index bab829a609e..4db2ee85362 100644 --- a/lib/api/internal/kubernetes.rb +++ b/lib/api/internal/kubernetes.rb @@ -5,6 +5,7 @@ module API module Internal class Kubernetes < Grape::API::Instance before do + check_feature_enabled authenticate_gitlab_kas_request! end @@ -55,7 +56,6 @@ module API namespace 'internal' do namespace 'kubernetes' do before do - check_feature_enabled check_agent_token end @@ -96,15 +96,16 @@ module API gitaly_repository: gitaly_repository(project) } end + end + namespace 'kubernetes/usage_metrics' do desc 'POST usage metrics' do detail 'Updates usage metrics for agent' end - route_setting :authentication, cluster_agent_token_allowed: true params do requires :gitops_sync_count, type: Integer, desc: 'The count to increment the gitops_sync metric by' end - post '/usage_metrics' do + post '/' do gitops_sync_count = params[:gitops_sync_count] if gitops_sync_count < 0 |