Skip to content

Commit

Permalink
Merge pull request cscetbon#131 from AKamyshnikova/fix-multicasskop-g…
Browse files Browse the repository at this point in the history
…roup

Fix groupversion for multicasskop
  • Loading branch information
AKamyshnikova authored Oct 30, 2023
2 parents a2cbc87 + 61521b5 commit 22d1905
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 23 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"os"
"path"
"runtime"
"sigs.k8s.io/controller-runtime/pkg/cache"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -162,8 +163,7 @@ func main() {
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
MetricsBindAddress: metricsAddr,
Port: 9443,
Namespace: namespace,
Cache: cache.Options{Namespaces: []string{namespace}},
HealthProbeBindAddress: probeAddr,
})
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions multi-casskop/api/v2/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.

// Package v2 contains API Schema definitions for the multicasskops.db.orange.com v2 API group
// +kubebuilder:object:generate=true
// +groupName=multicasskops.db.orange.com
// +groupName=db.orange.com
package v2

import (
Expand All @@ -26,7 +26,7 @@ import (

var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "multicasskops.db.orange.com", Version: "v2"}
GroupVersion = schema.GroupVersion{Group: "db.orange.com", Version: "v2"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
Expand Down
12 changes: 5 additions & 7 deletions multi-casskop/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ require (
sigs.k8s.io/controller-runtime v0.15.0
)

require (
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/onsi/gomega v1.19.0 // indirect
)

replace github.com/cscetbon/casskop => ../

require (
cloud.google.com/go v0.97.0 // indirect
github.com/antihax/optional v1.0.0 // indirect
Expand All @@ -36,11 +29,15 @@ require (
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/instaclustr/instaclustr-icarus-go-client v0.0.0-20210427160512-5264f1cbba08 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/onsi/gomega v1.19.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.5.0 // indirect
Expand All @@ -63,6 +60,7 @@ require (

replace (
github.com/Azure/go-autorest => github.com/Azure/go-autorest v13.3.2+incompatible // Required by OLM
github.com/cscetbon/casskop => ../
github.com/go-logr/logr => github.com/go-logr/logr v0.4.0
github.com/go-logr/zapr => github.com/go-logr/zapr v1.2.4
github.com/operator-framework/operator-sdk => github.com/operator-framework/operator-sdk v1.13.0
Expand Down
7 changes: 6 additions & 1 deletion multi-casskop/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -520,8 +520,9 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxv
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
Expand Down Expand Up @@ -621,6 +622,7 @@ github.com/pborman/uuid v0.0.0-20180906182336-adf5a7427709/go.mod h1:VyrYX9gd7ir
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/petar/GoLLRB v0.0.0-20130427215148-53be0d36a84c/go.mod h1:HUpKUBZnpzkdx0kD/+Yfuft+uD3zHGtXF/XJB14TUr4=
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
Expand Down Expand Up @@ -669,6 +671,9 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.0.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
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/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
Expand Down
31 changes: 20 additions & 11 deletions multi-casskop/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,22 @@ package main

import (
"fmt"
"runtime"

"github.com/cscetbon/casskop/multi-casskop/controllers"
apimachineryruntime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/sample-controller/pkg/signals"

// "flag"
"log"
"net/http"
"os"
"runtime"
"strings"

"github.com/jessevdk/go-flags"

"k8s.io/client-go/rest"

"admiralty.io/multicluster-controller/pkg/cluster"
"admiralty.io/multicluster-controller/pkg/manager"
"admiralty.io/multicluster-service-account/pkg/config"
"github.com/cscetbon/casskop/multi-casskop/controllers"
"github.com/jessevdk/go-flags"
"github.com/sirupsen/logrus"
apimachineryruntime "k8s.io/apimachinery/pkg/runtime"
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
"k8s.io/client-go/rest"
"k8s.io/sample-controller/pkg/signals"
kconfig "sigs.k8s.io/controller-runtime/pkg/client/config"
)

Expand Down Expand Up @@ -162,6 +158,19 @@ func main() {

m := manager.New()
m.AddController(co)
// TODO: create more meaningful checks
http.HandleFunc("/readyz", func(writer http.ResponseWriter, request *http.Request) {
writer.WriteHeader(http.StatusOK)
})
http.HandleFunc("/healthz", func(writer http.ResponseWriter, request *http.Request) {
writer.WriteHeader(http.StatusOK)
})
go func() {
err := http.ListenAndServe(":8081", nil)
if err != nil {
log.Fatalf("failed to run readyness/liveness checks")
}
}()

logrus.Info("Starting Manager.")
if err := m.Start(signals.SetupSignalHandler()); err != nil {
Expand Down

0 comments on commit 22d1905

Please sign in to comment.