File tree 1 file changed +9
-2
lines changed
src/main/java/cd/go/contrib/elasticagent
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -122,8 +122,15 @@ private void refreshInstancesForAllClusters(List<ClusterProfileProperties> listO
122
122
}
123
123
}
124
124
125
- private AgentInstances <KubernetesInstance > getAgentInstancesFor (ClusterProfileProperties clusterProfileProperties ) {
126
- return clusterSpecificAgentInstances .get (clusterProfileProperties .uuid ());
125
+ private AgentInstances <KubernetesInstance > getAgentInstancesFor (ClusterProfileProperties clusterProfileProperties ) throws Exception {
126
+ KubernetesAgentInstances agentInstances = clusterSpecificAgentInstances .get (clusterProfileProperties .uuid ());
127
+
128
+ //initalize agent instances if those are null
129
+ if (agentInstances == null ) {
130
+ refreshInstancesForCluster (clusterProfileProperties );
131
+ }
132
+
133
+ return agentInstances ;
127
134
}
128
135
129
136
private void refreshInstancesForCluster (ClusterProfileProperties clusterProfileProperties ) throws Exception {
You can’t perform that action at this time.
0 commit comments