Skip to content

Commit 335a080

Browse files
authored
chore(controller): add deploy default annotations (#113)
1 parent 1b667b7 commit 335a080

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

rootfs/api/models/resource.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,7 @@ def retrieve(self, *args, **kwargs):
223223
logger.info("retrieve binding info error: {}".format(e))
224224
if update_flag is True:
225225
self.save()
226-
if self.status == "Ready" and self.binding == "Ready":
227-
return True
228-
else:
229-
return False
226+
return self.status == "Ready"
230227

231228
def detach_resource(self, *args, **kwargs):
232229
if self.binding != "Ready":

rootfs/scheduler/resources/deployment.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def manifest(self, namespace, name, image, entrypoint, command, spec_annotations
3434
replicas = kwargs.get('replicas', 0)
3535
batches = kwargs.get('deploy_batches', None)
3636
tags = kwargs.get('tags', {})
37+
annotations = kwargs.get('annotations', {})
3738

3839
labels = {
3940
'app': namespace,
@@ -106,6 +107,8 @@ def manifest(self, namespace, name, image, entrypoint, command, spec_annotations
106107

107108
# set the old deployment spec annotations on this deployment
108109
manifest['spec']['template']['metadata']['annotations'] = spec_annotations
110+
if annotations:
111+
manifest['spec']['template']['metadata']['annotations'].update(annotations)
109112
if "resource_version" in kwargs:
110113
manifest["metadata"]["resourceVersion"] = kwargs.get("resource_version")
111114

0 commit comments

Comments
 (0)