Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
Merge pull request #4 from aidenkeating/secret-format
Browse files Browse the repository at this point in the history
add secret kind and version explicitly when converting
  • Loading branch information
aidenkeating authored Jan 30, 2020
2 parents b0523fb + cd8920b commit a112b9a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/smtpdetails/smtpdetails.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ type Client interface {
//ConvertSMTPDetailsToSecret Format a standard set of SMTPDetails as a Kubernetes Secret
func ConvertSMTPDetailsToSecret(smtpDetails *SMTPDetails, secretName string) *apiv1.Secret {
return &apiv1.Secret{
TypeMeta: v1.TypeMeta{
Kind: SecretGVKKind,
APIVersion: SecretGVKVersion,
},
ObjectMeta: v1.ObjectMeta{
Name: secretName,
},
Expand Down
4 changes: 4 additions & 0 deletions pkg/smtpdetails/smtpdetails_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ func TestConvertSMTPDetailsToSecret(t *testing.T) {
secretName: "testSec",
},
want: &apiv1.Secret{
TypeMeta: v1.TypeMeta{
Kind: SecretGVKKind,
APIVersion: SecretGVKVersion,
},
ObjectMeta: v1.ObjectMeta{
Name: "testSec",
},
Expand Down
4 changes: 4 additions & 0 deletions pkg/smtpdetails/strings.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@ const (
SecretKeyUsername = "username"
//SecretKeyPassword Default secret data key for SMTP auth password
SecretKeyPassword = "password"
//SecretGVKKind GVK Kind of an OpenShift/Kubernetes Secret
SecretGVKKind = "Secret"
//SecretGVKVersion GVK Version of an OpenShift/Kubernetes Secret
SecretGVKVersion = "v1"
)

0 comments on commit a112b9a

Please sign in to comment.