Skip to content

Commit 338ecb0

Browse files
authored
Merge pull request #899 from SchSeba/support_aws
Support aws
2 parents d34e85b + f6f629d commit 338ecb0

File tree

33 files changed

+2213
-192
lines changed

33 files changed

+2213
-192
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ manifests: controller-gen
109109
check-manifests: manifests
110110
@set +e; git diff --quiet config; \
111111
if [ $$? -eq 1 ]; \
112-
then echo -e "\n`config` folder is out of date. Please run `make manifests` and commit your changes"; \
112+
then echo -e "'config' folder is out of date. Please run 'make manifests' and commit your changes"; \
113113
exit 1; fi
114114

115115
sync-manifests-%: manifests

api/v1/helper.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,7 @@ var NicIDMap = []string{}
5555

5656
var InitialState SriovNetworkNodeState
5757

58-
// NetFilterType Represents the NetFilter tags to be used
59-
type NetFilterType int
60-
6158
const (
62-
// OpenstackNetworkID network UUID
63-
OpenstackNetworkID NetFilterType = iota
64-
6559
SupportedNicIDConfigmap = "supported-nic-ids"
6660
)
6761

@@ -72,15 +66,6 @@ const (
7266
SystemdConfigurationMode ConfigurationModeType = "systemd"
7367
)
7468

75-
func (e NetFilterType) String() string {
76-
switch e {
77-
case OpenstackNetworkID:
78-
return "openstack/NetworkID"
79-
default:
80-
return fmt.Sprintf("%d", int(e))
81-
}
82-
}
83-
8469
func InitNicIDMapFromConfigMap(client kubernetes.Interface, namespace string) error {
8570
cm, err := client.CoreV1().ConfigMaps(namespace).Get(
8671
context.Background(),

api/v1/sriovnetworknodepolicy_types.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ type SriovNetworkNicSelector struct {
7676
RootDevices []string `json:"rootDevices,omitempty"`
7777
// Name of SR-IoV PF.
7878
PfNames []string `json:"pfNames,omitempty"`
79-
// Infrastructure Networking selection filter. Allowed value "openstack/NetworkID:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
79+
// Infrastructure Networking selection filter.
80+
// Allowed values:
81+
// - "openstack/NetworkID:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
82+
// - "aws/NetworkID:xxxxxxxx"
8083
NetFilter string `json:"netFilter,omitempty"`
8184
}
8285

cmd/sriov-network-config-daemon/start.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -244,12 +244,8 @@ func runStartCmd(cmd *cobra.Command, args []string) error {
244244
setupLog.Error(err, "failed to fetch node state, exiting", "node-name", startOpts.nodeName)
245245
return err
246246
}
247-
// check for a platform
248-
for key, pType := range vars.PlatformsMap {
249-
if strings.Contains(strings.ToLower(nodeInfo.Spec.ProviderID), strings.ToLower(key)) {
250-
vars.PlatformType = pType
251-
}
252-
}
247+
// set the platform type
248+
vars.PlatformType = vars.GetPlatformType(nodeInfo.Spec.ProviderID)
253249
setupLog.Info("Running on", "platform", vars.PlatformType)
254250

255251
// create helpers

config/crd/bases/sriovnetwork.openshift.io_sriovnetworknodepolicies.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,11 @@ spec:
161161
"0d58", "1572", "158b", "1013", "1015", "1017", "101b".
162162
type: string
163163
netFilter:
164-
description: Infrastructure Networking selection filter. Allowed
165-
value "openstack/NetworkID:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
164+
description: |-
165+
Infrastructure Networking selection filter.
166+
Allowed values:
167+
- "openstack/NetworkID:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
168+
- "aws/NetworkID:xxxxxxxx"
166169
type: string
167170
pfNames:
168171
description: Name of SR-IoV PF.

deployment/sriov-network-operator-chart/crds/sriovnetwork.openshift.io_sriovnetworknodepolicies.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,11 @@ spec:
161161
"0d58", "1572", "158b", "1013", "1015", "1017", "101b".
162162
type: string
163163
netFilter:
164-
description: Infrastructure Networking selection filter. Allowed
165-
value "openstack/NetworkID:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
164+
description: |-
165+
Infrastructure Networking selection filter.
166+
Allowed values:
167+
- "openstack/NetworkID:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
168+
- "aws/NetworkID:xxxxxxxx"
166169
type: string
167170
pfNames:
168171
description: Name of SR-IoV PF.

pkg/consts/platforms.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@ const (
2828
Baremetal PlatformTypes = "Baremetal"
2929
// VirtualOpenStack represents a virtual OpenStack platform
3030
VirtualOpenStack PlatformTypes = "Virtual/Openstack"
31+
// AWS represents an AWS platform
32+
AWS PlatformTypes = "AWS"
3133
)

pkg/helper/mock/mock_helper.go

Lines changed: 21 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)