Skip to content

Commit

Permalink
Merge pull request #28 from Bisnode/patch_data_check
Browse files Browse the repository at this point in the history
Add a check if provided patch data
  • Loading branch information
anderseknert authored Jul 13, 2020
2 parents acde9e0 + 61f7cba commit 1ac2c7a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/patch_secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ kubectl tbac patch secret my-secret --remove-data USERNAME --remove-data PASSWOR

// PatchSecret updates an already existing secret with patched content.
func PatchSecret(clientSet kubernetes.Interface, secretName *string, removeData, updateData *[]string) (err error) {
if len(*removeData) == 0 && len(*updateData) == 0 {
return fmt.Errorf("No patch data provided")
}

secretsClient := clientSet.CoreV1().Secrets(Namespace)

originalSecret, err := secretsClient.Get(*secretName, metav1.GetOptions{})
Expand Down

0 comments on commit 1ac2c7a

Please sign in to comment.