Commit 1390346a authored by Douwe Maan's avatar Douwe Maan Committed by GitLab Release Tools Bot

Merge branch '60821-deployment-jobs-broken-as-of-11-10-0' into 'master'

Resolve "Deployment jobs broken as of 11.10.0"

Closes #60821

See merge request gitlab-org/gitlab-ce!27687

(cherry picked from commit 6885419a)

825d7596 Fix deployments for Kubernetes service templates
parent 479444dd
......@@ -79,7 +79,11 @@ class Deployment < ApplicationRecord
end
def cluster
project.deployment_platform(environment: environment.name)&.cluster
platform = project.deployment_platform(environment: environment.name)
if platform.present? && platform.respond_to?(:cluster)
platform.cluster
end
end
def last?
......
---
title: Fix Kubernetes service template deployment jobs broken as of 11.10.0
merge_request: 27687
author:
type: fixed
......@@ -379,6 +379,12 @@ describe Deployment do
it { is_expected.to be_nil }
end
context 'project uses the kubernetes service for deployments' do
let!(:service) { create(:kubernetes_service, project: project) }
it { is_expected.to be_nil }
end
context 'project has a deployment platform' do
let!(:cluster) { create(:cluster, projects: [project]) }
let!(:platform) { create(:cluster_platform_kubernetes, cluster: cluster) }
......
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