@@ -136,6 +136,7 @@ def perform_action(svc, definition: Dict, params: Dict) -> Dict:
136
136
kind = definition .get ("kind" )
137
137
api_version = definition .get ("apiVersion" )
138
138
hidden_fields = params .get ("hidden_fields" )
139
+ subresource = params .get ("subresource" )
139
140
140
141
result = {"changed" : False , "result" : {}}
141
142
instance = {}
@@ -144,7 +145,20 @@ def perform_action(svc, definition: Dict, params: Dict) -> Dict:
144
145
resource = svc .find_resource (kind , api_version , fail = True )
145
146
definition ["kind" ] = resource .kind
146
147
definition ["apiVersion" ] = resource .group_version
147
- existing = svc .retrieve (resource , definition )
148
+
149
+ if subresource and subresource is not None :
150
+ if subresource not in resource .subresources .keys ():
151
+ raise CoreException (
152
+ "The resource {resource} doesn't support the subresource {subresource}" .format (
153
+ resource = resource .kind ,
154
+ subresource = subresource ,
155
+ )
156
+ )
157
+
158
+ existing = svc .retrieve (resource .subresources [subresource ], definition )
159
+ resource = resource .subresources [subresource ]
160
+ else :
161
+ existing = svc .retrieve (resource , definition )
148
162
149
163
if state == "absent" :
150
164
if exists (existing ) and existing .kind .endswith ("List" ):
0 commit comments