-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: module delete should work with old module templates (#2326)
- Loading branch information
Showing
4 changed files
with
120 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package kyma | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
// Compatibility, remove when old moduleTemplate definitions are removed | ||
// getOldModuleTemplate returns matching ModuleTemplate from list, based on old ModuleTemplate definitions | ||
func getOldModuleTemplate(moduleTemplates *ModuleTemplateList, moduleName, moduleChannel string) *ModuleTemplate { | ||
for _, moduleTemplate := range moduleTemplates.Items { | ||
// old module templates have name in moduleName-moduleChannel format | ||
if moduleTemplate.ObjectMeta.Name == fmt.Sprintf("%s-%s", moduleName, moduleChannel) { | ||
return &moduleTemplate | ||
} | ||
} | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters