There is no validation of topology

Bug #1620767 reported by Eugene Korekin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
fuel-ccp
In Progress
High
Mikhail Zhnichkov

Bug Description

1. Create topology file (the one defined in deploy_config), with node name that is not present in k8s cluster:

# kubectl get nodes
NAME STATUS AGE
127.0.0.1 Ready 22d

# cat /tmp/ccp-globals.yaml:

nodes:
  node1:
    roles:
      - controller
      - stacklight-collector
      - stacklight-backend
      - openvswitch
      - compute
roles:
...

2. Try to deploy with the command 'ccp deploy'

Actual result:

2016-09-06 21:06:28.229 9371 CRITICAL fuel-ccp [-] ApiException: (422)
Reason: status code 422
HTTP response headers: HTTPHeaderDict({'Date': 'Tue, 06 Sep 2016 18:06:28 GMT', 'Content-Length': '801', 'Content-Type': 'application/json'})
HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"DaemonSet.extensions \"stacklight-collector\" is invalid: spec.template.annotatio
ns.scheduler.alpha.kubernetes.io/affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].values: Required value: must be speci
fied when `operator` is 'In' or 'NotIn'","reason":"Invalid","details":{"name":"stacklight-collector","group":"extensions","kind":"DaemonSet","causes":[{"reason":"FieldValueRequired
","message":"Required value: must be specified when `operator` is 'In' or 'NotIn'","field":"spec.template.annotations.scheduler.alpha.kubernetes.io/affinity.nodeAffinity.requiredDu
ringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].values"}]},"code":422}

2016-09-06 21:06:28.229 9371 ERROR fuel-ccp Traceback (most recent call last):
2016-09-06 21:06:28.229 9371 ERROR fuel-ccp File "/usr/local/bin/ccp", line 10, in <module>
2016-09-06 21:06:28.229 9371 ERROR fuel-ccp sys.exit(main())
2016-09-06 21:06:28.229 9371 ERROR fuel-ccp File "/usr/local/lib/python2.7/dist-packages/fuel_ccp/cli.py", line 53, in main
2016-09-06 21:06:28.229 9371 ERROR fuel-ccp func()
2016-09-06 21:06:28.229 9371 ERROR fuel-ccp File "/usr/local/lib/python2.7/dist-packages/fuel_ccp/cli.py", line 25, in do_deploy
2016-09-06 21:06:28.229 9371 ERROR fuel-ccp deploy.deploy_components(components=CONF.action.components)
2016-09-06 21:06:28.229 9371 ERROR fuel-ccp File "/usr/local/lib/python2.7/dist-packages/fuel_ccp/deploy.py", line 372, in deploy_components
2016-09-06 21:06:28.229 9371 ERROR fuel-ccp config)
2016-09-06 21:06:28.229 9371 ERROR fuel-ccp File "/usr/local/lib/python2.7/dist-packages/fuel_ccp/deploy.py", line 78, in parse_role
2016-09-06 21:06:28.229 9371 ERROR fuel-ccp kubernetes.create_object_from_definition(obj)
2016-09-06 21:06:28.229 9371 ERROR fuel-ccp File "/usr/local/lib/python2.7/dist-packages/fuel_ccp/kubernetes.py", line 58, in create_object_from_definition
2016-09-06 21:06:28.229 9371 ERROR fuel-ccp body=object_dict, namespace=namespace)
2016-09-06 21:06:28.229 9371 ERROR fuel-ccp File "/usr/local/lib/python2.7/dist-packages/k8sclient/client/apis/apisextensionsvbeta_api.py", line 749, in create_namespaced_daemon_
set
2016-09-06 21:06:28.229 9371 ERROR fuel-ccp callback=params.get('callback'))
2016-09-06 21:06:28.229 9371 ERROR fuel-ccp File "/usr/local/lib/python2.7/dist-packages/k8sclient/client/api_client.py", line 320, in call_api
2016-09-06 21:06:28.229 9371 ERROR fuel-ccp response_type, auth_settings, callback)
2016-09-06 21:06:28.229 9371 ERROR fuel-ccp File "/usr/local/lib/python2.7/dist-packages/k8sclient/client/api_client.py", line 150, in __call_api
2016-09-06 21:06:28.229 9371 ERROR fuel-ccp post_params=post_params, body=body)
2016-09-06 21:06:28.229 9371 ERROR fuel-ccp File "/usr/local/lib/python2.7/dist-packages/k8sclient/client/api_client.py", line 350, in request
2016-09-06 21:06:28.229 9371 ERROR fuel-ccp body=body)
2016-09-06 21:06:28.229 9371 ERROR fuel-ccp File "/usr/local/lib/python2.7/dist-packages/k8sclient/client/rest.py", line 270, in POST
2016-09-06 21:06:28.229 9371 ERROR fuel-ccp return self.IMPL.POST(*n, **kw)
2016-09-06 21:06:28.229 9371 ERROR fuel-ccp File "/usr/local/lib/python2.7/dist-packages/k8sclient/client/rest.py", line 192, in POST
2016-09-06 21:06:28.229 9371 ERROR fuel-ccp body=body)
2016-09-06 21:06:28.229 9371 ERROR fuel-ccp File "/usr/local/lib/python2.7/dist-packages/k8sclient/client/rest.py", line 168, in request
2016-09-06 21:06:28.229 9371 ERROR fuel-ccp raise ApiException(http_resp=r)
2016-09-06 21:06:28.229 9371 ERROR fuel-ccp ApiException: (422)
2016-09-06 21:06:28.229 9371 ERROR fuel-ccp Reason: status code 422

The error is cryptic and it's cause isn't obvious.

Expected result: there should be some kind of validation for topology file, which will provide a clear diagnostics, for example, in the described case the error report could be: 'there is no such node: node1'.

Changed in fuel-ccp:
status: New → Confirmed
importance: Undecided → High
Changed in fuel-ccp:
assignee: nobody → Mikhail Zhnichkov (mzhnichkov)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-ccp (master)

Fix proposed to branch: master
Review: https://review.openstack.org/424082

Changed in fuel-ccp:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on fuel-ccp (master)

Change abandoned by Andreas Jaeger (<email address hidden>) on branch: master
Review: https://review.opendev.org/424082
Reason: This repo is retired now, no further work will get merged.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.