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
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -493,9 +493,12 @@ fmt format: $(GOFUMPT) ## run gofumpt on $FMT_PKG (default "cni cns npm")
COVER_PKG ?= .

# run all tests
# COVER_FILTER omits folders with all files tagged with one of 'unit', '!ignore_uncovered', or '!ignore_autogenerated'
.PHONY: test-all
test-all:
go test -tags "unit" -coverpkg=$(COVER_PKG)/... -v -race -covermode atomic -coverprofile coverage.out $(COVER_PKG)/...
@$(eval COVER_FILTER=`go list --tags ignore_uncovered,ignore_autogenerated $(COVER_PKG)/... | tr '\n' ','`)
@echo Test coverpkg: $(COVER_FILTER)
go test -tags "unit" -coverpkg=$(COVER_FILTER) -v -race -covermode atomic -failfast -coverprofile=coverage.out $(COVER_PKG)/...


# run all tests
Expand Down
3 changes: 3 additions & 0 deletions cns/fakes/cnsfake.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !ignore_uncovered
// +build !ignore_uncovered

package fakes

import (
Expand Down
3 changes: 3 additions & 0 deletions cns/fakes/imdsclientfake.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !ignore_uncovered
// +build !ignore_uncovered

// Copyright 2017 Microsoft. All rights reserved.
// MIT License

Expand Down
3 changes: 3 additions & 0 deletions cns/fakes/ipampoolmonitorfake.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !ignore_uncovered
// +build !ignore_uncovered

package fakes

import (
Expand Down
3 changes: 3 additions & 0 deletions cns/fakes/nmagentclientfake.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !ignore_uncovered
// +build !ignore_uncovered

// Copyright 2020 Microsoft. All rights reserved.
// MIT License

Expand Down
3 changes: 3 additions & 0 deletions cns/fakes/requestcontrollerfake.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !ignore_uncovered
// +build !ignore_uncovered

package fakes

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !ignore_uncovered
// +build !ignore_uncovered

// Package v1alpha1 contains API Schema definitions for the networking v1alpha1 API group
// +kubebuilder:object:generate=true
// +groupName=networking.azure.com
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !ignore_uncovered
// +build !ignore_uncovered

package v1alpha1

import (
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

---
apiVersion: apiextensions.k8s.io/v1beta1
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.3.0
controller-gen.kubebuilder.io/version: v0.6.2
creationTimestamp: null
name: multitenantnetworkcontainers.networking.azure.com
spec:
Expand All @@ -15,86 +15,85 @@ spec:
plural: multitenantnetworkcontainers
singular: multitenantnetworkcontainer
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
description: MultiTenantNetworkContainer is the Schema for the MultiTenantnetworkcontainers
API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: MultiTenantNetworkContainerSpec defines the desired state of
MultiTenantNetworkContainer
properties:
interfaceName:
description: InterfaceName - the interface name for consuming Pod
type: string
network:
description: Network - customer VNet GUID
type: string
node:
description: Node - kubernetes node name
type: string
reservationID:
description: ReservationID - reservation ID for allocating IP
type: string
subnet:
description: Subnet - customer subnet name
type: string
uuid:
description: UUID - network container UUID
type: string
type: object
status:
description: MultiTenantNetworkContainerStatus defines the observed state
of MultiTenantNetworkContainer
properties:
gateway:
description: The gateway IP address
type: string
ip:
description: The IP address
type: string
ipSubnet:
description: The subnet CIDR
type: string
multiTenantInfo:
description: MultiTenantInfo holds the encap type and id
properties:
encapType:
description: EncapType is type of encapsulation
type: string
id:
description: ID of encapsulation, can be vlanid, vxlanid, gre-key,
etc depending on EncapType
format: int64
type: integer
type: object
primaryInterfaceIdentifier:
description: The primary interface identifier
type: string
state:
description: The state of network container
type: string
type: object
type: object
version: v1alpha1
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: MultiTenantNetworkContainer is the Schema for the MultiTenantnetworkcontainers
API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: MultiTenantNetworkContainerSpec defines the desired state
of MultiTenantNetworkContainer
properties:
interfaceName:
description: InterfaceName - the interface name for consuming Pod
type: string
network:
description: Network - customer VNet GUID
type: string
node:
description: Node - kubernetes node name
type: string
reservationID:
description: ReservationID - reservation ID for allocating IP
type: string
subnet:
description: Subnet - customer subnet name
type: string
uuid:
description: UUID - network container UUID
type: string
type: object
status:
description: MultiTenantNetworkContainerStatus defines the observed state
of MultiTenantNetworkContainer
properties:
gateway:
description: The gateway IP address
type: string
ip:
description: The IP address
type: string
ipSubnet:
description: The subnet CIDR
type: string
multiTenantInfo:
description: MultiTenantInfo holds the encap type and id
properties:
encapType:
description: EncapType is type of encapsulation
type: string
id:
description: ID of encapsulation, can be vlanid, vxlanid, gre-key,
etc depending on EncapType
format: int64
type: integer
type: object
primaryInterfaceIdentifier:
description: The primary interface identifier
type: string
state:
description: The state of network container
type: string
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
Expand Down
3 changes: 3 additions & 0 deletions crd/nodenetworkconfig/api/v1alpha/groupversion_info.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !ignore_uncovered
// +build !ignore_uncovered

// Package v1alpha contains API Schema definitions for the acn v1alpha API group
// +kubebuilder:object:generate=true
// +groupName=acn.azure.com
Expand Down
3 changes: 3 additions & 0 deletions crd/nodenetworkconfig/api/v1alpha/nodenetworkconfig.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !ignore_uncovered
// +build !ignore_uncovered

package v1alpha

import (
Expand Down
5 changes: 4 additions & 1 deletion npm/metrics/promutil/test-util.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !ignore_uncovered
// +build !ignore_uncovered

package promutil

import "testing"
Expand All @@ -12,7 +15,7 @@ func NotifyIfErrors(t *testing.T, errors ...error) {
}
}
if !allGood {
t.Errorf("Encountered these errors while getting metric values: ")
t.Errorf("Encountered these errors while getting Prometheus metric values: ")
for _, err := range errors {
if err != nil {
t.Errorf("%v", err)
Expand Down
3 changes: 3 additions & 0 deletions test/nnsmockserver/nnsmockserver.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !ignore_uncovered
// +build !ignore_uncovered

package nnsmockserver

import (
Expand Down
3 changes: 3 additions & 0 deletions test/utils/utils.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !ignore_uncovered
// +build !ignore_uncovered

package testingutils

import (
Expand Down
3 changes: 3 additions & 0 deletions testutils/netapi_mock.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !ignore_uncovered
// +build !ignore_uncovered

package testutils

type NetApiMock struct {
Expand Down
3 changes: 3 additions & 0 deletions testutils/store_mock.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !ignore_uncovered
// +build !ignore_uncovered

package testutils

import (
Expand Down
3 changes: 3 additions & 0 deletions tools/acncli/api/constants.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !ignore_uncovered
// +build !ignore_uncovered

package api

import (
Expand Down
3 changes: 3 additions & 0 deletions tools/acncli/cmd/cni/cni.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !ignore_uncovered
// +build !ignore_uncovered

package cni

import (
Expand Down
3 changes: 3 additions & 0 deletions tools/acncli/cmd/cni/install.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !ignore_uncovered
// +build !ignore_uncovered

package cni

import (
Expand Down
3 changes: 3 additions & 0 deletions tools/acncli/cmd/cni/logs.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !ignore_uncovered
// +build !ignore_uncovered

package cni

import (
Expand Down
3 changes: 3 additions & 0 deletions tools/acncli/cmd/cni/manager.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !ignore_uncovered
// +build !ignore_uncovered

package cni

import (
Expand Down
3 changes: 3 additions & 0 deletions tools/acncli/cmd/install.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !ignore_uncovered
// +build !ignore_uncovered

package cmd

import (
Expand Down
3 changes: 3 additions & 0 deletions tools/acncli/cmd/logs.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !ignore_uncovered
// +build !ignore_uncovered

package cmd

import (
Expand Down
3 changes: 3 additions & 0 deletions tools/acncli/cmd/manager.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !ignore_uncovered
// +build !ignore_uncovered

package cmd

import (
Expand Down
3 changes: 3 additions & 0 deletions tools/acncli/cmd/npm/get/manager.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !ignore_uncovered
// +build !ignore_uncovered

package get

import (
Expand Down
3 changes: 3 additions & 0 deletions tools/acncli/cmd/npm/npm.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !ignore_uncovered
// +build !ignore_uncovered

package npm

import (
Expand Down
3 changes: 3 additions & 0 deletions tools/acncli/cmd/root.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !ignore_uncovered
// +build !ignore_uncovered

package cmd

import (
Expand Down
3 changes: 3 additions & 0 deletions tools/acncli/installer/conflist.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !ignore_uncovered
// +build !ignore_uncovered

package installer

import (
Expand Down
3 changes: 3 additions & 0 deletions tools/acncli/installer/install.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !ignore_uncovered
// +build !ignore_uncovered

package installer

import (
Expand Down
3 changes: 3 additions & 0 deletions tools/acncli/installer/utils.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !ignore_uncovered
// +build !ignore_uncovered

package installer

import (
Expand Down
Loading