Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract LocalContrailnetworkRepository interface.
This change extracts the old hnsManager logic as a separate adapter. It brins us closer to pure core/driver module. hnsManager package used to be responsible for creating HNS networks that are associated with Contrail subnets. Packaging: * Create adapters/secondary/local_networking * Create adapters/secondary/local_networking/simulator. Simulated HNS and related code can be implemented there. * Move everything under adapters/secondary/hns to adapters/secondary/local_networking/hns - this is the actual HNS implementation Tests: * Move old hnsManager integration tests to hns_test package, and subsequently into the same hns_test.go file. This is because ginkgo can't handle multile *_test.go files in the same package, it seems. Partial-Bug: #1778671 Change-Id: Ieaedc0bb1604f4f59f852c7b9f14025bf034a30c
- Loading branch information
Michal Kostrzewa
committed
Jun 28, 2018
1 parent
8d11cd1
commit be77379
Showing
14 changed files
with
263 additions
and
243 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
adapters/secondary/local_networking/simulator/repository.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// | ||
// Copyright (c) 2018 Juniper Networks, Inc. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package simulator | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/Juniper/contrail-windows-docker-driver/common" | ||
// We should rely on some kind of domain objects in the future - not hcsshim structs | ||
// everywhere. | ||
"github.com/Microsoft/hcsshim" | ||
) | ||
|
||
type InMemContrailNetworksRepository struct{} | ||
|
||
func (repo *InMemContrailNetworksRepository) CreateNetwork(netAdapter common.AdapterName, tenantName, networkName, subnetCIDR, defaultGW string) (*hcsshim.HNSNetwork, error) { | ||
return nil, errors.New("Not implemented yet") | ||
} | ||
func (repo *InMemContrailNetworksRepository) GetNetwork(tenantName, networkName, subnetCIDR string) (*hcsshim.HNSNetwork, error) { | ||
return nil, errors.New("Not implemented yet") | ||
} | ||
|
||
func (repo *InMemContrailNetworksRepository) DeleteNetwork(tenantName, networkName, subnetCIDR string) error { | ||
return errors.New("Not implemented yet") | ||
} | ||
|
||
func (repo *InMemContrailNetworksRepository) ListNetworks() ([]hcsshim.HNSNetwork, error) { | ||
return nil, errors.New("Not implemented yet") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.