@@ -75,6 +75,9 @@ type ResourceConfig struct {
7575 // operation `notImplemented`. Custom read function allows the
7676 // reconciler's progression.
7777 ReadOperation * ReadOperationsConfig `json:"find_operation,omitempty"`
78+ //DeleteOperation contains instructions for the code generator to generate
79+ // Go code for the delete operation for the resource.
80+ DeleteOperation * DeleteOperationsConfig `json:"delete_operation,omitempty"`
7881 // Reconcile describes options for controlling the reconciliation
7982 // logic for a particular resource.
8083 Reconcile * ReconcileConfig `json:"reconcile,omitempty"`
@@ -347,6 +350,15 @@ type ReadOperationsConfig struct {
347350 CustomMethodName string `json:"custom_method_name"`
348351}
349352
353+ // DeleteOperationsConfig contains instructions for the code generator to handle
354+ // custom delete operations for service APIs that have resources that have
355+ // difficult-to-standardize delete operations.
356+ type DeleteOperationsConfig struct {
357+ // CustomMethodName is a string for the method name to replace the
358+ // sdkDelete() method implementation for this resource
359+ CustomMethodName string `json:"custom_method_name"`
360+ }
361+
350362// AdditionalColumnConfig can be used to specify additional printer columns to be included
351363// in a Resource's output from kubectl.
352364type AdditionalColumnConfig struct {
@@ -685,6 +697,19 @@ func (c *Config) GetCustomFindMethodName(resourceName string) string {
685697 return ""
686698}
687699
700+ func (c * Config ) GetCustomDeleteMethodName (resourceName string ) string {
701+ if c == nil {
702+ return ""
703+ }
704+ rConfig , found := c .Resources [resourceName ]
705+ if found {
706+ if rConfig .DeleteOperation != nil {
707+ return rConfig .DeleteOperation .CustomMethodName
708+ }
709+ }
710+ return ""
711+ }
712+
688713// GetAllRenames returns all of the CRD's field renames observed in the generator config
689714// for a given map of operations.
690715func (c * Config ) GetAllRenames (
0 commit comments