[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: KubernetesPodOperator: Invalid arguments were passed to BaseOperator


In the example
<https://github.com/apache/incubator-airflow/blob/master/airflow/example_dags/example_kubernetes_operator.py#L24>
it imports BaseOperator as KubernetesPodOperator, when the kubernetes
modules can't be found.

On Wed, May 30, 2018 at 3:34 PM, Craig Rodrigues <rodrigc@xxxxxxxxxxxxxx>
wrote:

> For this particular DeprecationWarning, this problem is not caused
> by dependencies on kubernetes stuff.
>
> On this line:
> https://github.com/apache/incubator-airflow/blob/master/
> airflow/contrib/operators/kubernetes_pod_operator.py#L137
>
> The __init__() method for KubernetesPodOperator is calling the __init__()
> method
> for BaseOperator, and passing in values for kwargs that BaseOperator
> doesn't accept:
>
> name': 'airflow-test-pod',
> 'image': 'ubuntu:16.04',
> 'labels': {'foo': 'bar'},
> 'namespace': 'default',
> 'cmds': ['bash', '-cx'],
> 'arguments': ['echo', '10'],
> 'in_cluster': False,
> 'get_logs': True
>
> I don't understand how these things are being passed via kwargs?
>
> --
> Craig
>
>
> On Wed, May 30, 2018 at 1:40 AM Driesprong, Fokko <fokko@xxxxxxxxxxxxxx>
> wrote:
>
> > Hi Craig,
> >
> > This is something that needs to be fixed. I agree with you this is very
> > dirty. In your installation you're not installing the kubernetes stuff,
> so
> > the KubernetesPodOperator is ignored. We need to figure out how to have
> > example dags that are not compatible with the vanilla installation, or we
> > need to remove the kubernetes example for now, and move it to the
> > documentation.
> >
> > Cheers, Fokko
> >
> >
>