prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  eks update action
  https://docs.aws.amazon.com/eks/latest/userguide/cluster-endpoint.html
  
  </issue>
  <code>
  [start of c7n/resources/eks.py]
  1 # Copyright 2018 Capital One Services, LLC
  2 #
  3 # Licensed under the Apache License, Version 2.0 (the "License");
  4 # you may not use this file except in compliance with the License.
  5 # You may obtain a copy of the License at
  6 #
  7 # http://www.apache.org/licenses/LICENSE-2.0
  8 #
  9 # Unless required by applicable law or agreed to in writing, software
  10 # distributed under the License is distributed on an "AS IS" BASIS,
  11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12 # See the License for the specific language governing permissions and
  13 # limitations under the License.
  14 from __future__ import absolute_import, division, print_function, unicode_literals
  15 
  16 from c7n.actions import Action
  17 from c7n.filters.vpc import SecurityGroupFilter, SubnetFilter, VpcFilter
  18 from c7n.manager import resources
  19 from c7n.query import QueryResourceManager
  20 from c7n.utils import local_session, type_schema
  21 
  22 
  23 @resources.register('eks')
  24 class EKS(QueryResourceManager):
  25 
  26     class resource_type(object):
  27         service = 'eks'
  28         enum_spec = ('list_clusters', 'clusters', None)
  29         arn = 'arn'
  30         detail_spec = ('describe_cluster', 'name', None, 'cluster')
  31         id = name = 'name'
  32         date = 'createdAt'
  33         dimension = None
  34         filter_name = None
  35 
  36 
  37 @EKS.filter_registry.register('subnet')
  38 class EKSSubnetFilter(SubnetFilter):
  39 
  40     RelatedIdsExpression = "resourcesVpcConfig.subnetIds[]"
  41 
  42 
  43 @EKS.filter_registry.register('security-group')
  44 class EKSSGFilter(SecurityGroupFilter):
  45 
  46     RelatedIdsExpression = "resourcesVpcConfig.securityGroupIds[]"
  47 
  48 
  49 @EKS.filter_registry.register('vpc')
  50 class EKSVpcFilter(VpcFilter):
  51 
  52     RelatedIdsExpression = 'resourcesVpcConfig.vpcId'
  53 
  54 
  55 @EKS.action_registry.register('delete')
  56 class Delete(Action):
  57 
  58     schema = type_schema('delete')
  59     permissions = ('eks:DeleteCluster',)
  60 
  61     def process(self, resources):
  62         client = local_session(self.manager.session_factory).client('eks')
  63         for r in resources:
  64             try:
  65                 client.delete_cluster(name=r['name'])
  66             except client.exceptions.ResourceNotFoundException:
  67                 continue
  68
  [end of c7n/resources/eks.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/c7n/resources/eks.py b/c7n/resources/eks.py
  --- a/c7n/resources/eks.py
  +++ b/c7n/resources/eks.py
  @@ -19,6 +19,8 @@
   from c7n.query import QueryResourceManager
   from c7n.utils import local_session, type_schema
   
  +from .aws import shape_validate
  +
   
   @resources.register('eks')
   class EKS(QueryResourceManager):
  @@ -52,6 +54,37 @@
       RelatedIdsExpression = 'resourcesVpcConfig.vpcId'
   
   
  +@EKS.action_registry.register('update-config')
  +class UpdateConfig(Action):
  +
  +    schema = type_schema(
  +        'update-config', resourcesVpcConfig={'type': 'object'},
  +        required=('resourcesVpcConfig',))
  +    permissions = ('eks:UpdateClusterConfig',)
  +    shape = 'UpdateClusterConfigRequest'
  +
  +    def validate(self):
  +        cfg = dict(self.data)
  +        cfg['name'] = 'validate'
  +        cfg.pop('type')
  +        return shape_validate(
  +            cfg, self.shape, self.manager.resource_type.service)
  +
  +    def process(self, resources):
  +        client = local_session(self.manager.session_factory).client('eks')
  +        state_filtered = 0
  +        for r in resources:
  +            if r['status'] != 'ACTIVE':
  +                state_filtered += 1
  +                continue
  +            client.update_cluster_config(
  +                name=r['name'],
  +                resourcesVpcConfig=self.data['resourcesVpcConfig'])
  +        if state_filtered:
  +            self.log.warning(
  +                "Filtered %d of %d clusters due to state", state_filtered, len(resources))
  +
  +
   @EKS.action_registry.register('delete')
   class Delete(Action):
  
verification_info: {"golden_diff": "diff --git a/c7n/resources/eks.py b/c7n/resources/eks.py\n--- a/c7n/resources/eks.py\n+++ b/c7n/resources/eks.py\n@@ -19,6 +19,8 @@\n from c7n.query import QueryResourceManager\n from c7n.utils import local_session, type_schema\n \n+from .aws import shape_validate\n+\n \n @resources.register('eks')\n class EKS(QueryResourceManager):\n@@ -52,6 +54,37 @@\n     RelatedIdsExpression = 'resourcesVpcConfig.vpcId'\n \n \n+@EKS.action_registry.register('update-config')\n+class UpdateConfig(Action):\n+\n+    schema = type_schema(\n+        'update-config', resourcesVpcConfig={'type': 'object'},\n+        required=('resourcesVpcConfig',))\n+    permissions = ('eks:UpdateClusterConfig',)\n+    shape = 'UpdateClusterConfigRequest'\n+\n+    def validate(self):\n+        cfg = dict(self.data)\n+        cfg['name'] = 'validate'\n+        cfg.pop('type')\n+        return shape_validate(\n+            cfg, self.shape, self.manager.resource_type.service)\n+\n+    def process(self, resources):\n+        client = local_session(self.manager.session_factory).client('eks')\n+        state_filtered = 0\n+        for r in resources:\n+            if r['status'] != 'ACTIVE':\n+                state_filtered += 1\n+                continue\n+            client.update_cluster_config(\n+                name=r['name'],\n+                resourcesVpcConfig=self.data['resourcesVpcConfig'])\n+        if state_filtered:\n+            self.log.warning(\n+                \"Filtered %d of %d clusters due to state\", state_filtered, len(resources))\n+\n+\n @EKS.action_registry.register('delete')\n class Delete(Action):\n", "issue": "eks update action\nhttps://docs.aws.amazon.com/eks/latest/userguide/cluster-endpoint.html\n", "before_files": [{"content": "# Copyright 2018 Capital One Services, LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\nfrom c7n.actions import Action\nfrom c7n.filters.vpc import SecurityGroupFilter, SubnetFilter, VpcFilter\nfrom c7n.manager import resources\nfrom c7n.query import QueryResourceManager\nfrom c7n.utils import local_session, type_schema\n\n\n@resources.register('eks')\nclass EKS(QueryResourceManager):\n\n    class resource_type(object):\n        service = 'eks'\n        enum_spec = ('list_clusters', 'clusters', None)\n        arn = 'arn'\n        detail_spec = ('describe_cluster', 'name', None, 'cluster')\n        id = name = 'name'\n        date = 'createdAt'\n        dimension = None\n        filter_name = None\n\n\n@EKS.filter_registry.register('subnet')\nclass EKSSubnetFilter(SubnetFilter):\n\n    RelatedIdsExpression = \"resourcesVpcConfig.subnetIds[]\"\n\n\n@EKS.filter_registry.register('security-group')\nclass EKSSGFilter(SecurityGroupFilter):\n\n    RelatedIdsExpression = \"resourcesVpcConfig.securityGroupIds[]\"\n\n\n@EKS.filter_registry.register('vpc')\nclass EKSVpcFilter(VpcFilter):\n\n    RelatedIdsExpression = 'resourcesVpcConfig.vpcId'\n\n\n@EKS.action_registry.register('delete')\nclass Delete(Action):\n\n    schema = type_schema('delete')\n    permissions = ('eks:DeleteCluster',)\n\n    def process(self, resources):\n        client = local_session(self.manager.session_factory).client('eks')\n        for r in resources:\n            try:\n                client.delete_cluster(name=r['name'])\n            except client.exceptions.ResourceNotFoundException:\n                continue\n", "path": "c7n/resources/eks.py"}]}