Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
cd362988
Commit
cd362988
authored
Oct 05, 2018
by
Darren Shepherd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove SCTPSupport
parent
43c5326d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
16 deletions
+5
-16
conditional_validation.go
pkg/apis/core/validation/conditional_validation.go
+3
-5
validation.go
pkg/apis/core/validation/validation.go
+1
-1
conditional_validation.go
pkg/apis/networking/validation/conditional_validation.go
+1
-3
kube_features.go
pkg/features/kube_features.go
+0
-7
No files found.
pkg/apis/core/validation/conditional_validation.go
View file @
cd362988
...
@@ -18,16 +18,14 @@ package validation
...
@@ -18,16 +18,14 @@ package validation
import
(
import
(
"k8s.io/apimachinery/pkg/util/validation/field"
"k8s.io/apimachinery/pkg/util/validation/field"
utilfeature
"k8s.io/apiserver/pkg/util/feature"
api
"k8s.io/kubernetes/pkg/apis/core"
api
"k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/features"
)
)
// ValidateConditionalService validates conditionally valid fields.
// ValidateConditionalService validates conditionally valid fields.
func
ValidateConditionalService
(
service
,
oldService
*
api
.
Service
)
field
.
ErrorList
{
func
ValidateConditionalService
(
service
,
oldService
*
api
.
Service
)
field
.
ErrorList
{
var
errs
field
.
ErrorList
var
errs
field
.
ErrorList
// If the SCTPSupport feature is disabled, and the old object isn't using the SCTP feature, prevent the new object from using it
// If the SCTPSupport feature is disabled, and the old object isn't using the SCTP feature, prevent the new object from using it
if
!
utilfeature
.
DefaultFeatureGate
.
Enabled
(
features
.
SCTPSupport
)
&&
len
(
serviceSCTPFields
(
oldService
))
==
0
{
if
len
(
serviceSCTPFields
(
oldService
))
==
0
{
for
_
,
f
:=
range
serviceSCTPFields
(
service
)
{
for
_
,
f
:=
range
serviceSCTPFields
(
service
)
{
errs
=
append
(
errs
,
field
.
NotSupported
(
f
,
api
.
ProtocolSCTP
,
[]
string
{
string
(
api
.
ProtocolTCP
),
string
(
api
.
ProtocolUDP
)}))
errs
=
append
(
errs
,
field
.
NotSupported
(
f
,
api
.
ProtocolSCTP
,
[]
string
{
string
(
api
.
ProtocolTCP
),
string
(
api
.
ProtocolUDP
)}))
}
}
...
@@ -52,7 +50,7 @@ func serviceSCTPFields(service *api.Service) []*field.Path {
...
@@ -52,7 +50,7 @@ func serviceSCTPFields(service *api.Service) []*field.Path {
func
ValidateConditionalEndpoints
(
endpoints
,
oldEndpoints
*
api
.
Endpoints
)
field
.
ErrorList
{
func
ValidateConditionalEndpoints
(
endpoints
,
oldEndpoints
*
api
.
Endpoints
)
field
.
ErrorList
{
var
errs
field
.
ErrorList
var
errs
field
.
ErrorList
// If the SCTPSupport feature is disabled, and the old object isn't using the SCTP feature, prevent the new object from using it
// If the SCTPSupport feature is disabled, and the old object isn't using the SCTP feature, prevent the new object from using it
if
!
utilfeature
.
DefaultFeatureGate
.
Enabled
(
features
.
SCTPSupport
)
&&
len
(
endpointsSCTPFields
(
oldEndpoints
))
==
0
{
if
len
(
endpointsSCTPFields
(
oldEndpoints
))
==
0
{
for
_
,
f
:=
range
endpointsSCTPFields
(
endpoints
)
{
for
_
,
f
:=
range
endpointsSCTPFields
(
endpoints
)
{
errs
=
append
(
errs
,
field
.
NotSupported
(
f
,
api
.
ProtocolSCTP
,
[]
string
{
string
(
api
.
ProtocolTCP
),
string
(
api
.
ProtocolUDP
)}))
errs
=
append
(
errs
,
field
.
NotSupported
(
f
,
api
.
ProtocolSCTP
,
[]
string
{
string
(
api
.
ProtocolTCP
),
string
(
api
.
ProtocolUDP
)}))
}
}
...
@@ -116,7 +114,7 @@ func validateConditionalPodSpec(podSpec, oldPodSpec *api.PodSpec, fldPath *field
...
@@ -116,7 +114,7 @@ func validateConditionalPodSpec(podSpec, oldPodSpec *api.PodSpec, fldPath *field
errs
:=
field
.
ErrorList
{}
errs
:=
field
.
ErrorList
{}
// If the SCTPSupport feature is disabled, and the old object isn't using the SCTP feature, prevent the new object from using it
// If the SCTPSupport feature is disabled, and the old object isn't using the SCTP feature, prevent the new object from using it
if
!
utilfeature
.
DefaultFeatureGate
.
Enabled
(
features
.
SCTPSupport
)
&&
len
(
podSCTPFields
(
oldPodSpec
,
nil
))
==
0
{
if
len
(
podSCTPFields
(
oldPodSpec
,
nil
))
==
0
{
for
_
,
f
:=
range
podSCTPFields
(
podSpec
,
fldPath
)
{
for
_
,
f
:=
range
podSCTPFields
(
podSpec
,
fldPath
)
{
errs
=
append
(
errs
,
field
.
NotSupported
(
f
,
api
.
ProtocolSCTP
,
[]
string
{
string
(
api
.
ProtocolTCP
),
string
(
api
.
ProtocolUDP
)}))
errs
=
append
(
errs
,
field
.
NotSupported
(
f
,
api
.
ProtocolSCTP
,
[]
string
{
string
(
api
.
ProtocolTCP
),
string
(
api
.
ProtocolUDP
)}))
}
}
...
...
pkg/apis/core/validation/validation.go
View file @
cd362988
...
@@ -29,7 +29,7 @@ import (
...
@@ -29,7 +29,7 @@ import (
"k8s.io/klog"
"k8s.io/klog"
"k8s.io/api/core/v1"
v1
"k8s.io/api/core/v1"
apiequality
"k8s.io/apimachinery/pkg/api/equality"
apiequality
"k8s.io/apimachinery/pkg/api/equality"
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/api/resource"
apimachineryvalidation
"k8s.io/apimachinery/pkg/api/validation"
apimachineryvalidation
"k8s.io/apimachinery/pkg/api/validation"
...
...
pkg/apis/networking/validation/conditional_validation.go
View file @
cd362988
...
@@ -18,17 +18,15 @@ package validation
...
@@ -18,17 +18,15 @@ package validation
import
(
import
(
"k8s.io/apimachinery/pkg/util/validation/field"
"k8s.io/apimachinery/pkg/util/validation/field"
utilfeature
"k8s.io/apiserver/pkg/util/feature"
api
"k8s.io/kubernetes/pkg/apis/core"
api
"k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/apis/networking"
"k8s.io/kubernetes/pkg/apis/networking"
"k8s.io/kubernetes/pkg/features"
)
)
// ValidateConditionalNetworkPolicy validates conditionally valid fields.
// ValidateConditionalNetworkPolicy validates conditionally valid fields.
func
ValidateConditionalNetworkPolicy
(
np
,
oldNP
*
networking
.
NetworkPolicy
)
field
.
ErrorList
{
func
ValidateConditionalNetworkPolicy
(
np
,
oldNP
*
networking
.
NetworkPolicy
)
field
.
ErrorList
{
var
errs
field
.
ErrorList
var
errs
field
.
ErrorList
// If the SCTPSupport feature is disabled, and the old object isn't using the SCTP feature, prevent the new object from using it
// If the SCTPSupport feature is disabled, and the old object isn't using the SCTP feature, prevent the new object from using it
if
!
utilfeature
.
DefaultFeatureGate
.
Enabled
(
features
.
SCTPSupport
)
&&
len
(
sctpFields
(
oldNP
))
==
0
{
if
len
(
sctpFields
(
oldNP
))
==
0
{
for
_
,
f
:=
range
sctpFields
(
np
)
{
for
_
,
f
:=
range
sctpFields
(
np
)
{
errs
=
append
(
errs
,
field
.
NotSupported
(
f
,
api
.
ProtocolSCTP
,
[]
string
{
string
(
api
.
ProtocolTCP
),
string
(
api
.
ProtocolUDP
)}))
errs
=
append
(
errs
,
field
.
NotSupported
(
f
,
api
.
ProtocolSCTP
,
[]
string
{
string
(
api
.
ProtocolTCP
),
string
(
api
.
ProtocolUDP
)}))
}
}
...
...
pkg/features/kube_features.go
View file @
cd362988
...
@@ -296,12 +296,6 @@ const (
...
@@ -296,12 +296,6 @@ const (
// (Kube) Node Lifecycle Controller uses these heartbeats as a node health signal.
// (Kube) Node Lifecycle Controller uses these heartbeats as a node health signal.
NodeLease
utilfeature
.
Feature
=
"NodeLease"
NodeLease
utilfeature
.
Feature
=
"NodeLease"
// owner: @janosi
// alpha: v1.12
//
// Enables SCTP as new protocol for Service ports, NetworkPolicy, and ContainerPort in Pod/Containers definition
SCTPSupport
utilfeature
.
Feature
=
"SCTPSupport"
// owner: @xing-yang
// owner: @xing-yang
// alpha: v1.12
// alpha: v1.12
//
//
...
@@ -418,7 +412,6 @@ var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureS
...
@@ -418,7 +412,6 @@ var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureS
CSIInlineVolume
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
CSIInlineVolume
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
RuntimeClass
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
RuntimeClass
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
NodeLease
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
NodeLease
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
SCTPSupport
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
VolumeSnapshotDataSource
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
VolumeSnapshotDataSource
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
ProcMountType
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
ProcMountType
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
TTLAfterFinished
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
TTLAfterFinished
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment