Skip to content

Commit

Permalink
fix-775 fix sdk promote missing annotations (kubeflow#777)
Browse files Browse the repository at this point in the history
* fix-775

* add metadata directly

* fix metadata tyep error
  • Loading branch information
Iamlovingit authored Apr 15, 2020
1 parent fc00d70 commit f30e4e2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion python/kfserving/kfserving/api/kf_serving_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,18 @@ def promote(self, name, namespace=None, watch=False, timeout_seconds=600): # pyl
except KeyError:
raise RuntimeError("Cannot promote a InferenceService that has no Canary Spec.")

try:
annotations = current_isvc['metadata']['annotations']
except KeyError:
annotations = dict()

inferenceservice = V1alpha2InferenceService(
api_version=api_version,
kind=constants.KFSERVING_KIND,
metadata=client.V1ObjectMeta(
name=name,
namespace=namespace),
namespace=namespace,
annotations=annotations),
spec=V1alpha2InferenceServiceSpec(
default=current_canary_spec,
canary=None,
Expand Down

0 comments on commit f30e4e2

Please sign in to comment.