Your question is Filter Kubernetes Services by Attributes. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
How would you filter various Kubernetes services based on attributes, status, and dependencies?
Implement the filter using the supplied service metadata. A service matches when its attributes contain every requested key-value pair, its status is allowed, and every transitive dependency exists with status running; dependency cycles invalidate the service.
I/O contract: services maps service names to dictionaries containing attributes, status, and dependencies. Return matching service names in lexicographic order.
Signature: def filter_services(services, required_attributes, allowed_statuses):
def filter_services(services, required_attributes, allowed_statuses):