Skip to content

Commit c77adb9

Browse files
committed
feat: add check for nf-k8s in newest Nextflow versions
1 parent 7aac00d commit c77adb9

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

plugins/nf-cws/src/main/nextflow/cws/CWSPlugin.groovy

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package nextflow.cws
22

33
import groovy.transform.CompileStatic
4+
import nextflow.BuildInfo
45
import nextflow.cws.wow.file.LocalPath
56
import nextflow.cws.wow.file.OfflineLocalPath
67
import nextflow.cws.wow.file.WorkdirPath
@@ -59,9 +60,28 @@ class CWSPlugin extends BasePlugin {
5960
] )
6061
}
6162

63+
private checkForK8sPlugin() {
64+
// in 25.03.0-edge, Nextflow's Kubernetes functionality was refactored into a plugin
65+
boolean isK8sPluginVersion = getWrapper()
66+
.getPluginManager()
67+
.getVersionManager()
68+
.checkVersionConstraint(BuildInfo.version, ">=25.03.0")
69+
70+
if ( isK8sPluginVersion ) {
71+
PluginWrapper searchResultNfK8s = getWrapper()
72+
.getPluginManager()
73+
.getPlugins()
74+
.find { it.getPluginId() == 'nf-k8s' }
75+
if ( searchResultNfK8s == null ) {
76+
throw new IllegalStateException("The 'nf-k8s' plugin is required by nf-cws but not loaded.")
77+
}
78+
}
79+
}
80+
6281
@Override
6382
void start() {
6483
super.start()
84+
checkForK8sPlugin()
6585
registerTraceFields()
6686
KryoHelper.register( LocalPath, LocalPathSerializer )
6787
KryoHelper.register( OfflineLocalPath, LocalPathSerializer )

0 commit comments

Comments
 (0)