Commit 6885419a authored by Douwe Maan's avatar Douwe Maan

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
parents 08e0dbe6 825d7596
......@@ -85,7 +85,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 execute_hooks
......
---
title: Fix Kubernetes service template deployment jobs broken as of 11.10.0
merge_request: 27687
author:
type: fixed
......@@ -400,6 +400,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