-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hotfix/10015 cloud formation lint error #10066
Hotfix/10015 cloud formation lint error #10066
Conversation
Welcome @binkkatal! |
Hi @binkkatal. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@@ -55,11 +55,11 @@ type AutoscalingGroup struct { | |||
// LaunchTemplate is the launch template for the asg | |||
LaunchTemplate *LaunchTemplate | |||
// MaxSize is the max number of nodes in asg | |||
MaxSize *int64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this! I think we should keep these types as integers (or int64) and only update the cloudformation (line 865) to string. We shouldn't modify the terraform types because those should use integers (see the terraform docs here).
Only modifying the cloudformationAutoscalingGroup
type also means we don't have to update anything in pkg/model
which I think is preferable for this particular issue.
This same suggestion applies to the loadbalancer and healthcheck types below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rifelpet , the fields in the loadbalancer and health check also results in lint warnings,
should they be reverted back to int64 fields ?
E3012 Property Resources/AWSElasticLoadBalancingLoadBalancerapiprivateciliumadvancedexamplecom/Properties/Listeners/0/InstancePort should be of type String
E3012 Property Resources/AWSElasticLoadBalancingLoadBalancerapiprivateciliumadvancedexamplecom/Properties/Listeners/0/LoadBalancerPort should be of type String
E3012 Property Resources/AWSElasticLoadBalancingLoadBalancerapiprivateciliumadvancedexamplecom/Properties/HealthCheck/HealthyThreshold should be of type String
E3012 Property Resources/AWSElasticLoadBalancingLoadBalancerapiprivateciliumadvancedexamplecom/Properties/HealthCheck/UnhealthyThreshold should be of type String
E3012 Property Resources/AWSElasticLoadBalancingLoadBalancerapiprivateciliumadvancedexamplecom/Properties/HealthCheck/Interval should be of type String
E3012 Property Resources/AWSElasticLoadBalancingLoadBalancerapiprivateciliumadvancedexamplecom/Properties/HealthCheck/Timeout should be of type String
E3012 Property Resources/AWSElasticLoadBalancingLoadBalancerbastionprivateciliumadvancedexamplecom/Properties/Listeners/0/InstancePort should be of type String
tests/integration/update_cluster/privateciliumadvanced/cloudformation.json:1297:13
E3012 Property Resources/AWSElasticLoadBalancingLoadBalancerbastionprivateciliumadvancedexamplecom/Properties/Listeners/0/LoadBalancerPort should be of type String
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These types should be updated to fix the lint warnings:
kops/upup/pkg/fi/cloudup/awstasks/load_balancer.go
Lines 789 to 829 in 0be8d4e
type cloudformationLoadBalancer struct { | |
LoadBalancerName *string `json:"LoadBalancerName,omitempty"` | |
Listener []*cloudformationLoadBalancerListener `json:"Listeners,omitempty"` | |
SecurityGroups []*cloudformation.Literal `json:"SecurityGroups,omitempty"` | |
Subnets []*cloudformation.Literal `json:"Subnets,omitempty"` | |
Scheme *string `json:"Scheme,omitempty"` | |
HealthCheck *cloudformationLoadBalancerHealthCheck `json:"HealthCheck,omitempty"` | |
AccessLog *cloudformationLoadBalancerAccessLog `json:"AccessLoggingPolicy,omitempty"` | |
ConnectionDrainingPolicy *cloudformationConnectionDrainingPolicy `json:"ConnectionDrainingPolicy,omitempty"` | |
ConnectionSettings *cloudformationConnectionSettings `json:"ConnectionSettings,omitempty"` | |
CrossZoneLoadBalancing *bool `json:"CrossZone,omitempty"` | |
Tags []cloudformationTag `json:"Tags,omitempty"` | |
} | |
type cloudformationLoadBalancerListener struct { | |
InstancePort int `json:"InstancePort"` | |
InstanceProtocol string `json:"InstanceProtocol"` | |
LoadBalancerPort int64 `json:"LoadBalancerPort"` | |
LoadBalancerProtocol string `json:"Protocol"` | |
} | |
type cloudformationLoadBalancerHealthCheck struct { | |
Target *string `json:"Target"` | |
HealthyThreshold *int64 `json:"HealthyThreshold"` | |
UnhealthyThreshold *int64 `json:"UnhealthyThreshold"` | |
Interval *int64 `json:"Interval"` | |
Timeout *int64 `json:"Timeout"` | |
} | |
type cloudformationConnectionDrainingPolicy struct { | |
Enabled *bool `json:"Enabled,omitempty"` | |
Timeout *int64 `json:"Timeout,omitempty"` | |
} | |
type cloudformationConnectionSettings struct { | |
IdleTimeout *int64 `json:"IdleTimeout,omitempty"` | |
} |
but the regular LoadBalancer
, LoadBalancerHealthCheck
types should not. This means the type conversion from int64 to string will need to happen in RenderCloudformation
rather than in the pkg/model
packages. The ./hack/update-expected.sh
script should only be updating the cloudformation.json
files, not the kubernetes.tf
files.
/ok-to-test |
@rifelpet , is it okay if i rebase and squash it to remove merge commits ? |
@binkkatal yes, feel free to rebase and squash. The changes look good to me, so once you do we can get this merged |
The ./hack/update-expected.sh script generates some fields which are required to be string fields and hence results in linting errors. This PR changes those fields to string/*string and removes lint warnings.
50488f5
to
86b605d
Compare
@rifelpet squashed and rebased the commits, ready to merge |
confirmed that cfn-lint no longer reports those warnings. Thanks! /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: binkkatal, rifelpet The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
connects #10015
The ./hack/update-expected.sh script generates some fields which are
required to be string fields and hence results in linting errors.
This PR changes those fields to string/*string and removes lint
warnings.
E3031 CidrIp contains invalid characters (Pattern: x.x.x.x/y) at Resources/AWSEC2SecurityGroupIngressicmppmtuapielb20010850040/Properties/CidrIp
tests/integration/update_cluster/complex/cloudformation.json:629:9