Skip to content

Commit

Permalink
Fix supportsSshKnownHosts in secret.js model
Browse files Browse the repository at this point in the history
Signed-off-by: Francesco Torchia <[email protected]>
  • Loading branch information
torchiaf committed Feb 26, 2025
1 parent 753469f commit 897baaa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion shell/edit/secret/ssh.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ export default {
update() {
this.value.setData('ssh-publickey', this.username);
this.value.setData('ssh-privatekey', this.password);
this.value.setData('known_hosts', this.knownHosts);
if (this.showKnownHosts) {
this.value.setData('known_hosts', this.knownHosts);
}
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion shell/models/secret.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default class Secret extends SteveModel {

// For Fleet SSH secrets - does the secret have the 'known_hosts' data key?
get supportsSshKnownHosts() {
return this._type === TYPES.SSH && 'known_hosts' in this.data;
return this._type === TYPES.SSH && !!this.data && 'known_hosts' in this.data;
}

get issuer() {
Expand Down

0 comments on commit 897baaa

Please sign in to comment.