Skip to content

Commit

Permalink
ovn: make ovn probe building optional
Browse files Browse the repository at this point in the history
building ovn probe has become a bit more complicated. Make it optional
so that the cost is not payed by users not wanting to use the probe

Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
  • Loading branch information
amorenoz committed Jul 12, 2021
1 parent 3a11d11 commit bc41dcc
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 7 deletions.
12 changes: 6 additions & 6 deletions .mk/ovn.mk
Expand Up @@ -14,14 +14,14 @@ $(GEN_BIN):

.PHONY: .ovnmodel
.ovnmodel: $(SCHEMA_FILE) $(GEN_BIN)
# TODO: add WITH_OVN flag
#ifeq ($(WITH_OVN), true)
go generate -tags "${BUILD_TAGS}" topology/probes/ovn/ovnmodel/gen.go
#endif
ifeq ($(WITH_OVN), true)
@go generate -tags "${BUILD_TAGS}" topology/probes/ovn/ovnmodel/gen.go
endif

.PHONY: .ovnmodel.clean
.ovnmodel.clean:
@grep -r 'generated by ovnmetagen' $(MODEL_DIR) | cut -d: -f 1 | xargs rm -f
ifeq ($(WITH_OVN), true)
@find $(MODEL_DIR) -name "*.go" | xargs grep 'generated by ovnmetagen' | cut -d: -f 1 | xargs rm -f
@rm -f $(SCHEMA_FILE)
@rm -f $(GEN_BIN)

endif
6 changes: 5 additions & 1 deletion Makefile
Expand Up @@ -98,8 +98,12 @@ ifeq ($(WITH_PACKETINJECT), true)
BUILD_TAGS+=packetinject
endif

ifeq ($(WITH_OVN), true)
BUILD_TAGS+=ovn
endif

ifeq ($(WITH_OVNK8S), true)
BUILD_TAGS+=k8s ovnk8s
BUILD_TAGS+=k8s ovn ovnk8s
endif


Expand Down
34 changes: 34 additions & 0 deletions topology/probes/ovn/no_ovn.go
@@ -0,0 +1,34 @@
// +build !ovn

/*
* Copyright (C) 2019 Red Hat, Inc.
*
* 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 ofthe 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 specificlanguage governing permissions and
* limitations under the License.
*
*/

package ovn

import (
"github.com/skydive-project/skydive/graffiti/graph"
"github.com/skydive-project/skydive/probe"
)

// NewProbe returns a new OVN topology probe
func NewProbe(g *graph.Graph, address string, certFile string, keyFile string, cacertFile string) (probe.Handler, error) {
return nil, probe.ErrNotImplemented
}

// Register registers graph metadata decoders
func Register() {
}
2 changes: 2 additions & 0 deletions topology/probes/ovn/ovn.go
@@ -1,3 +1,5 @@
// +build ovn

/*
* Copyright (C) 2019 Red Hat, Inc.
*
Expand Down

0 comments on commit bc41dcc

Please sign in to comment.