Skip to content

Commit

Permalink
Merge pull request #144 from JetBrains/bugfix/Issue_with_cloud_agents
Browse files Browse the repository at this point in the history
fix: initialisation sequence
  • Loading branch information
paksv authored Jan 31, 2023
2 parents d3f4e97 + f784a1f commit d441831
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package jetbrains.buildServer.clouds.azure;

import com.intellij.openapi.diagnostic.Logger;
import java.util.Map;
import jetbrains.buildServer.clouds.CloudClientParameters;
import jetbrains.buildServer.clouds.base.AbstractCloudClient;
import jetbrains.buildServer.clouds.base.AbstractCloudImage;
Expand All @@ -34,6 +33,8 @@
import org.jetbrains.annotations.Nullable;
import org.springframework.util.CollectionUtils;

import java.util.Map;

/**
* Azure cloud client base.
*/
Expand All @@ -57,11 +58,6 @@ public AzureCloudClientBase(@NotNull final CloudClientParameters params,
return new UpdateInstancesTask<>(myApiConnector, this);
}

@Override
public boolean isInitialized() {
return true;
}

@Nullable
@Override
public G findInstanceByAgent(@NotNull final AgentDescription agent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,13 @@ import jetbrains.buildServer.clouds.base.AbstractCloudClientFactory
import jetbrains.buildServer.clouds.base.errors.TypedCloudErrorInfo
import jetbrains.buildServer.serverSide.AgentDescription
import jetbrains.buildServer.serverSide.PropertiesProcessor
import jetbrains.buildServer.serverSide.ServerSettings
import jetbrains.buildServer.web.openapi.PluginDescriptor

/**
* Constructs Azure ARM cloud clients.
*/
class AzureCloudClientFactory(cloudRegistrar: CloudRegistrar,
private val myPluginDescriptor: PluginDescriptor,
private val mySettings: ServerSettings,
private val myImagesHolder: AzureCloudImagesHolder,
private val myApiConnectorFactory: AzureApiConnectorFactory,
private val mySchedulersProvider: AzureThrottlerSchedulersProvider
Expand All @@ -53,11 +51,9 @@ class AzureCloudClientFactory(cloudRegistrar: CloudRegistrar,
override fun createNewClient(state: CloudState,
params: CloudClientParameters,
errors: Array<TypedCloudErrorInfo>): AzureCloudClient {


val parameters = params.listParameterNames().map {
it to params.getParameter(it)!!
}.toMap()
val parameters = params.listParameterNames().associateWith {
params.getParameter(it)!!
}

val apiConnector = myApiConnectorFactory.create(parameters, state.profileId)

Expand Down Expand Up @@ -112,7 +108,7 @@ class AzureCloudClientFactory(cloudRegistrar: CloudRegistrar,
}
}

override fun checkClientParams(params: CloudClientParameters): Array<TypedCloudErrorInfo>? {
override fun checkClientParams(params: CloudClientParameters): Array<TypedCloudErrorInfo> {
return emptyArray()
}

Expand All @@ -122,7 +118,7 @@ class AzureCloudClientFactory(cloudRegistrar: CloudRegistrar,
return "Azure Resource Manager"
}

override fun getEditProfileUrl(): String? {
override fun getEditProfileUrl(): String {
return myPluginDescriptor.getPluginResourcesPath("settings.html")
}

Expand Down

0 comments on commit d441831

Please sign in to comment.