Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pkg/config/piped.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,11 @@ func (s *PipedSpec) Validate() error {
if s.PipedID == "" {
return errors.New("pipedID must be set")
}
if s.PipedKeyFile == "" {
return errors.New("pipedKeyFile must be set")
if s.PipedKeyData == "" && s.PipedKeyFile == "" {
return errors.New("either pipedKeyFile or pipedKeyData must be set")
}
if s.PipedKeyData != "" && s.PipedKeyFile != "" {
return errors.New("only pipedKeyFile or pipedKeyData can be set")
}
if s.APIAddress == "" {
return errors.New("apiAddress must be set")
Expand Down Expand Up @@ -194,9 +197,6 @@ func (s *PipedSpec) GetSecretManagement() *SecretManagement {
}

func (s *PipedSpec) LoadPipedKey() ([]byte, error) {
if s.PipedKeyData != "" && s.PipedKeyFile != "" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right

return nil, errors.New("only either pipedKeyFile or pipedKeyData can be set")
}
if s.PipedKeyData != "" {
return base64.StdEncoding.DecodeString(s.PipedKeyData)
}
Expand Down