mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
Don't write a SecureVariable with no Items (#13258)
This commit is contained in:
committed by
Tim Gross
parent
5824b4185e
commit
a7522d5c48
@@ -55,7 +55,6 @@ func (s *HTTPServer) secureVariableQuery(resp http.ResponseWriter, req *http.Req
|
||||
if s.parse(resp, req, &args.Region, &args.QueryOptions) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
var out structs.SecureVariablesReadResponse
|
||||
if err := s.agent.RPC(structs.SecureVariablesReadRPCMethod, &args, &out); err != nil {
|
||||
return nil, err
|
||||
@@ -76,7 +75,11 @@ func (s *HTTPServer) secureVariableUpsert(resp http.ResponseWriter, req *http.Re
|
||||
if err := decodeBody(req, &SecureVariable); err != nil {
|
||||
return nil, CodedError(http.StatusBadRequest, err.Error())
|
||||
}
|
||||
if SecureVariable.UnencryptedData == nil {
|
||||
return nil, CodedError(http.StatusBadRequest, "Secure variable missing required Items object.")
|
||||
}
|
||||
SecureVariable.Path = path
|
||||
|
||||
// Format the request
|
||||
args := structs.SecureVariablesUpsertRequest{
|
||||
Data: []*structs.SecureVariable{&SecureVariable},
|
||||
|
||||
Reference in New Issue
Block a user