Update generator to not use reflect

This commit is contained in:
Jefftree
2020-11-30 10:41:04 -08:00
parent e3de62298a
commit 6addd69529
21 changed files with 177 additions and 175 deletions

View File

@@ -21,8 +21,6 @@ limitations under the License.
package v1beta1
import (
"reflect"
v1beta1 "k8s.io/api/extensions/v1beta1"
runtime "k8s.io/apimachinery/pkg/runtime"
v1 "k8s.io/kubernetes/pkg/apis/core/v1"
@@ -113,7 +111,7 @@ func SetObjectDefaults_DaemonSet(in *v1beta1.DaemonSet) {
v1.SetDefaults_Container(a)
for j := range a.Ports {
b := &a.Ports[j]
if reflect.ValueOf(b.Protocol).IsZero() {
if b.Protocol == "" {
b.Protocol = "TCP"
}
}
@@ -163,7 +161,7 @@ func SetObjectDefaults_DaemonSet(in *v1beta1.DaemonSet) {
v1.SetDefaults_Container(a)
for j := range a.Ports {
b := &a.Ports[j]
if reflect.ValueOf(b.Protocol).IsZero() {
if b.Protocol == "" {
b.Protocol = "TCP"
}
}
@@ -213,7 +211,7 @@ func SetObjectDefaults_DaemonSet(in *v1beta1.DaemonSet) {
v1.SetDefaults_EphemeralContainer(a)
for j := range a.EphemeralContainerCommon.Ports {
b := &a.EphemeralContainerCommon.Ports[j]
if reflect.ValueOf(b.Protocol).IsZero() {
if b.Protocol == "" {
b.Protocol = "TCP"
}
}
@@ -334,7 +332,7 @@ func SetObjectDefaults_Deployment(in *v1beta1.Deployment) {
v1.SetDefaults_Container(a)
for j := range a.Ports {
b := &a.Ports[j]
if reflect.ValueOf(b.Protocol).IsZero() {
if b.Protocol == "" {
b.Protocol = "TCP"
}
}
@@ -384,7 +382,7 @@ func SetObjectDefaults_Deployment(in *v1beta1.Deployment) {
v1.SetDefaults_Container(a)
for j := range a.Ports {
b := &a.Ports[j]
if reflect.ValueOf(b.Protocol).IsZero() {
if b.Protocol == "" {
b.Protocol = "TCP"
}
}
@@ -434,7 +432,7 @@ func SetObjectDefaults_Deployment(in *v1beta1.Deployment) {
v1.SetDefaults_EphemeralContainer(a)
for j := range a.EphemeralContainerCommon.Ports {
b := &a.EphemeralContainerCommon.Ports[j]
if reflect.ValueOf(b.Protocol).IsZero() {
if b.Protocol == "" {
b.Protocol = "TCP"
}
}
@@ -596,7 +594,7 @@ func SetObjectDefaults_ReplicaSet(in *v1beta1.ReplicaSet) {
v1.SetDefaults_Container(a)
for j := range a.Ports {
b := &a.Ports[j]
if reflect.ValueOf(b.Protocol).IsZero() {
if b.Protocol == "" {
b.Protocol = "TCP"
}
}
@@ -646,7 +644,7 @@ func SetObjectDefaults_ReplicaSet(in *v1beta1.ReplicaSet) {
v1.SetDefaults_Container(a)
for j := range a.Ports {
b := &a.Ports[j]
if reflect.ValueOf(b.Protocol).IsZero() {
if b.Protocol == "" {
b.Protocol = "TCP"
}
}
@@ -696,7 +694,7 @@ func SetObjectDefaults_ReplicaSet(in *v1beta1.ReplicaSet) {
v1.SetDefaults_EphemeralContainer(a)
for j := range a.EphemeralContainerCommon.Ports {
b := &a.EphemeralContainerCommon.Ports[j]
if reflect.ValueOf(b.Protocol).IsZero() {
if b.Protocol == "" {
b.Protocol = "TCP"
}
}