This repository has been archived by the owner on Aug 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented update functionality (#26)
* test environment (#16) * Build release (#17) * test environment * add space * fix test * debug worfklow * rebuild * test exit codes * test exit codes (#19) * test exit codes * test exit codes * List secrets (#14) * add protos * add list to server and client * add clarifying content * add INFO * Implemented update functionality * checkout main build-nonprod * fix formatting Co-authored-by: alxk <alex@kaskaso.li>
- Loading branch information
Showing
7 changed files
with
310 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package client | ||
|
||
import ( | ||
"context" | ||
"log" | ||
"time" | ||
|
||
pb "github.com/ovotech/kiss/proto" | ||
) | ||
|
||
func UpdateSecret(client pb.KISSClient, timeout time.Duration, namespace, name, value string) { | ||
log.Println("[DEBUG] Updating secret...") | ||
ctx, cancel := context.WithTimeout(context.Background(), timeout) | ||
defer cancel() | ||
|
||
_, err := client.UpdateSecret( | ||
ctx, | ||
&pb.UpdateSecretRequest{ | ||
Metadata: &pb.ClientMeta{Namespace: namespace}, | ||
Name: name, | ||
Value: value, | ||
}, | ||
) | ||
if err != nil { | ||
log.Fatalf("[ERROR] Error occurred while updating secret: %v\n", err) | ||
} else { | ||
log.Println("[INFO] Successfully updated secret") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.