Skip to content

Commit d63bb1b

Browse files
committed
Add version gate for workflows
1 parent 91c90ba commit d63bb1b

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

iamctl/pkg/utils/versionRequirements.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@ package utils
2020

2121
// Minimum WSO2 Identity Server version requirements for each resource type.
2222
// If a resource type is not present in this map, there is no minimum version requirement.
23-
const ()
23+
const (
24+
MIN_VERSION_WORKFLOWS = "7.2.0"
25+
)
2426

25-
var EntityMinVersionRequirements = map[ResourceType]string{}
27+
var EntityMinVersionRequirements = map[ResourceType]string{
28+
WORKFLOWS: MIN_VERSION_WORKFLOWS,
29+
}
2630

2731
// Maximum supported WSO2 Identity Server version for each resource type.
2832
// If a resource type is not present in this map, there is no upper version limit.

iamctl/pkg/workflows/export.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func ExportAll(exportFilePath string, format string) {
3333
log.Println("Exporting workflows...")
3434
exportFilePath = filepath.Join(exportFilePath, utils.WORKFLOWS.String())
3535

36-
if utils.IsResourceTypeExcluded(utils.WORKFLOWS) {
36+
if !utils.IsEntitySupportedInVersion(utils.WORKFLOWS) || utils.IsResourceTypeExcluded(utils.WORKFLOWS) {
3737
return
3838
}
3939
workflows, err := getWorkflowList()

iamctl/pkg/workflows/import.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func ImportAll(inputDirPath string) {
3333
log.Println("Importing workflows...")
3434
importFilePath := filepath.Join(inputDirPath, utils.WORKFLOWS.String())
3535

36-
if utils.IsResourceTypeExcluded(utils.WORKFLOWS) {
36+
if !utils.IsEntitySupportedInVersion(utils.WORKFLOWS) || utils.IsResourceTypeExcluded(utils.WORKFLOWS) {
3737
return
3838
}
3939
if _, err := os.Stat(importFilePath); os.IsNotExist(err) {

0 commit comments

Comments
 (0)