diff options
author | Nick Thomas <nick@gitlab.com> | 2019-02-04 12:44:19 +0000 |
---|---|---|
committer | GitLab Release Tools Bot <robert+release-tools@gitlab.com> | 2019-02-05 18:27:12 +0000 |
commit | e14b27bb9438d1db689c7098c343eab5f3d579dd (patch) | |
tree | 6a512290843fa64d859a3bbcffe797de21c4d9d5 | |
parent | f8671e4c1dc076af86ecf0c323b166c8390f19b2 (diff) | |
download | gitlab-ce-e14b27bb9438d1db689c7098c343eab5f3d579dd.tar.gz |
Merge branch 'sh-fix-detect-host-keys' into 'master'
Fix Detect Host Keys not working
Closes #56855
See merge request gitlab-org/gitlab-ce!24884
(cherry picked from commit 2b0f4df0217b4a4aee53f964610d66ceedb68dca)
4c1231ac Fix SSH Detect Host Keys not working
-rw-r--r-- | app/models/ssh_host_key.rb | 2 | ||||
-rw-r--r-- | changelogs/unreleased/sh-fix-detect-host-keys.yml | 5 | ||||
-rw-r--r-- | spec/models/ssh_host_key_spec.rb | 6 |
3 files changed, 12 insertions, 1 deletions
diff --git a/app/models/ssh_host_key.rb b/app/models/ssh_host_key.rb index 99a0c54a26a..f318d32c71c 100644 --- a/app/models/ssh_host_key.rb +++ b/app/models/ssh_host_key.rb @@ -54,7 +54,7 @@ class SshHostKey # Needed for reactive caching def self.primary_key - 'id' + :id end def id diff --git a/changelogs/unreleased/sh-fix-detect-host-keys.yml b/changelogs/unreleased/sh-fix-detect-host-keys.yml new file mode 100644 index 00000000000..993d7c35b18 --- /dev/null +++ b/changelogs/unreleased/sh-fix-detect-host-keys.yml @@ -0,0 +1,5 @@ +--- +title: Fix Detect Host Keys not working +merge_request: 24884 +author: +type: fixed diff --git a/spec/models/ssh_host_key_spec.rb b/spec/models/ssh_host_key_spec.rb index 75db43b3d56..23a94334172 100644 --- a/spec/models/ssh_host_key_spec.rb +++ b/spec/models/ssh_host_key_spec.rb @@ -50,6 +50,12 @@ describe SshHostKey do subject(:ssh_host_key) { described_class.new(project: project, url: 'ssh://example.com:2222', compare_host_keys: compare_host_keys) } + describe '.primary_key' do + it 'returns a symbol' do + expect(described_class.primary_key).to eq(:id) + end + end + describe '#fingerprints', :use_clean_rails_memory_store_caching do it 'returns an array of indexed fingerprints when the cache is filled' do stub_reactive_cache(ssh_host_key, known_hosts: known_hosts) |