@@ -30,7 +30,7 @@ def get(self, namespace, name=None, **kwargs):
3030
3131 return response
3232
33- def manifest (self , namespace , name , image , entrypoint , command , ** kwargs ):
33+ def manifest (self , namespace , name , image , entrypoint , command , spec_annotations , ** kwargs ):
3434 replicas = kwargs .get ('replicas' , 0 )
3535 batches = kwargs .get ('deploy_batches' , None )
3636 tags = kwargs .get ('tags' , {})
@@ -104,11 +104,14 @@ def manifest(self, namespace, name, image, entrypoint, command, **kwargs):
104104 # pod manifest spec
105105 manifest ['spec' ]['template' ] = self .pod .manifest (namespace , name , image , ** kwargs )
106106
107+ # set the old deployment spec annotations on this deployment
108+ manifest ['spec' ]['template' ]['metadata' ]['annotations' ] = spec_annotations
109+
107110 return manifest
108111
109- def create (self , namespace , name , image , entrypoint , command , ** kwargs ):
112+ def create (self , namespace , name , image , entrypoint , command , spec_annotations , ** kwargs ):
110113 manifest = self .manifest (namespace , name , image ,
111- entrypoint , command , ** kwargs )
114+ entrypoint , command , spec_annotations , ** kwargs )
112115
113116 url = self .api ("/namespaces/{}/deployments" , namespace )
114117 response = self .http_post (url , json = manifest )
@@ -124,9 +127,9 @@ def create(self, namespace, name, image, entrypoint, command, **kwargs):
124127
125128 return response
126129
127- def update (self , namespace , name , image , entrypoint , command , ** kwargs ):
130+ def update (self , namespace , name , image , entrypoint , command , spec_annotations , ** kwargs ):
128131 manifest = self .manifest (namespace , name , image ,
129- entrypoint , command , ** kwargs )
132+ entrypoint , command , spec_annotations , ** kwargs )
130133
131134 url = self .api ("/namespaces/{}/deployments/{}" , namespace , name )
132135 response = self .http_put (url , json = manifest )
0 commit comments