protected override void OnExecuteOperation(DeploymentParameters parameters, ClusterManifestType clusterManifest, Infrastructure infrastructure) { var isRunningAsAdmin = AccountHelper.IsAdminUser(); if (infrastructure == null) { DeployerTrace.WriteError("Cannot continue creating or updating deployment without infrastructure information"); throw new InvalidDeploymentException(StringResources.Error_FabricDeployer_InvalidInfrastructure_Formatted); } if (parameters.Operation == DeploymentOperations.Update) { if (ShouldRemoveCurrentNode(parameters.NodeName, clusterManifest)) { #if !DotNetCoreClrLinux DeployerTrace.WriteError("Current node is not present in the manifest list for Windows Server deployments. Changing DeploymentOperation to RemoveNodeConfig"); throw new ChangeDeploymentOperationToRemoveException("Modify Operation to RemoveNodeConfig"); #else DeployerTrace.WriteInfo("CoreClrLinux: RemoveNodeConfigOperation is not enabled on Linux."); return; #endif } } AclClusterLevelCerts(clusterManifest); #if !DotNetCoreClrIOT #region Container Network Setup if (parameters.ContainerNetworkSetup) { var containerNetworkSetupOperation = new ContainerNetworkSetupOperation(); containerNetworkSetupOperation.ExecuteOperation(parameters, clusterManifest, infrastructure); } else { // Clean up docker network set up. This is needed for the SFRP scenario (there is no explicit uninstall) // when customers want to clean up container network set up through config upgrade. #if !DotNetCoreClrLinux // This check is needed to allow clean up on azure. This is symmetrical to the set up condition. if (clusterManifest.Infrastructure.Item is ClusterManifestTypeInfrastructureWindowsAzure || clusterManifest.Infrastructure.Item is ClusterManifestTypeInfrastructurePaaS) { var containerNetworkCleanupOperation = new ContainerNetworkCleanupOperation(); containerNetworkCleanupOperation.ExecuteOperation(parameters.ContainerNetworkName, parameters.Operation); } #else // This check is needed to disallow one box clean up on linux. This is symmetrical to the set up condition. // This was also needed because one box clean up resulted in an exception in the GetNetwork api. // Exception => System.Threading.Tasks.TaskCanceledException: A task was canceled if (clusterManifest.Infrastructure.Item is ClusterManifestTypeInfrastructurePaaS) { var containerNetworkCleanupOperation = new ContainerNetworkCleanupOperation(); containerNetworkCleanupOperation.ExecuteOperation(parameters.ContainerNetworkName, parameters.Operation); } #endif } #endregion #endif base.OnExecuteOperation(parameters, clusterManifest, infrastructure); if (fabricValidator.IsTVSEnabled) { #if !DotNetCoreClr // Disable compiling on windows. Need to correct when porting FabricDeployer. if (!TVSSetup.SetupInfrastructureForClaimsAuth(isRunningAsAdmin)) { DeployerTrace.WriteError("Enabling WIF failed when creating or updating deployment with claims authentication."); throw new InvalidDeploymentException(StringResources.Error_FabricDeployer_TVSSetupFailed_Formatted); } #else DeployerTrace.WriteInfo("CoreClr: Token validation service is not enabled on Linux."); #endif } }
protected override void OnExecuteOperation(DeploymentParameters parameters, ClusterManifestType clusterManifest, Infrastructure infrastructure) { var isRunningAsAdmin = AccountHelper.IsAdminUser(); if (infrastructure == null) { DeployerTrace.WriteError("Cannot continue creating or updating deployment without infrastructure information"); throw new InvalidDeploymentException(StringResources.Error_FabricDeployer_InvalidInfrastructure_Formatted); } if (parameters.Operation == DeploymentOperations.Update) { if (ShouldRemoveCurrentNode(parameters.NodeName, clusterManifest)) { #if !DotNetCoreClrLinux DeployerTrace.WriteError("Current node is not present in the manifest list for Windows Server deployments. Changing DeploymentOperation to RemoveNodeConfig"); throw new ChangeDeploymentOperationToRemoveException("Modify Operation to RemoveNodeConfig"); #else DeployerTrace.WriteInfo("CoreClrLinux: RemoveNodeConfigOperation is not enabled on Linux."); return; #endif } } #if !DotNetCoreClrLinux AclClusterLevelCerts(clusterManifest); #endif // !DotNetCoreClrLinux #if !DotNetCoreClrIOT #if DotNetCoreClrLinux BootstrapContainerSetup(); #endif // DotNetCoreClrLinux // Creates or deletes supported networks based on configuration. ManageNetworks(parameters, clusterManifest, infrastructure); #endif // !DotNetCoreClrIOT #if !DotNetCoreClrIOT && DotNetCoreClrLinux // On Linux, FabricDeployer configure operation is not called. // Adding the registry entries in create operatio. // Do not update the entries in operations other than Create/Update if (parameters.Operation == DeploymentOperations.Create || parameters.Operation == DeploymentOperations.Update) { Utility.SetFabricRegistrySettings(parameters); } #endif base.OnExecuteOperation(parameters, clusterManifest, infrastructure); if (fabricValidator.IsTVSEnabled) { #if !DotNetCoreClr // Disable compiling on windows. Need to correct when porting FabricDeployer. if (!TVSSetup.SetupInfrastructureForClaimsAuth(isRunningAsAdmin)) { DeployerTrace.WriteError("Enabling WIF failed when creating or updating deployment with claims authentication."); throw new InvalidDeploymentException(StringResources.Error_FabricDeployer_TVSSetupFailed_Formatted); } #else DeployerTrace.WriteInfo("CoreClr: Token validation service is not enabled on Linux."); #endif // !DotNetCoreClrLinux } }