Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/setup-go/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ runs:
steps:
- name: Install Go
id: setup-go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: ${{ inputs.go-version }}
check-latest: true
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ jobs:
matrix:
goos: [windows, linux]
root: ["", test] # cannot specify "./... ./test/..." unless in go workspace
tags: [""]
include:
# add LCOW/WCOW specific configurations
- goos: windows
root: ""
tags: lcow
- goos: windows
root: ""
tags: wcow

steps:
- name: Checkout
Expand All @@ -36,14 +45,15 @@ jobs:
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.1
version: v2.11
args: >-
--verbose
--max-issues-per-linter=0
--max-same-issues=0
--modules-download-mode=readonly
--timeout=10m
--config=${{ github.workspace }}/.golangci.yml
${{ case(matrix.tags != '', format('--build-tags {0}', matrix.tags), '') }}
working-directory: ${{ github.workspace }}/${{ matrix.root }}
env:
GOOS: ${{ matrix.goos }}
Expand Down Expand Up @@ -269,8 +279,7 @@ jobs:
strategy:
fail-fast: false
matrix:
name:
[windows-2022]
name: [windows-2022]
include:
- name: "windows-2022"
runner: [self-hosted, 1ES.Pool=containerplat-github-runner-pool-east-us-2, 1ES.ImageOverride=github-mms-ws2022-containers-enabled]
Expand Down
8 changes: 4 additions & 4 deletions hcn/hcnnamespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ import (

// NamespaceResourceEndpoint represents an Endpoint attached to a Namespace.
type NamespaceResourceEndpoint struct {
Id string `json:"ID,"`
Id string `json:"ID"`
}

// NamespaceResourceContainer represents a Container attached to a Namespace.
type NamespaceResourceContainer struct {
Id string `json:"ID,"`
Id string `json:"ID"`
}

// NamespaceResourceType determines whether the Namespace resource is a Container or Endpoint.
Expand All @@ -38,8 +38,8 @@ var (

// NamespaceResource is associated with a namespace
type NamespaceResource struct {
Type NamespaceResourceType `json:","` // Container, Endpoint
Data json.RawMessage `json:","`
Type NamespaceResourceType `json:""` // Container, Endpoint
Data json.RawMessage `json:""`
}

// NamespaceType determines whether the Namespace is for a Host or Guest
Expand Down
18 changes: 9 additions & 9 deletions hcn/hcnpolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ const (
// AclPolicySetting creates firewall rules on an endpoint
type AclPolicySetting struct {
Protocols string `json:",omitempty"` // EX: 6 (TCP), 17 (UDP), 1 (ICMPv4), 58 (ICMPv6), 2 (IGMP)
Action ActionType `json:","`
Direction DirectionType `json:","`
Action ActionType `json:""`
Direction DirectionType `json:""`
LocalAddresses string `json:",omitempty"`
RemoteAddresses string `json:",omitempty"`
LocalPorts string `json:",omitempty"`
Expand Down Expand Up @@ -161,8 +161,8 @@ type SDNRoutePolicySetting struct {
// NetworkACLPolicySetting creates ACL rules on a network
type NetworkACLPolicySetting struct {
Protocols string `json:",omitempty"` // EX: 6 (TCP), 17 (UDP), 1 (ICMPv4), 58 (ICMPv6), 2 (IGMP)
Action ActionType `json:","`
Direction DirectionType `json:","`
Action ActionType `json:""`
Direction DirectionType `json:""`
LocalAddresses string `json:",omitempty"`
RemoteAddresses string `json:",omitempty"`
LocalPorts string `json:",omitempty"`
Expand Down Expand Up @@ -267,12 +267,12 @@ type LayerConstraintNetworkPolicySetting struct {

// VlanPolicySetting isolates a subnet with VLAN tagging.
type VlanPolicySetting struct {
IsolationId uint32 `json:","`
IsolationId uint32 `json:""`
}

// VsidPolicySetting isolates a subnet with VSID tagging.
type VsidPolicySetting struct {
IsolationId uint32 `json:","`
IsolationId uint32 `json:""`
}

// RemoteSubnetRoutePolicySetting creates remote subnet route rules on a network
Expand Down Expand Up @@ -330,7 +330,7 @@ type L4ProxyPolicySetting struct {
type TierAclRule struct {
Id string `json:",omitempty"`
Protocols string `json:",omitempty"`
TierAclRuleAction ActionType `json:","`
TierAclRuleAction ActionType `json:""`
LocalAddresses string `json:",omitempty"`
RemoteAddresses string `json:",omitempty"`
LocalPorts string `json:",omitempty"`
Expand All @@ -340,8 +340,8 @@ type TierAclRule struct {

// TierAclPolicySetting represents a Tier containing ACLs
type TierAclPolicySetting struct {
Name string `json:","`
Direction DirectionType `json:","`
Name string `json:""`
Direction DirectionType `json:""`
Order uint16 `json:""`
TierAclRules []TierAclRule `json:",omitempty"`
}
6 changes: 3 additions & 3 deletions internal/gcs/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func (p *Process) Close() error {

// CloseStdin causes the process to read EOF on its stdin stream.
func (p *Process) CloseStdin(ctx context.Context) (err error) {
ctx, span := oc.StartSpan(ctx, "gcs::Process::CloseStdin") //nolint:ineffassign,staticcheck
_, span := oc.StartSpan(ctx, "gcs::Process::CloseStdin")
defer span.End()
defer func() { oc.SetSpanStatus(span, err) }()
span.AddAttributes(
Expand All @@ -159,7 +159,7 @@ func (p *Process) CloseStdin(ctx context.Context) (err error) {
}

func (p *Process) CloseStdout(ctx context.Context) (err error) {
ctx, span := oc.StartSpan(ctx, "gcs::Process::CloseStdout") //nolint:ineffassign,staticcheck
_, span := oc.StartSpan(ctx, "gcs::Process::CloseStdout")
defer span.End()
defer func() { oc.SetSpanStatus(span, err) }()
span.AddAttributes(
Expand All @@ -170,7 +170,7 @@ func (p *Process) CloseStdout(ctx context.Context) (err error) {
}

func (p *Process) CloseStderr(ctx context.Context) (err error) {
ctx, span := oc.StartSpan(ctx, "gcs::Process::CloseStderr") //nolint:ineffassign,staticcheck
_, span := oc.StartSpan(ctx, "gcs::Process::CloseStderr")
defer span.End()
defer func() { oc.SetSpanStatus(span, err) }()
span.AddAttributes(
Expand Down
4 changes: 2 additions & 2 deletions internal/guest/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ func GenerateEtcHostsContent(ctx context.Context, hostname string) string {
buf := bytes.Buffer{}
buf.WriteString("127.0.0.1 localhost\n")
if len(nameParts) > 1 {
buf.WriteString(fmt.Sprintf("127.0.0.1 %s %s\n", hostname, nameParts[0]))
fmt.Fprintf(&buf, "127.0.0.1 %s %s\n", hostname, nameParts[0])
} else {
buf.WriteString(fmt.Sprintf("127.0.0.1 %s\n", hostname))
fmt.Fprintf(&buf, "127.0.0.1 %s\n", hostname)
}
buf.WriteString("\n")
buf.WriteString("# The following lines are desirable for IPv6 capable hosts\n")
Expand Down
Loading