Avoid overwriting default IPFamily of services #3084
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In dual-stack clusters, the
IPFamily
of the service is not empty. Our reconciliation function compares theSpec
of the expected against reconciled and considers this to be a difference that requires an update. However, as theipFamily
is an immutable field, the update operation will always fail with the following error message:This PR does the following:
ipFamily
is not defined in the service spec, it will be defaulted to theipFamily
of the reconciled service. This prevents spurious updates that result in the above error.ipFamily
is explicitly specified by the user in the service spec and it differs from the current value, it will trigger a re-create operation to delete and create the service again.Testing this is difficult as currently there are no cloud providers with support for dual-stack clusters. Kind is yet to support it as well. However, as the behaviour is triggered by the mere presence of the dual-stack feature gate, it is possible to configure Minikube to trigger the bug as follows:
Fixes #3074