Skip to content

Commit

Permalink
Merge pull request #150 from pliurh/upstream
Browse files Browse the repository at this point in the history
Upgrade operator-sdk to 1.9.0
  • Loading branch information
pliurh authored Jul 8, 2021
2 parents 4783061 + bc40302 commit 9d1cdd5
Show file tree
Hide file tree
Showing 750 changed files with 83,823 additions and 17,493 deletions.
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
SHELL := /bin/bash
# Setting SHELL to bash allows bash commands to be executed by recipes.
# This is a requirement for 'setup-envtest.sh' in the test target.
# Options are set to exit when a recipe line exits non-zero or a piped command fails.
SHELL = /usr/bin/env bash -o pipefail
.SHELLFLAGS = -ec
CURPATH=$(PWD)
TARGET_DIR=$(CURPATH)/build/_output
KUBECONFIG?=$(HOME)/.kube/config
Expand Down Expand Up @@ -77,7 +81,7 @@ image: ; $(info Building image...)
ENVTEST_ASSETS_DIR=$(shell pwd)/testbin
test: generate vet manifests
mkdir -p ${ENVTEST_ASSETS_DIR}
test -f ${ENVTEST_ASSETS_DIR}/setup-envtest.sh || curl -sSLo ${ENVTEST_ASSETS_DIR}/setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/v0.7.2/hack/setup-envtest.sh
test -f ${ENVTEST_ASSETS_DIR}/setup-envtest.sh || curl -sSLo ${ENVTEST_ASSETS_DIR}/setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/v0.8.3/hack/setup-envtest.sh
source ${ENVTEST_ASSETS_DIR}/setup-envtest.sh; fetch_envtest_tools $(ENVTEST_ASSETS_DIR); setup_envtest_env $(ENVTEST_ASSETS_DIR); go test ./... -coverprofile cover.out -v

# Build manager binary
Expand Down Expand Up @@ -207,15 +211,15 @@ test-e2e-validation-only:

test-e2e: generate vet manifests skopeo
mkdir -p ${ENVTEST_ASSETS_DIR}
test -f ${ENVTEST_ASSETS_DIR}/setup-envtest.sh || curl -sSLo ${ENVTEST_ASSETS_DIR}/setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/v0.7.2/hack/setup-envtest.sh
test -f ${ENVTEST_ASSETS_DIR}/setup-envtest.sh || curl -sSLo ${ENVTEST_ASSETS_DIR}/setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/v0.8.3/hack/setup-envtest.sh
source ${ENVTEST_ASSETS_DIR}/setup-envtest.sh; fetch_envtest_tools $(ENVTEST_ASSETS_DIR); setup_envtest_env $(ENVTEST_ASSETS_DIR); source hack/env.sh; go test ./test/e2e/... -timeout 60m -coverprofile cover.out -v

test-e2e-k8s: export NAMESPACE=sriov-network-operator
test-e2e-k8s: test-e2e

test-%: generate vet manifests
mkdir -p ${ENVTEST_ASSETS_DIR}
test -f ${ENVTEST_ASSETS_DIR}/setup-envtest.sh || curl -sSLo ${ENVTEST_ASSETS_DIR}/setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/v0.7.2/hack/setup-envtest.sh
test -f ${ENVTEST_ASSETS_DIR}/setup-envtest.sh || curl -sSLo ${ENVTEST_ASSETS_DIR}/setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/v0.8.3/hack/setup-envtest.sh
source ${ENVTEST_ASSETS_DIR}/setup-envtest.sh; fetch_envtest_tools $(ENVTEST_ASSETS_DIR); setup_envtest_env $(ENVTEST_ASSETS_DIR); go test ./$*/... -coverprofile cover.out -v

# deploy-setup-k8s: export NAMESPACE=sriov-network-operator
Expand Down
44 changes: 23 additions & 21 deletions PROJECT
Original file line number Diff line number Diff line change
@@ -1,53 +1,55 @@
domain: openshift.io
layout: go.kubebuilder.io/v2
layout:
- go.kubebuilder.io/v3
projectName: sriov-network-operator
repo: github.com/k8snetworkplumbingwg/sriov-network-operator
resources:
-
# TODO(user): Uncomment the below line if this resource implements a controller, else delete it.
- api:
crdVersion: v1
namespaced: true
controller: true
domain: openshift.io
group: sriovnetwork
kind: SriovNetwork
# TODO(user): Update the package path for your API if the below value is incorrect.
path: github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1
version: v1
-
# TODO(user): Uncomment the below line if this resource implements a controller, else delete it.
controller: true
- api:
crdVersion: v1
namespaced: true
controller: false
domain: openshift.io
group: sriovnetwork
kind: SriovIBNetwork
# TODO(user): Update the package path for your API if the below value is incorrect.
kind: SriovNetworkNodeState
path: github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1
version: v1
-
# TODO(user): Uncomment the below line if this resource implements a controller, else delete it.
- api:
crdVersion: v1
namespaced: true
controller: true
domain: openshift.io
group: sriovnetwork
kind: SriovNetworkNodePolicy
# TODO(user): Update the package path for your API if the below value is incorrect.
kind: SriovIBNetwork
path: github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1
version: v1
-
# TODO(user): Uncomment the below line if this resource implements a controller, else delete it.
- api:
crdVersion: v1
namespaced: true
controller: true
domain: openshift.io
group: sriovnetwork
kind: SriovNetworkNodeState
# TODO(user): Update the package path for your API if the below value is incorrect.
kind: SriovNetworkNodePolicy
path: github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1
version: v1
-
# TODO(user): Uncomment the below line if this resource implements a controller, else delete it.
- api:
crdVersion: v1
namespaced: true
controller: true
domain: openshift.io
group: sriovnetwork
kind: SriovOperatorConfig
# TODO(user): Update the package path for your API if the below value is incorrect.
path: github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1
version: v1
version: "3"
plugins:
go.sdk.operatorframework.io/v2-alpha: {}
manifests.sdk.operatorframework.io/v2: {}
scorecard.sdk.operatorframework.io/v2: {}
6 changes: 3 additions & 3 deletions api/v1/groupversion_info.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2021.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -15,8 +15,8 @@ limitations under the License.
*/

// Package v1 contains API Schema definitions for the sriovnetwork v1 API group
// +kubebuilder:object:generate=true
// +groupName=sriovnetwork.openshift.io
//+kubebuilder:object:generate=true
//+groupName=sriovnetwork.openshift.io
package v1

import (
Expand Down
29 changes: 21 additions & 8 deletions api/v1/sriovibnetwork_types.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
Copyright 2021.
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 v1

import (
Expand All @@ -10,8 +26,7 @@ import (
// SriovIBNetworkSpec defines the desired state of SriovIBNetwork
type SriovIBNetworkSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
// Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
// Important: Run "make" to regenerate code after modifying this file

// Namespace of the NetworkAttachmentDefinition custom resource
NetworkNamespace string `json:"networkNamespace,omitempty"`
Expand All @@ -33,15 +48,13 @@ type SriovIBNetworkSpec struct {
// SriovIBNetworkStatus defines the observed state of SriovIBNetwork
type SriovIBNetworkStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
// Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
// Important: Run "make" to regenerate code after modifying this file
}

// +kubebuilder:object:root=true
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status

// SriovIBNetwork is the Schema for the sriovibnetworks API
// +kubebuilder:subresource:status
// +kubebuilder:resource:path=sriovibnetworks,scope=Namespaced
type SriovIBNetwork struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand All @@ -50,7 +63,7 @@ type SriovIBNetwork struct {
Status SriovIBNetworkStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true
//+kubebuilder:object:root=true

// SriovIBNetworkList contains a list of SriovIBNetwork
type SriovIBNetworkList struct {
Expand Down
30 changes: 20 additions & 10 deletions api/v1/sriovnetwork_types.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
Copyright 2021.
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 v1

import (
Expand All @@ -8,7 +24,6 @@ import (
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// SriovNetworkSpec defines the desired state of SriovNetwork
// +k8s:openapi-gen=true
type SriovNetworkSpec struct {
// Namespace of the NetworkAttachmentDefinition custom resource
NetworkNamespace string `json:"networkNamespace,omitempty"`
Expand Down Expand Up @@ -48,20 +63,15 @@ type SriovNetworkSpec struct {
}

// SriovNetworkStatus defines the observed state of SriovNetwork
// +k8s:openapi-gen=true
type SriovNetworkStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
// Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
// Important: Run "make" to regenerate code after modifying this file
}

// +genclient
// +kubebuilder:object:root=true
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status

// SriovNetwork is the Schema for the sriovnetworks API
// +k8s:openapi-gen=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:path=sriovnetworks,scope=Namespaced
type SriovNetwork struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand All @@ -70,7 +80,7 @@ type SriovNetwork struct {
Status SriovNetworkStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true
//+kubebuilder:object:root=true

// SriovNetworkList contains a list of SriovNetwork
type SriovNetworkList struct {
Expand Down
32 changes: 20 additions & 12 deletions api/v1/sriovnetworknodepolicy_types.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
Copyright 2021.
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 v1

import (
Expand All @@ -8,8 +24,6 @@ import (
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// SriovNetworkNodePolicySpec defines the desired state of SriovNetworkNodePolicy
// +k8s:openapi-gen=true
// +kubebuilder:pruning:PreserveUnknownFields
type SriovNetworkNodePolicySpec struct {
// SRIOV Network device plugin endpoint resource name
ResourceName string `json:"resourceName"`
Expand Down Expand Up @@ -40,7 +54,6 @@ type SriovNetworkNodePolicySpec struct {
EswitchMode string `json:"eSwitchMode,omitempty"`
}

// +k8s:openapi-gen=false
type SriovNetworkNicSelector struct {
// The vendor hex code of SR-IoV device. Allowed value "8086", "15b3".
Vendor string `json:"vendor,omitempty"`
Expand All @@ -55,20 +68,15 @@ type SriovNetworkNicSelector struct {
}

// SriovNetworkNodePolicyStatus defines the observed state of SriovNetworkNodePolicy
// +k8s:openapi-gen=true
type SriovNetworkNodePolicyStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
// Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
// Important: Run "make" to regenerate code after modifying this file
}

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status

// SriovNetworkNodePolicy is the Schema for the sriovnetworknodepolicies API
// +k8s:openapi-gen=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:path=sriovnetworknodepolicies,scope=Namespaced
type SriovNetworkNodePolicy struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand All @@ -77,7 +85,7 @@ type SriovNetworkNodePolicy struct {
Status SriovNetworkNodePolicyStatus `json:"status,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
//+kubebuilder:object:root=true

// SriovNetworkNodePolicyList contains a list of SriovNetworkNodePolicy
type SriovNetworkNodePolicyList struct {
Expand Down
28 changes: 20 additions & 8 deletions api/v1/sriovnetworknodestate_types.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
Copyright 2021.
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 v1

import (
Expand All @@ -8,7 +24,6 @@ import (
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// SriovNetworkNodeStateSpec defines the desired state of SriovNetworkNodeState
// +k8s:openapi-gen=true
type SriovNetworkNodeStateSpec struct {
DpConfigVersion string `json:"dpConfigVersion,omitempty"`
Interfaces Interfaces `json:"interfaces,omitempty"`
Expand Down Expand Up @@ -66,19 +81,16 @@ type VirtualFunction struct {
}

// SriovNetworkNodeStateStatus defines the observed state of SriovNetworkNodeState
// +k8s:openapi-gen=true
type SriovNetworkNodeStateStatus struct {
Interfaces InterfaceExts `json:"interfaces,omitempty"`
SyncStatus string `json:"syncStatus,omitempty"`
LastSyncError string `json:"lastSyncError,omitempty"`
}

// +genclient
// +kubebuilder:object:root=true
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status

// SriovNetworkNodeState is the Schema for the sriovnetworknodestates API
// +k8s:openapi-gen=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:path=sriovnetworknodestates,scope=Namespaced
type SriovNetworkNodeState struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand All @@ -87,7 +99,7 @@ type SriovNetworkNodeState struct {
Status SriovNetworkNodeStateStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true
//+kubebuilder:object:root=true

// SriovNetworkNodeStateList contains a list of SriovNetworkNodeState
type SriovNetworkNodeStateList struct {
Expand Down
Loading

0 comments on commit 9d1cdd5

Please sign in to comment.