Skip to content

Commit

Permalink
nns and nnce
Browse files Browse the repository at this point in the history
Signed-off-by: Enrique Llorente <ellorent@redhat.com>
  • Loading branch information
qinqon committed Jan 31, 2024
1 parent 649ac37 commit b6ce822
Show file tree
Hide file tree
Showing 1,176 changed files with 29,523 additions and 709,670 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ KUBECTL ?= ./cluster/kubectl.sh
OPERATOR_SDK_VERSION ?= 1.21.0

GINKGO = GOFLAGS=-mod=mod go run github.com/onsi/ginkgo/v2/ginkgo@v2.11.0
CONTROLLER_GEN = GOFLAGS=-mod=mod go run sigs.k8s.io/controller-tools/cmd/controller-gen@v0.8.0
CONTROLLER_GEN = GOFLAGS=-mod=mod go run sigs.k8s.io/controller-tools/cmd/controller-gen@v0.14.0
OPM = hack/opm.sh

LOCAL_REGISTRY ?= registry:5000
Expand Down Expand Up @@ -137,7 +137,7 @@ gen-crds:
cd api && $(CONTROLLER_GEN) crd paths="./..." output:crd:artifacts:config=../deploy/crds

gen-rbac:
$(CONTROLLER_GEN) crd rbac:roleName=nmstate-operator paths="./controllers/operator/nmstate_controller.go" output:rbac:artifacts:config=deploy/operator
$(CONTROLLER_GEN) crd rbac:roleName=nmstate-operator paths="./controllers/operator/" output:rbac:artifacts:config=deploy/operator

check-gen: check-manifests check-bundle

Expand Down
3 changes: 3 additions & 0 deletions api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module github.com/nmstate/kubernetes-nmstate/api
go 1.20

require (
github.com/nmstate/nmstate/rust/src/go/api/v2 v2.0.0-00010101000000-000000000000
github.com/onsi/ginkgo/v2 v2.9.7
github.com/onsi/gomega v1.27.8
k8s.io/api v0.26.3
Expand Down Expand Up @@ -36,3 +37,5 @@ require (
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
)

replace github.com/nmstate/nmstate/rust/src/go/api/v2 => github.com/qinqon/nmstate/rust/src/go/api/v2 v2.0.0-20240125084324-0d8d55571e17
47 changes: 47 additions & 0 deletions api/go.mod.orig
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
module github.com/nmstate/kubernetes-nmstate/api

go 1.19

require (
github.com/onsi/ginkgo/v2 v2.9.7
github.com/onsi/gomega v1.27.8
k8s.io/api v0.26.3
k8s.io/apimachinery v0.27.4
sigs.k8s.io/controller-runtime v0.14.6
sigs.k8s.io/yaml v1.3.0
)

require github.com/rogpeppe/go-internal v1.11.0 // indirect

require (
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
<<<<<<< HEAD
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
=======
github.com/nmstate/nmstate/rust/src/go/api/v2 v2.2.16
golang.org/x/net v0.10.0 // indirect
golang.org/x/sys v0.9.0 // indirect
golang.org/x/text v0.9.0 // indirect
>>>>>>> f04f641cf (vendor)
golang.org/x/tools v0.9.3 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/klog/v2 v2.90.1 // indirect
k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
)

replace github.com/nmstate/nmstate/rust/src/go/api/v2 => github.com/qinqon/nmstate/rust/src/go/api/v2 v2.0.0-20230906095822-9b72fc4c5410
3 changes: 3 additions & 0 deletions api/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJ
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/jstemmer/go-junit-report/v2 v2.1.0/go.mod h1:mgHVr7VUo5Tn8OLVr1cKnLuEy0M92wdRntM99h7RkgQ=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
Expand Down Expand Up @@ -68,6 +69,8 @@ github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQg
github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w=
github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA=
github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4=
github.com/qinqon/nmstate/rust/src/go/api/v2 v2.0.0-20240125084324-0d8d55571e17 h1:gRQgrLcsVaQar3Kuk2Ez+McBw24JD50d501PlkcnG7E=
github.com/qinqon/nmstate/rust/src/go/api/v2 v2.0.0-20240125084324-0d8d55571e17/go.mod h1:dXeTq7WJFlSIysg/2JrrHl4iAfLTGycmWATiGEStH1I=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
Expand Down
3 changes: 2 additions & 1 deletion api/shared/nodenetworkconfigurationenactment_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package shared
import (
"fmt"

nmstateapiv2 "github.com/nmstate/nmstate/rust/src/go/api/v2"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
)
Expand All @@ -29,7 +30,7 @@ type NodeNetworkConfigurationEnactmentStatus struct {
// +kubebuilder:validation:XPreserveUnknownFields
// The desired state rendered for the enactment's node using
// the policy desiredState as template
DesiredState State `json:"desiredState,omitempty"`
DesiredState nmstateapiv2.NetworkState `json:"desiredState,omitempty"`

DesiredStateMetaInfo NodeNetworkConfigurationEnactmentMetaInfo `json:"desiredStateMetaInfo,omitempty"`

Expand Down
29 changes: 23 additions & 6 deletions api/shared/nodenetworkstate_types.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
/*
Copyright The Kubernetes NMState Authors.
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 shared

import (
nmstateapiv2 "github.com/nmstate/nmstate/rust/src/go/api/v2"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// NodeNetworkStateStatus is the status of the NodeNetworkState of a specific node
type NodeNetworkStateStatus struct {
// +kubebuilder:validation:XPreserveUnknownFields
CurrentState State `json:"currentState,omitempty"`
LastSuccessfulUpdateTime metav1.Time `json:"lastSuccessfulUpdateTime,omitempty"`
HostNetworkManagerVersion string `json:"hostNetworkManagerVersion,omitempty"`
HandlerNetworkManagerVersion string `json:"handlerNetworkManagerVersion,omitempty"`
HandlerNmstateVersion string `json:"handlerNmstateVersion,omitempty"`
CurrentState nmstateapiv2.NetworkState `json:"currentState,omitempty"`
LastSuccessfulUpdateTime metav1.Time `json:"lastSuccessfulUpdateTime,omitempty"`
HostNetworkManagerVersion string `json:"hostNetworkManagerVersion,omitempty"`
HandlerNetworkManagerVersion string `json:"handlerNetworkManagerVersion,omitempty"`
HandlerNmstateVersion string `json:"handlerNmstateVersion,omitempty"`

Conditions ConditionList `json:"conditions,omitempty" optional:"true"`
}
Expand Down
1 change: 0 additions & 1 deletion api/v1/zz_generated.deepcopy.go

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

4 changes: 3 additions & 1 deletion api/v1alpha1/nodenetworkconfigurationenactment_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

nmstateapiv2 "github.com/nmstate/nmstate/rust/src/go/api/v2"

"github.com/nmstate/kubernetes-nmstate/api/names"
"github.com/nmstate/kubernetes-nmstate/api/shared"
)
Expand Down Expand Up @@ -62,7 +64,7 @@ func NewEnactment(nodeName string, policy *NodeNetworkConfigurationPolicy) NodeN
Labels: names.IncludeRelationshipLabels(map[string]string{shared.EnactmentPolicyLabel: policy.Name}),
},
Status: shared.NodeNetworkConfigurationEnactmentStatus{
DesiredState: shared.NewState(""),
DesiredState: nmstateapiv2.NetworkState{},
Conditions: shared.ConditionList{},
},
}
Expand Down
108 changes: 0 additions & 108 deletions api/v1alpha1/nodenetworkstate_types_test.go

This file was deleted.

1 change: 0 additions & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

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

4 changes: 3 additions & 1 deletion api/v1beta1/nodenetworkconfigurationenactment_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

nmstateapiv2 "github.com/nmstate/nmstate/rust/src/go/api/v2"

"github.com/nmstate/kubernetes-nmstate/api/names"
"github.com/nmstate/kubernetes-nmstate/api/shared"
nmstatev1 "github.com/nmstate/kubernetes-nmstate/api/v1"
Expand Down Expand Up @@ -68,7 +70,7 @@ func NewEnactment(node *corev1.Node, policy *nmstatev1.NodeNetworkConfigurationP
}),
},
Status: shared.NodeNetworkConfigurationEnactmentStatus{
DesiredState: shared.NewState(""),
DesiredState: nmstateapiv2.NetworkState{},
Conditions: shared.ConditionList{},
},
}
Expand Down
Loading

0 comments on commit b6ce822

Please sign in to comment.