Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Ciprian Hacman <[email protected]>
  • Loading branch information
2 people authored and Ole Markus With committed Feb 11, 2021
1 parent 5633018 commit e106e5f
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 19 deletions.
4 changes: 2 additions & 2 deletions k8s/crds/kops.k8s.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ spec:
description: 'Enabled enables the loadbalancer controller. Default:
false'
type: boolean
image:
description: 'Image is the docker container used. Default: v2.0.0'
version:
description: Version is the container image tag used.
type: string
type: object
certManager:
Expand Down
5 changes: 2 additions & 3 deletions pkg/apis/kops/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -912,9 +912,8 @@ type AWSLoadBalancerControllerConfig struct {
// Enabled enables the loadbalancer controller.
// Default: false
Enabled *bool `json:"enabled,omitempty"`
// Image is the docker container used.
// Default: v2.0.0
Image *string `json:"image,omitempty"`
// Version is the container image tag used.
Version *string `json:"version,omitempty"`
}

// HasAdmissionController checks if a specific admission controller is enabled
Expand Down
5 changes: 2 additions & 3 deletions pkg/apis/kops/v1alpha2/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -911,9 +911,8 @@ type AWSLoadBalancerControllerConfig struct {
// Enabled enables the loadbalancer controller.
// Default: false
Enabled *bool `json:"enabled,omitempty"`
// Image is the docker container used.
// Default: v2.0.0
Image *string `json:"image,omitempty"`
// Version is the container image tag used.
Version *string `json:"version,omitempty"`
}

// HasAdmissionController checks if a specific admission controller is enabled
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/kops/v1alpha2/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pkg/apis/kops/validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ func validateClusterSpec(spec *kops.ClusterSpec, c *kops.Cluster, fieldPath *fie
allErrs = append(allErrs, validateAWSLoadBalancerController(c, spec.AWSLoadBalancerController, fieldPath.Child("awsLoadBalanceController"))...)

}

// IAM additional policies
if spec.AdditionalPolicies != nil {
for k, v := range *spec.AdditionalPolicies {
Expand Down Expand Up @@ -1296,7 +1297,7 @@ func validateMetricsServer(cluster *kops.Cluster, spec *kops.MetricsServerConfig
func validateAWSLoadBalancerController(cluster *kops.Cluster, spec *kops.AWSLoadBalancerControllerConfig, fldPath *field.Path) (allErrs field.ErrorList) {
if spec != nil && fi.BoolValue(spec.Enabled) {
if !components.IsCertManagerEnabled(cluster) {
allErrs = append(allErrs, field.Forbidden(fldPath.Child("insecure"), "AWS Load Balancer Controller requires that cert manager is enabled"))
allErrs = append(allErrs, field.Forbidden(fldPath, "AWS Load Balancer Controller requires that cert manager is enabled"))
}
}
return allErrs
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/kops/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions upup/models/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# sourced from https://github.com/kubernetes-sigs/aws-load-balancer-controller/blob/main/docs/install/v2_1_2_full.yaml
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
Expand Down Expand Up @@ -485,7 +487,7 @@ spec:
- --enable-wafv2=false
- --enable-shield=false
- --ingress-class=alb
image: amazon/aws-alb-ingress-controller:v2.1.0
image: amazon/aws-alb-ingress-controller:{{ or .AWSLoadBalancerController.Version "v2.1.2" }}
livenessProbe:
failureThreshold: 2
httpGet:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ func (b *BootstrapChannelBuilder) buildAddons(c *fi.ModelBuilderContext) (*chann
if b.Cluster.Spec.AWSLoadBalancerController != nil && fi.BoolValue(b.Cluster.Spec.AWSLoadBalancerController.Enabled) {

key := "aws-load-balancer-controller.addons.k8s.io"
version := "2.0.0"
version := "2.1.2"

{
location := key + "/k8s-1.9.yaml"
Expand Down

0 comments on commit e106e5f

Please sign in to comment.