Skip to content

Commit

Permalink
chore: update helper messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexej Disterhoft committed Mar 4, 2024
1 parent 19d13a3 commit 0ba3bd2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 5 additions & 3 deletions internal/view/browser.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,12 @@ func (b *Browser) createCmd(_ *tcell.EventKey) *tcell.EventKey {
defer tmpFile.Close()

_, err = tmpFile.WriteString(strings.Join([]string{
"# To create a new resource, provide a definition below.",
"# Multiple documents are supported.",
"# Please add your resource definitions below. Lines beginning with a '#' will be ignored.",
"# Multiple resources are supported and can be separated by '---'.",
"# When done, save and close the editor, K9s will then `kubectl create` the resource.",
"",
fmt.Sprintf("# The content will also be saved in '%s'", b.App().Config.K9s.ContextScreenDumpDir()),
"# in case you need to recover it.",
"#",
}, "\n"))
if err != nil {
b.App().Flash().Err(errors.New("Failed to write to temporary resource file: " + err.Error()))
Expand Down
6 changes: 4 additions & 2 deletions internal/view/live_view.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,12 @@ func (v *LiveView) duplicateCmd(_ *tcell.EventKey) *tcell.EventKey {
defer tmpFile.Close()

_, err = tmpFile.WriteString(strings.Join([]string{
"# To duplicate a resource, edit the resource and make the necessary changes.",
"# To duplicate a resource, please edit the definition below and make the necessary changes.",
"# Make sure to change the resource name and remove owner references if necessary.",
"# When done, save and close the editor, K9s will then `kubectl create` the resource.",
"",
fmt.Sprintf("# The content will also be saved in '%s'", v.app.Config.K9s.ContextScreenDumpDir()),
"# in case you need to recover it.",
"#",
v.text.GetText(true),
}, "\n"))
if err != nil {
Expand Down

0 comments on commit 0ba3bd2

Please sign in to comment.