Skip to content

Commit

Permalink
Fix merge conflicts for 4.11
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
  • Loading branch information
ArangoGutierrez committed Jun 28, 2022
1 parent 671aeec commit 0baa776
Show file tree
Hide file tree
Showing 36 changed files with 684 additions and 1,468 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ GOBIN=$(shell go env GOBIN)
endif

GOOS=linux
GO_CMD ?= go
GO_FMT ?= gofmt
GO=GOOS=$(GOOS) GO111MODULE=on CGO_ENABLED=0 GOFLAGS=-mod=vendor go
LDFLAGS= -ldflags "-s -w -X $(PACKAGE)/version.Version=$(VERSION)"

Expand Down
10 changes: 5 additions & 5 deletions PROJECT
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
domain: nodefeaturediscoveries.nfd.openshift.io
layout: go.kubebuilder.io/v3
projectName: nfd-operator
repo: github.com/kubernetes-sigs/node-feature-discovery-operator
projectName: nfd
repo: github.com/openshift/cluster-nfd-operator
resources:
- api:
crdVersion: v1
namespaced: true
controller: true
domain: nodefeaturediscoveries.nfd.kubernetes.io
group: nfd.kubernetes.io
domain: nodefeaturediscoveries.nfd.openshift.io
group: nfd.openshift.io
kind: NodeFeatureDiscovery
path: github.com/kubernetes-sigs/node-feature-discovery-operator/api/v1
path: github.com/openshift/cluster-nfd-operator/api/v1
version: v1
version: "3"
plugins:
Expand Down
41 changes: 7 additions & 34 deletions api/v1/nodefeaturediscovery_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ limitations under the License.
package v1

import (
"os"

conditionsv1 "github.com/openshift/custom-resource-status/conditions/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand All @@ -34,24 +31,11 @@ type NodeFeatureDiscoverySpec struct {
// resources on a worker node to account for resources available to be
// allocated to new pod on a per-zone basis
// https://kubernetes-sigs.github.io/node-feature-discovery/v0.10/get-started/introduction.html#nfd-topology-updater
<<<<<<< HEAD
//
// +optional
TopologyUpdater bool `json:"topologyupdater"`

WorkerConfig *ConfigMap `json:"workerConfig,omitempty"`

// Run NFD in multiple deployment mode
// https://kubernetes-sigs.github.io/node-feature-discovery/v0.8/advanced/master-commandline-reference.html#-instance
//
// +nullable
=======
// +optional
TopologyUpdater bool `json:"topologyUpdater"`

// Instance name. Used to separate annotation namespaces for
// multiple parallel deployments.
>>>>>>> 809780db (Enable TopologyUpdater worker)
// +optional
Instance string `json:"instance"`

Expand All @@ -77,24 +61,20 @@ type NodeFeatureDiscoverySpec struct {
// WorkerConfig describes configuration options for the NFD
// worker.
// +optional
CustomConfig ConfigMap `json:"customConfig"`
WorkerConfig ConfigMap `json:"workerConfig"`
}

// OperandSpec describes configuration options for the operand
type OperandSpec struct {
// Image defines the image to pull for the
// NFD operand
//
// [defaults to k8s.gcr.io/nfd/node-feature-discovery]
// +kubebuilder:validation:Pattern=[a-zA-Z0-9\-]+
// +nullable
// +optional
Image string `json:"image,omitempty"`

// ImagePullPolicy defines Image pull policy for the
// NFD operand image [defaults to Always]
//
// +nullable
// +optional
// +kubebuilder:validation:Optional
ImagePullPolicy string `json:"imagePullPolicy,omitempty"`

// ServicePort specifies the TCP port that nfd-master
Expand All @@ -115,27 +95,25 @@ type NodeFeatureDiscoveryStatus struct {
// Conditions represents the latest available observations of current state.
//
// +optional
Conditions []conditionsv1.Condition `json:"conditions,omitempty"`
Conditions []metav1.Condition `json:"conditions,omitempty"`
}

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:path=nodefeaturediscoveries,scope=Namespaced
//
// An Node Feature Discovery cluster instance
// +operator-sdk:csv:customresourcedefinitions:displayName="NodeFeatureDiscovery"
// NodeFeatureDiscovery is the Schema for the nodefeaturediscoveries API
type NodeFeatureDiscovery struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

// Specification of the desired behavior of the Node Feature Discovery
Spec NodeFeatureDiscoverySpec `json:"spec,omitempty"`
Status NodeFeatureDiscoveryStatus `json:"status,omitempty"`
}

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

//
// NodeFeatureDiscoveryList contains a list of NodeFeatureDiscovery
type NodeFeatureDiscoveryList struct {
metav1.TypeMeta `json:",inline"`
Expand All @@ -149,12 +127,7 @@ func init() {

// ImagePath returns a compiled full valid image string
func (o *OperandSpec) ImagePath() string {
if o.Image != "" {
return o.Image
}

image := os.Getenv("NODE_FEATURE_DISCOVERY_IMAGE")
return image
return o.Image
}

// ImagePolicy returns a valid corev1.PullPolicy from the string in the CR
Expand Down
12 changes: 4 additions & 8 deletions api/v1/zz_generated.deepcopy.go

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

25 changes: 2 additions & 23 deletions build/assets/master/0400_master_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,33 +54,12 @@ spec:
imagePullPolicy: Always
command:
- "nfd-master"
- "--extra-label-ns=nvidia.com"
args: []
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
volumeMounts: []
livenessProbe:
exec:
command:
- /usr/bin/grpc_health_probe
- -addr=:12000
failureThreshold: 3
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
readinessProbe:
exec:
command:
- /usr/bin/grpc_health_probe
- -addr=:12000
failureThreshold: 10
initialDelaySeconds: 5
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
volumes: []
runAsNonRoot: true
2 changes: 1 addition & 1 deletion build/assets/topologyupdater/03_clusterrolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ roleRef:
subjects:
- kind: ServiceAccount
name: nfd-topology-updater
namespace: node-feature-discovery
namespace: openshift-nfd
3 changes: 1 addition & 2 deletions build/assets/worker/01_worker_sa.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: nfd-worker

name: nfd-worker
2 changes: 2 additions & 0 deletions build/assets/worker/0610_scc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ seLinuxContext:
type: MustRunAs
supplementalGroups:
type: MustRunAs
seccompProfiles:
- '*'
users:
- system:serviceaccount:openshift-nfd:nfd-worker
volumes:
Expand Down
4 changes: 2 additions & 2 deletions config/certmanager/certificate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: selfsigned-issuer
namespace: node-feature-discovery-operator
namespace: openshift-nfd-operator
spec:
selfSigned: {}
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: serving-cert # this name should match the one appeared in kustomizeconfig.yaml
namespace: node-feature-discovery-operator
namespace: openshift-nfd-operator
spec:
# $(SERVICE_NAME) and $(SERVICE_NAMESPACE) will be substituted by kustomize
dnsNames:
Expand Down
Loading

0 comments on commit 0baa776

Please sign in to comment.