yyvess commented on PR #25530: URL: https://github.com/apache/airflow/pull/25530#issuecomment-1232005181
> You didn’t answer why you changed the `security_context` values in tests and how it affects compatibility. @uranusjr I was answed you ..... Changing only tests cannot affect compatibility 🙄 And as you can see all tests still green I re-copy here my previous answer, please read it => @uranusjr Why => Because for me that was incorrect but isn't related to my main change as I write previously. @potiuk I don't thinks that break anythings, the question is : why that test was not failed before my change ... The variable security_context is injected on k8s.V1PodSpec => spec=k8s.V1PodSpec(..., security_context=self.security_context, Look API documentation of K8s and you can see that security_context don't have a property securityContext => https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/V1PodSpec.md https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/V1PodSecurityContext.md It's seem that main issue is how the test is write. I am sure that on this test you can set security_context = {'hello': 'world'} and the test still green. Perhaps we must change the type of security_context & container_security_context on class KubernetesPodOperator that is actually defined as Dict security_context: Optional[Dict] = None, container_security_context: Optional[Dict] = None, Should be more safer to declare it as is security_context: Optional[k8s.V1PodSecurityContext] = None, container_security_context: Optional[k8s.V1SecurityContext] = None, But should make on a different PR is you approved to change types -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
