Skip to content

Commit e8eb7a5

Browse files
authored
Merge pull request kubernetes#110990 from thockin/svc-typenames-IPFamilyPolicyType
Rename IPFamilyPolicyType => IPFamilyPolicy
2 parents f88b118 + 55232e2 commit e8eb7a5

File tree

13 files changed

+933
-928
lines changed

13 files changed

+933
-928
lines changed

pkg/api/service/testing/make.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ func SetIPFamilies(families ...api.IPFamily) Tweak {
157157
}
158158

159159
// SetIPFamilyPolicy sets the service IPFamilyPolicy field.
160-
func SetIPFamilyPolicy(policy api.IPFamilyPolicyType) Tweak {
160+
func SetIPFamilyPolicy(policy api.IPFamilyPolicy) Tweak {
161161
return func(svc *api.Service) {
162162
svc.Spec.IPFamilyPolicy = &policy
163163
}

pkg/apis/core/types.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -3736,27 +3736,27 @@ const (
37363736
IPv6Protocol IPFamily = "IPv6"
37373737
)
37383738

3739-
// IPFamilyPolicyType represents the dual-stack-ness requested or required by a Service
3740-
type IPFamilyPolicyType string
3739+
// IPFamilyPolicy represents the dual-stack-ness requested or required by a Service
3740+
type IPFamilyPolicy string
37413741

37423742
const (
37433743
// IPFamilyPolicySingleStack indicates that this service is required to have a single IPFamily.
37443744
// The IPFamily assigned is based on the default IPFamily used by the cluster
37453745
// or as identified by service.spec.ipFamilies field
3746-
IPFamilyPolicySingleStack IPFamilyPolicyType = "SingleStack"
3746+
IPFamilyPolicySingleStack IPFamilyPolicy = "SingleStack"
37473747
// IPFamilyPolicyPreferDualStack indicates that this service prefers dual-stack when
37483748
// the cluster is configured for dual-stack. If the cluster is not configured
37493749
// for dual-stack the service will be assigned a single IPFamily. If the IPFamily is not
37503750
// set in service.spec.ipFamilies then the service will be assigned the default IPFamily
37513751
// configured on the cluster
3752-
IPFamilyPolicyPreferDualStack IPFamilyPolicyType = "PreferDualStack"
3752+
IPFamilyPolicyPreferDualStack IPFamilyPolicy = "PreferDualStack"
37533753
// IPFamilyPolicyRequireDualStack indicates that this service requires dual-stack. Using
37543754
// IPFamilyPolicyRequireDualStack on a single stack cluster will result in validation errors. The
37553755
// IPFamilies (and their order) assigned to this service is based on service.spec.ipFamilies. If
37563756
// service.spec.ipFamilies was not provided then it will be assigned according to how they are
37573757
// configured on the cluster. If service.spec.ipFamilies has only one entry then the alternative
37583758
// IPFamily will be added by apiserver
3759-
IPFamilyPolicyRequireDualStack IPFamilyPolicyType = "RequireDualStack"
3759+
IPFamilyPolicyRequireDualStack IPFamilyPolicy = "RequireDualStack"
37603760
)
37613761

37623762
// ServiceSpec describes the attributes that a user creates on a service
@@ -3829,7 +3829,7 @@ type ServiceSpec struct {
38293829
// to this service can be controlled by service.spec.ipFamilies and service.spec.clusterIPs
38303830
// respectively.
38313831
// +optional
3832-
IPFamilyPolicy *IPFamilyPolicyType
3832+
IPFamilyPolicy *IPFamilyPolicy
38333833

38343834
// ExternalName is the external reference that kubedns or equivalent will
38353835
// return as a CNAME record for this service. No proxying will be involved.

pkg/apis/core/v1/zz_generated.conversion.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/core/zz_generated.deepcopy.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/registry/core/service/storage/alloc.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ func isMatchingPreferDualStackClusterIPFields(after After, before Before) bool {
10121012

10131013
// Helper to avoid nil-checks all over. Callers of this need to be checking
10141014
// for an exact value.
1015-
func getIPFamilyPolicy(svc *api.Service) api.IPFamilyPolicyType {
1015+
func getIPFamilyPolicy(svc *api.Service) api.IPFamilyPolicy {
10161016
if svc.Spec.IPFamilyPolicy == nil {
10171017
return "" // callers need to handle this
10181018
}

pkg/registry/core/service/storage/storage_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1239,7 +1239,7 @@ func proveHealthCheckNodePortDeallocated(t *testing.T, storage *wrapperRESTForTe
12391239
// functional tests of the registry
12401240
//
12411241

1242-
func fmtIPFamilyPolicy(pol *api.IPFamilyPolicyType) string {
1242+
func fmtIPFamilyPolicy(pol *api.IPFamilyPolicy) string {
12431243
if pol == nil {
12441244
return "<nil>"
12451245
}
@@ -1453,7 +1453,7 @@ func TestCreateInitIPFields(t *testing.T) {
14531453
line string
14541454
svc *api.Service
14551455
expectError bool
1456-
expectPolicy api.IPFamilyPolicyType
1456+
expectPolicy api.IPFamilyPolicy
14571457
expectFamilies []api.IPFamily
14581458
expectHeadless bool
14591459
}
@@ -5922,7 +5922,7 @@ func TestCreateInvalidClusterIPInputs(t *testing.T) {
59225922
name: "bad_ipFamilyPolicy",
59235923
families: []api.IPFamily{api.IPv4Protocol},
59245924
svc: svctest.MakeService("foo",
5925-
svctest.SetIPFamilyPolicy(api.IPFamilyPolicyType("garbage"))),
5925+
svctest.SetIPFamilyPolicy(api.IPFamilyPolicy("garbage"))),
59265926
expect: []string{"Unsupported value"},
59275927
}, {
59285928
name: "requiredual_ipFamilyPolicy_on_singlestack",

0 commit comments

Comments
 (0)