Skip to content

Commit 7eb1969

Browse files
authored
fix: turn on FNN in struct used during site creation (#2655)
REST DB migrations were created to default new sites to FNN VPC creation, but a struct being used during site creation is overriding that. This PR default fixes that to so new default to FNN. ## Related issues <!-- Refer to existing GitHub issues here --> #2522 <!-- Describe what this PR does --> ## Type of Change <!-- Check one that best describes this PR --> - [ ] **Add** - New feature or capability - [ ] **Change** - Changes in existing functionality - [ ] **Fix** - Bug fixes - [ ] **Remove** - Removed features or deprecated functionality - [ ] **Internal** - Internal changes (refactoring, tests, docs, etc.) ## Breaking Changes <!-- If checked, describe the breaking changes and migration steps --> <!-- Breaking changes are not generally permitted, please discuss on a GitHub discussion or with the development team if you believe you need to break a backward compatibility guarantee --> - [ ] **This PR contains breaking changes** ## Testing <!-- How was this tested? Check all that apply --> - [ ] Unit tests added/updated - [x] Integration tests added/updated - [ ] Manual testing performed - [ ] No testing required (docs, internal refactor, etc.) ## Additional Notes <!-- Any additional context, deployment notes, or reviewer guidance -->
1 parent e77b8c6 commit 7eb1969

4 files changed

Lines changed: 20 additions & 3 deletions

File tree

rest-api/api/pkg/api/handler/site.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,10 @@ func (csh CreateSiteHandler) Handle(c echo.Context) error {
168168
IsSerialConsoleEnabled: false,
169169
Status: cdbm.SiteStatusPending,
170170
CreatedBy: dbUser.ID,
171+
// New sites default to the v2 networking posture.
171172
Config: cdbm.SiteConfig{
172-
NetworkSecurityGroup: true, // The default case for a new site is to support NSGs.
173+
NativeNetworking: true,
174+
NetworkSecurityGroup: true,
173175
},
174176
}
175177
if apiRequest.Location != nil {

rest-api/api/pkg/api/handler/site_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,19 @@ func TestCreateSiteHandler_Handle(t *testing.T) {
504504

505505
assert.Equal(t, rst.Status, cdbm.SiteStatusPending)
506506
assert.Equal(t, len(rst.StatusHistory), 1)
507+
require.NotNil(t, rst.Capabilities)
508+
assert.True(t, rst.Capabilities.NativeNetworking)
509+
assert.True(t, rst.Capabilities.NetworkSecurityGroup)
510+
511+
createdSiteID, perr := uuid.Parse(rst.ID)
512+
require.NoError(t, perr)
513+
createdSite, gerr := cdbm.NewSiteDAO(tt.fields.dbSession).GetByID(
514+
context.Background(), nil, createdSiteID, nil, false,
515+
)
516+
require.NoError(t, gerr)
517+
require.NotNil(t, createdSite.Config)
518+
assert.True(t, createdSite.Config.NativeNetworking)
519+
assert.True(t, createdSite.Config.NetworkSecurityGroup)
507520

508521
if !tt.siteMgrDisabled {
509522
assert.NotNil(t, rst.RegistrationToken)

rest-api/sdk/standard/model_interface.go

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rest-api/sdk/standard/model_interface_create_request.go

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)