Skip to content

Commit

Permalink
Remove cloud prepare dedicate-gateway flags
Browse files Browse the repository at this point in the history
These were marked as deprecated in 0.15 to be removed in 0.16
although it wasn't done in 0.16.

Signed-off-by: Tom Pantelis <[email protected]>
  • Loading branch information
tpantelis authored and sridhargaddam committed Oct 25, 2023
1 parent 6c885f8 commit 47bd06c
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 36 deletions.
5 changes: 0 additions & 5 deletions cmd/subctl/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,8 @@ func init() {
azurePrepareCmd.Flags().IntVar(&azureConfig.Gateways, "gateways", defaultNumGateways, "Number of gateways to deploy")
// `Standard_F4s_v2` matches the most to `cd5.large` of AWS.
azurePrepareCmd.Flags().StringVar(&azureConfig.GWInstanceType, "gateway-instance", "Standard_F4s_v2", "Type of gateways instance machine")
azurePrepareCmd.Flags().BoolVar(&azureConfig.DedicatedGateway, "dedicated-gateway", true,
"Whether a dedicated gateway node has to be deployed")
cloudPrepareCmd.AddCommand(azurePrepareCmd)

_ = azurePrepareCmd.Flags().MarkDeprecated("dedicated-gateway", "to be removed in 0.16. "+
"To deploy without dedicated gateways, use the Load Balancer mode instead.")

addGeneralAzureFlags(azureCleanupCmd)
cloudCleanupCmd.AddCommand(azureCleanupCmd)
}
Expand Down
5 changes: 0 additions & 5 deletions cmd/subctl/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,6 @@ func init() {
gcpPrepareCmd.Flags().StringVar(&gcpConfig.GWInstanceType, "gateway-instance", "n1-standard-4", "Type of gateway instance machine")
gcpPrepareCmd.Flags().IntVar(&gcpConfig.Gateways, "gateways", defaultNumGateways,
"Number of gateways to deploy")
gcpPrepareCmd.Flags().BoolVar(&gcpConfig.DedicatedGateway, "dedicated-gateway", true,
"Whether a dedicated gateway node has to be deployed")

_ = gcpPrepareCmd.Flags().MarkDeprecated("dedicated-gateway", "to be removed in 0.16. "+
"To deploy without dedicated gateways, use the Load Balancer mode instead.")

cloudPrepareCmd.AddCommand(gcpPrepareCmd)

Expand Down
5 changes: 0 additions & 5 deletions cmd/subctl/rhos.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,6 @@ func init() {
"Number of gateways to deploy")
rhosPrepareCmd.Flags().StringVar(&rhosConfig.GWInstanceType, "gateway-instance", "PnTAE.CPU_4_Memory_8192_Disk_50",
"Type of gateway instance machine")
rhosPrepareCmd.Flags().BoolVar(&rhosConfig.DedicatedGateway, "dedicated-gateway", true,
"Whether a dedicated gateway node has to be deployed")

_ = rhosPrepareCmd.Flags().MarkDeprecated("dedicated-gateway", "to be removed in 0.16. "+
"To deploy without dedicated gateways, use the Load Balancer mode instead.")

cloudPrepareCmd.AddCommand(rhosPrepareCmd)

Expand Down
3 changes: 1 addition & 2 deletions pkg/cloud/azure/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import (

type Config struct {
AirGappedDeployment bool
DedicatedGateway bool
Gateways int
InfraID string
Region string
Expand Down Expand Up @@ -106,7 +105,7 @@ func RunOn(clusterInfo *cluster.Info, config *Config, status reporter.Interface,

status.End()

gwDeployer, err := azure.NewOcpGatewayDeployer(cloudInfo, azureCloud, msDeployer, config.GWInstanceType, config.DedicatedGateway)
gwDeployer, err := azure.NewOcpGatewayDeployer(cloudInfo, azureCloud, msDeployer, config.GWInstanceType, true)
if err != nil {
return status.Error(err, "Failed to initialize a GatewayDeployer config")
}
Expand Down
17 changes: 8 additions & 9 deletions pkg/cloud/gcp/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,13 @@ import (
)

type Config struct {
DedicatedGateway bool
Gateways int
InfraID string
Region string
ProjectID string
CredentialsFile string
OcpMetadataFile string
GWInstanceType string
Gateways int
InfraID string
Region string
ProjectID string
CredentialsFile string
OcpMetadataFile string
GWInstanceType string
}

// RunOn runs the given function on GCP, supplying it with a cloud instance connected to GCP and a reporter that writes to CLI.
Expand Down Expand Up @@ -109,7 +108,7 @@ func RunOn(clusterInfo *cluster.Info, config *Config, status reporter.Interface,
msDeployer := ocp.NewK8sMachinesetDeployer(restMapper, dynamicClient)
// TODO: Ideally we should be able to specify the image for GWNode, but it was seen that
// with certain images, the instance is not coming up. Needs to be investigated further.
gwDeployer := gcp.NewOcpGatewayDeployer(gcpCloudInfo, msDeployer, config.GWInstanceType, "", config.DedicatedGateway, k8sClientSet)
gwDeployer := gcp.NewOcpGatewayDeployer(gcpCloudInfo, msDeployer, config.GWInstanceType, "", true, k8sClientSet)

return function(gcpCloud, gwDeployer, status)
}
Expand Down
18 changes: 8 additions & 10 deletions pkg/cloud/rhos/rhos.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,13 @@ import (
)

type Config struct {
DedicatedGateway bool
Gateways int
InfraID string
Region string
ProjectID string
OcpMetadataFile string
CloudEntry string
GWInstanceType string
Gateways int
InfraID string
Region string
ProjectID string
OcpMetadataFile string
CloudEntry string
GWInstanceType string
}

// RunOn runs the given function on RHOS, supplying it with a cloud instance connected to RHOS and a reporter that writes to CLI.
Expand Down Expand Up @@ -101,8 +100,7 @@ func RunOn(clusterInfo *cluster.Info, config *Config, status reporter.Interface,
}
rhosCloud := rhos.NewCloud(cloudInfo)
msDeployer := ocp.NewK8sMachinesetDeployer(restMapper, dynamicClient)
gwDeployer := rhos.NewOcpGatewayDeployer(cloudInfo, msDeployer, config.ProjectID, config.GWInstanceType,
"", config.CloudEntry, config.DedicatedGateway)
gwDeployer := rhos.NewOcpGatewayDeployer(cloudInfo, msDeployer, config.ProjectID, config.GWInstanceType, "", config.CloudEntry, true)

return function(rhosCloud, gwDeployer, status)
}
Expand Down

0 comments on commit 47bd06c

Please sign in to comment.