-
Notifications
You must be signed in to change notification settings - Fork 59
CRD validation on flytepropeller project structure #328
Conversation
f91ce39
to
772c107
Compare
772c107
to
792b257
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is great! I've some comments on the serialization fields... generally speaking, we shouldn't change the current structure, otherwise, deserializing existing workflow objects will fail..
@@ -37,7 +37,7 @@ func (in *Error) DeepCopyInto(out *Error) { | |||
} | |||
|
|||
type BooleanExpression struct { | |||
*core.BooleanExpression | |||
*core.BooleanExpression `json:"-"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not serialize this? that doesn't look right
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will cause an error from controller-gen
if we use json:",inline"
.
There is no JSON tag in type "BooleanExpression", and that struct is generated from Flyteidl.
type BooleanExpression struct {
// Types that are valid to be assigned to Expr:
// *BooleanExpression_Conjunction
// *BooleanExpression_Comparison
Expr isBooleanExpression_Expr `protobuf_oneof:"expr"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
Error message:
/Users/kevin/go/src/github.com/flyteorg/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/branch.go:40:2:
encountered struct field "" without JSON tag in type "BooleanExpression"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed json:"-"
here.
It seems like controller-gen
can still generate a CRD file although there are some errors.
Can we just Ignore those errors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what that means.... can you run a workflow in sandbox and see what gets serialized in the Workflow CRD, then apply your changes and rerun the workflow... and capture the CRD... the expectation is there there should be no diff... might be helpful to post the diff here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no diff. https://www.textcompare.org/yaml/?id=6177b9ca537b150013e697f9.
e6983f8
to
8ffa5c1
Compare
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
de23506
to
323a93f
Compare
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
87f21e6
to
c11107e
Compare
Signed-off-by: Kevin Su <[email protected]>
c11107e
to
fa992f2
Compare
Few updates:
|
I applied the generated CRD and ran:
successfully |
This reverts commit 02f2ad9. Signed-off-by: Haytham Abuelfutuh <[email protected]>
) This reverts commit 02f2ad9. Signed-off-by: Haytham Abuelfutuh <[email protected]>
Phase WorkflowNodePhase `json:"phase,omitempty"` | ||
ExecutionError *core.ExecutionError `json:"executionError,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should not change this.
* CRD validation Signed-off-by: Kevin Su <[email protected]> * CRD validation Signed-off-by: Kevin Su <[email protected]> * Revert json tag name Signed-off-by: Kevin Su <[email protected]> * Address comment Signed-off-by: Kevin Su <[email protected]> * Address comment Signed-off-by: Kevin Su <[email protected]> * Fixed test Signed-off-by: Kevin Su <[email protected]> * Rebase Signed-off-by: Kevin Su <[email protected]> * Updated CRD Signed-off-by: Kevin Su <[email protected]> * test Signed-off-by: Kevin Su <[email protected]>
)" (flyteorg#355) This reverts commit 0cac412. Signed-off-by: Haytham Abuelfutuh <[email protected]>
TL;DR
Adding CRD Validation for Flyteworkflw
Type
Are all requirements met?
Complete description
auto-generate CRD YAML with openapi schema
Tracking Issue
flyteorg/flyte#355
Follow-up issue
NA