Skip to content

Commit 9a0a312

Browse files
authored
Add implementation for unsupported platforms (aws#4681)
1 parent 74a8654 commit 9a0a312

File tree

4 files changed

+124
-0
lines changed

4 files changed

+124
-0
lines changed

agent/vendor/github.com/aws/amazon-ecs-agent/ecs-agent/tmds/utils/utils_unsupported.go

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

agent/vendor/github.com/aws/amazon-ecs-agent/ecs-agent/tmds/utils/utils_windows.go

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
//go:build !linux && !windows
2+
// +build !linux,!windows
3+
4+
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License"). You may
7+
// not use this file except in compliance with the License. A copy of the
8+
// License is located at
9+
//
10+
// http://aws.amazon.com/apache2.0/
11+
//
12+
// or in the "license" file accompanying this file. This file is distributed
13+
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
14+
// express or implied. See the License for the specific language governing
15+
// permissions and limitations under the License.
16+
package utils
17+
18+
import (
19+
"errors"
20+
21+
"github.com/aws/amazon-ecs-agent/ecs-agent/tmds/handlers/v4/state"
22+
)
23+
24+
// GetDefaultNetworkInterfaces returns network interfaces with the highest priority default routes
25+
// for IPv4 and IPv6. If both default routes use the same interface, only one interface is returned.
26+
// Returns an empty slice if no default routes are found. This is only supported on linux as of now.
27+
func GetDefaultNetworkInterfaces(
28+
unknown interface{},
29+
) ([]state.NetworkInterface, error) {
30+
return nil, errors.New("not supported on unknown platform")
31+
}

ecs-agent/tmds/utils/utils_windows.go

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
//go:build windows
2+
// +build windows
3+
4+
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License"). You may
7+
// not use this file except in compliance with the License. A copy of the
8+
// License is located at
9+
//
10+
// http://aws.amazon.com/apache2.0/
11+
//
12+
// or in the "license" file accompanying this file. This file is distributed
13+
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
14+
// express or implied. See the License for the specific language governing
15+
// permissions and limitations under the License.
16+
package utils
17+
18+
import (
19+
"errors"
20+
21+
"github.com/aws/amazon-ecs-agent/ecs-agent/tmds/handlers/v4/state"
22+
)
23+
24+
// GetDefaultNetworkInterfaces returns network interfaces with the highest priority default routes
25+
// for IPv4 and IPv6. If both default routes use the same interface, only one interface is returned.
26+
// Returns an empty slice if no default routes are found. This is only supported on linux as of now.
27+
func GetDefaultNetworkInterfaces(
28+
unknown interface{},
29+
) ([]state.NetworkInterface, error) {
30+
return nil, errors.New("not supported on windows")
31+
}

0 commit comments

Comments
 (0)