mirror of
https://github.com/go-micro/go-micro.git
synced 2025-06-12 22:07:47 +02:00
Patch deployment spec metadata (#928)
This commit is contained in:
@ -116,7 +116,7 @@ func (k *kubernetes) Delete(s *runtime.Service) error {
|
||||
// Update the service in place
|
||||
func (k *kubernetes) Update(s *runtime.Service) error {
|
||||
type body struct {
|
||||
Metadata *client.Metadata `json:"metadata"`
|
||||
Spec *client.Spec `json:"spec"`
|
||||
}
|
||||
// parse version into human readable timestamp
|
||||
updateTimeStamp, err := strconv.ParseInt(s.Version, 10, 64)
|
||||
@ -126,9 +126,13 @@ func (k *kubernetes) Update(s *runtime.Service) error {
|
||||
unixTimeUTC := time.Unix(updateTimeStamp, 0)
|
||||
// metada which we will PATCH deployment with
|
||||
reqBody := body{
|
||||
Metadata: &client.Metadata{
|
||||
Annotations: map[string]string{
|
||||
"build": unixTimeUTC.Format(time.RFC3339),
|
||||
Spec: &client.Spec{
|
||||
Template: &client.Template{
|
||||
Metadata: &client.Metadata{
|
||||
Annotations: map[string]string{
|
||||
"build": unixTimeUTC.Format(time.RFC3339),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user