Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding openAPIV3Schema Validation for the Flink application custom resource #33

Merged
merged 3 commits into from
Jun 24, 2019

Conversation

anandswaminathan
Copy link
Contributor

Adding Validation of flink application custom objects using openAPIV3Schema. Helps fail the creation/update of custom resources with invalid format.

deploy/crd.yaml Outdated
enum: [Savepoint, None, ForceCancel]
deploymentMode:
type: string
enum: [Single, Dual]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since Single is not currently supported, should we remove?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

type: object
properties:
additionalProperties:
type: string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is too restrictive. In the go definition this is map[string]interface{}, and there are flink configs that are numeric and boolean in addition to string.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem with map[string]interface{} is that it can allow nested structure. On the other end we are appending only strings to the conf.yaml.

I tested with integer values like taskmanager.heap.size: 200 and boolean values and they work. It integer as numeric string and does not fail.

properties:
additionalProperties:
type: string
envConfig:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we factor this out into its own object? That would avoid the need to duplicate it between TM/JM.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried that I am unable to make components work for custom resources. Do you have any working example you can share ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it's not supported in kubernetes: kubernetes/kubernetes#62872 😞

@anandswaminathan anandswaminathan merged commit 6dd5f55 into master Jun 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants