diff --git a/examples/v2/gke/jinja/cluster.jinja b/examples/v2/gke/jinja/cluster.jinja index dec928450..67ec3b8ba 100644 --- a/examples/v2/gke/jinja/cluster.jinja +++ b/examples/v2/gke/jinja/cluster.jinja @@ -59,6 +59,20 @@ resources: location: HEADER value: > $.concat("Bearer ", $.googleOauth2AccessToken()) + - fieldName: metadata.resourceVersion + location: BODY + methodMatch: ^(PUT|PATCH)$ + value: $.resource.self.metadata.resourceVersion + {% if endpoint == 'api/v1' %} + collectionOverrides: + - collection: '/api/v1/namespaces/{namespace}/services' + options: + inputMappings: + - fieldName: spec.clusterIP + location: BODY + methodMatch: ^(PUT|PATCH)$ + value: $.resource.self.spec.clusterIP + {% endif %} descriptorUrl: https://$(ref.{{ CLUSTER_NAME }}.endpoint)/swaggerapi/{{ endpoint }} {% endfor %} diff --git a/examples/v2/gke/python/cluster.py b/examples/v2/gke/python/cluster.py index 98da96569..29c26b4a7 100644 --- a/examples/v2/gke/python/cluster.py +++ b/examples/v2/gke/python/cluster.py @@ -88,8 +88,24 @@ def GenerateConfig(context): 'location': 'HEADER', 'value': '$.concat("Bearer ",' '$.googleOauth2AccessToken())' + }, { + 'fieldName': 'metadata.resourceVersion', + 'location': 'BODY', + 'methodMatch': '^(PUT|PATCH)$', + 'value': '$.resource.self.metadata.resourceVersion' }] }, + 'collectionOverrides': [{ + 'collection': '/api/v1/namespaces/{namespace}/services', + 'options': { + 'inputMappings': [{ + 'fieldName': 'spec.clusterIP', + 'location': 'BODY', + 'methodMatch': '^(PUT|PATCH)$', + 'value': '$.resource.self.spec.clusterIP' + }] + } + }] if endpoint == 'api/v1' else [], 'descriptorUrl': ''.join([ 'https://$(ref.', cluster_name, '.endpoint)/swaggerapi/',