Skip to content

Commit

Permalink
Regenerate core clients to be compatible with the latest changes (#1566)
Browse files Browse the repository at this point in the history
- fix hibernation override validation
- fix cloudprovider references
  • Loading branch information
feluelle authored and kushalmalani committed Feb 27, 2024
1 parent c60e97c commit 61efb70
Show file tree
Hide file tree
Showing 12 changed files with 311 additions and 74 deletions.
236 changes: 214 additions & 22 deletions astro-client-core/api.gen.go

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions astro-client-core/mocks/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 25 additions & 15 deletions astro-client-platform-core/api.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions cloud/deployment/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ func deploymentToTableRow(table *printutil.Table, d *astroplatformcore.Deploymen
clusterName := notApplicable
region := notApplicable
if d.CloudProvider != nil {
cloudProvider = *d.CloudProvider
cloudProvider = string(*d.CloudProvider)
}
if d.Region != nil {
region = *d.Region
Expand Down Expand Up @@ -1132,7 +1132,7 @@ func Update(deploymentID, name, ws, description, deploymentName, dagDeploy, exec
cloudProvider := notApplicable
region := notApplicable
if d.CloudProvider != nil {
cloudProvider = *d.CloudProvider
cloudProvider = string(*d.CloudProvider)
}
if d.Region != nil {
region = *d.Region
Expand Down
16 changes: 9 additions & 7 deletions cloud/deployment/deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ var (
dedicatedType = astroplatformcore.DeploymentTypeDEDICATED
hybridType = astroplatformcore.DeploymentTypeHYBRID
testRegion = "region"
testProvider = "provider"
testProvider = astroplatformcore.DeploymentCloudProviderGCP
testCluster = "cluster"
testWorkloadIdentity = "test-workload-identity"
mockCoreDeploymentResponse = []astroplatformcore.Deployment{
Expand Down Expand Up @@ -862,7 +862,7 @@ func TestCreate(t *testing.T) {
testUtil.InitTestConfig(testUtil.LocalPlatform)
csID := "test-cluster-id"
var (
cloudProvider = "test-provider"
cloudProvider = astroplatformcore.DeploymentCloudProviderAWS
mockCreateDeploymentResponse = astroplatformcore.CreateDeploymentResponse{
JSON200: &astroplatformcore.Deployment{
Id: "test-id",
Expand Down Expand Up @@ -1324,7 +1324,7 @@ func TestCanCiCdDeploy(t *testing.T) {

func TestUpdate(t *testing.T) { //nolint
testUtil.InitTestConfig(testUtil.LocalPlatform)
cloudProvider := "test-provider"
cloudProvider := astroplatformcore.DeploymentCloudProviderAZURE
astroMachine := "test-machine"
nodeID := "test-id"
varValue := "VALUE"
Expand Down Expand Up @@ -1873,13 +1873,14 @@ func TestUpdateDeploymentHibernationOverride(t *testing.T) {

for _, tt := range tests {
t.Run(tt.command, func(t *testing.T) {
isActive := true
mockResponse := astroplatformcore.UpdateDeploymentHibernationOverrideResponse{
HTTPResponse: &http.Response{
StatusCode: astrocore.HTTPStatus200,
},
JSON200: &astroplatformcore.DeploymentHibernationOverride{
IsHibernating: tt.IsHibernating,
IsActive: true,
IsHibernating: &tt.IsHibernating,
IsActive: &isActive,
},
}

Expand All @@ -1897,14 +1898,15 @@ func TestUpdateDeploymentHibernationOverride(t *testing.T) {

t.Run(fmt.Sprintf("%s with OverrideUntil", tt.command), func(t *testing.T) {
overrideUntil := time.Now().Add(time.Hour)
isActive := true
mockResponse := astroplatformcore.UpdateDeploymentHibernationOverrideResponse{
HTTPResponse: &http.Response{
StatusCode: astrocore.HTTPStatus200,
},
JSON200: &astroplatformcore.DeploymentHibernationOverride{
IsHibernating: tt.IsHibernating,
IsHibernating: &tt.IsHibernating,
OverrideUntil: &overrideUntil,
IsActive: true,
IsActive: &isActive,
},
}

Expand Down
2 changes: 1 addition & 1 deletion cloud/deployment/deployment_variable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func TestVariableList(t *testing.T) {

func TestVariableModify(t *testing.T) {
testUtil.InitTestConfig(testUtil.LocalPlatform)
cloudProvider := "test-provider"
cloudProvider := astroplatformcore.DeploymentCloudProviderGCP
mockUpdateDeploymentResponse := astroplatformcore.UpdateDeploymentResponse{
JSON200: &astroplatformcore.Deployment{
Id: "test-id",
Expand Down
2 changes: 1 addition & 1 deletion cloud/deployment/fromfile/fromfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var (
highAvailability = true
isDevelopmentMode = true
region = "test-region"
cloudProvider = "aws"
cloudProvider = astroplatformcore.DeploymentCloudProviderAWS
description = "description 1"
schedulerAU = 5
schedulerTestSize = astroplatformcore.DeploymentSchedulerSizeSMALL
Expand Down
Loading

0 comments on commit 61efb70

Please sign in to comment.