GoogleCloudPlatform / k8s-cloud-provider

Support code for implementing a Kubernetes cloud provider for Google Cloud Platform
Apache License 2.0
37 stars 46 forks source link

Change type traits constrains logic. #204

Closed kl52752 closed 3 months ago

kl52752 commented 4 months ago

Loosen up default type traits constraint logic that requires the field to be set.

This PR has multiple changes:

  1. Introducing new type trait FieldTypeMandatory.
  2. Change default type FieldTypeOrdinary to allow zero value. After changes in type traits code coverage for health check and backend service fell below 80% so in 2 separate commits tests for given components were added.
kl52752 commented 4 months ago

/cc @mag-kol /cc @AwesomePatrol

kl52752 commented 4 months ago

/assign @bowei

bowei commented 4 months ago

Is TypeOrdinary the same as TypeAllowZeroValue?

Do we need both if they are the same?

kl52752 commented 4 months ago

Is TypeOrdinary the same as TypeAllowZeroValue?

Do we need both if they are the same?

the idea was to leave field type ordinary and get rid of AllowZeroValue when we migrate all nodes to new type.

bowei commented 3 months ago

/lgtm /approve

It seems like there is a significant cleanup that needs to follow this.

google-oss-prow[bot] commented 3 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bowei, kl52752, mag-kol

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/GoogleCloudPlatform/k8s-cloud-provider/blob/master/OWNERS)~~ [bowei] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment