Page MenuHomeElementl

[helm] Add k8s fields to pydantic schema
ClosedPublic

Authored by sidkmenon on Jun 17 2021, 7:21 PM.

Details

Summary

Adding more k8s fields to the pydantic schema, including InitContainers & VolumeMounts.

Test Plan

helm lint + bk

Diff Detail

Repository
R1 dagster
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Also increase number of retires on helm checks since that appears to be a problem

helm/dagster/schema/schema/charts/utils/kubernetes.py
99–101

we shouldn't be adding fields to these classes - the point is that they exactly match the kubernetes object that they represent (as expressed through schema extra)

sidkmenon added a child revision: Restricted Differential Revision.Jun 18 2021, 7:39 AM

responding to @rexledesma's comments

helm/dagster/schema/schema/charts/utils/kubernetes.py
99–101

Ah ok - I saw some classes with fields and some without, so wasn't sure. I'll remove them.

helm/dagster/schema/schema/charts/utils/kubernetes.py
99–101

Decided to refrain from schema_extra here since InitContainer isn't supported by the JSON schema API we use - was thinking about trying to hand-roll some validation hooks to show the difference between this and Container but to keep things simple decided to just provide these fields for now.

johann added inline comments.
.buildkite/dagster-buildkite/dagster_buildkite/steps/helm.py
51

What causes the flakes?

helm/dagster/schema/schema/charts/utils/kubernetes.py
99–101

Looks like they type InitContainer as Container in https://kubernetesjsonschema.dev/v1.15.0/_definitions.json - let's just use Container as the schema for InitContainer to keep it simple.

Allowing for imagePullPolicy as well

Based on discussion with @rexledesma, refactoring to just use Container as a schema

.buildkite/dagster-buildkite/dagster_buildkite/steps/helm.py
51

400s from the JSON schema endpoint we use

This revision is now accepted and ready to land.Jun 18 2021, 9:50 PM