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

Support ExtraTagInfo, ExtraFieldInfo, and data verification #48

Merged
merged 1 commit into from Jun 27, 2023

Conversation

PhanLe1010
Copy link
Collaborator

Copy link
Member

@innobead innobead left a comment

Choose a reason for hiding this comment

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

In general, LGTM.

Let's merge this until @c3y1huang finishes the review.

ReleaseDate string `json:"releaseDate"`
MinUpgradableVersion string `json:"minUpgradableVersion"` // can be empty or semantic versioning
Tags []string `json:"tags"`
ExtraInfo map[string]string `json:"extraInfo"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where is this used?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The project maintainers can use this ExtraInfo to send back to the clients additional information such as minKubernetesVersion/maxKubernetesVersion.

Longhorn project doesn't use this feature though

}
case "float", "boolean":
default:
return fmt.Errorf("schema %v has invalid data type %v", schemaName, schema.DataType)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return fmt.Errorf("schema %v has invalid data type %v", schemaName, schema.DataType)
return fmt.Errorf("field schema %v has invalid data type %v", schemaName, schema.DataType)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thank you. Fixed

MaxLen int `json:"maxLen"`
}

func (sc *Schema) Validate(value interface{}) bool {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we add some logs if the value doesn't pass the validation?

Copy link
Member

Choose a reason for hiding this comment

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

Sounds helpful since the method just returns bool.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I thought about it but worried that the logs might explode due to hundreds of requests per second. WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

Then let's add trace log instead.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added the log at debugging level. Thank you!

longhorn/longhorn#5235
https://github.com/longhorn/upgrade-responder/issues/47

Signed-off-by: Phan Le <phan.le@suse.com>
Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
Copy link
Collaborator

@c3y1huang c3y1huang left a comment

Choose a reason for hiding this comment

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

LGTM

@innobead innobead merged commit a0c69c9 into longhorn:master Jun 27, 2023
2 checks passed
@innobead
Copy link
Member

@PhanLe1010 let's update the dashboard after 1.5.0 out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants