Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into remove-toolchainc…
Browse files Browse the repository at this point in the history
…onfig-capacity-thresholds

# Conflicts:
#	go.sum
  • Loading branch information
metlos committed Apr 22, 2024
2 parents c8f6990 + 6a7e692 commit 4ab5809
Show file tree
Hide file tree
Showing 27 changed files with 189 additions and 2,386 deletions.
1 change: 1 addition & 0 deletions controllers/usersignup/usersignup_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ func (r *Reconciler) checkIfMurAlreadyExists(
}

logger.Info("Setting UserSignup status to 'Complete'")

return true, r.updateStatus(ctx, userSignup, r.updateCompleteStatus(mur.Name))
}

Expand Down
9 changes: 4 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
module github.com/codeready-toolchain/host-operator

replace (
github.com/codeready-toolchain/api => github.com/metlos/api v0.0.0-20240326131121-9509925cdd79
github.com/codeready-toolchain/toolchain-common => github.com/metlos/toolchain-common v0.0.0-20240408103238-edb68ec6cfa8
github.com/codeready-toolchain/api => github.com/metlos/api v0.0.0-20240422113155-5603720d4a54
github.com/codeready-toolchain/toolchain-common => github.com/metlos/toolchain-common v0.0.0-20240422114216-5aa2ac24fd4e
)

require (
github.com/codeready-toolchain/api v0.0.0-20240322110702-5ab3840476e9
github.com/codeready-toolchain/toolchain-common v0.0.0-20240404090512-046d250d7d78
github.com/codeready-toolchain/toolchain-common v0.0.0-20240417084737-d3c148491687
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/ghodss/yaml v1.0.0
github.com/go-bindata/go-bindata v3.1.2+incompatible
github.com/go-logr/logr v1.2.3
github.com/gofrs/uuid v4.4.0+incompatible
Expand Down Expand Up @@ -98,7 +97,7 @@ require (
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/oauth2 v0.7.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -434,10 +434,10 @@ github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI=
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/metlos/api v0.0.0-20240326131121-9509925cdd79 h1:CK470udH8w1HRieGKequ1kw1iMCugAAWKyRUFV/58WE=
github.com/metlos/api v0.0.0-20240326131121-9509925cdd79/go.mod h1:cfNN6YPX4TORvhhZXMSjSPesqAHlB3nD/WAfGe4WLKQ=
github.com/metlos/toolchain-common v0.0.0-20240408103238-edb68ec6cfa8 h1:IJDBYEM7vpw/VpRyMhGMrjaPEljyemBHOUUHVmaY/us=
github.com/metlos/toolchain-common v0.0.0-20240408103238-edb68ec6cfa8/go.mod h1:YciFg9BSk48nYeoc/xVHRZ0T0lT+cS5OwTrMHdeyArA=
github.com/metlos/api v0.0.0-20240422113155-5603720d4a54 h1:HVyip4jXgdJcqHZuTU0l0cLXdlWK/oGOqVw3ufCNJvg=
github.com/metlos/api v0.0.0-20240422113155-5603720d4a54/go.mod h1:ie9p4LenCCS0LsnbWp6/xwpFDdCWYE0KWzUO6Sk1g0E=
github.com/metlos/toolchain-common v0.0.0-20240422114216-5aa2ac24fd4e h1:8BRwh2BDtUvchTS4g8b81TVSv1R8/hyhMmomwJEi2MU=
github.com/metlos/toolchain-common v0.0.0-20240422114216-5aa2ac24fd4e/go.mod h1:ckxXfOwrjJs2lwmm3xsJdXnUF72cNYTe/Kr6otcLJl0=
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
github.com/migueleliasweb/go-github-mock v0.0.18 h1:0lWt9MYmZQGnQE2rFtjlft/YtD6hzxuN6JJRFpujzEI=
github.com/migueleliasweb/go-github-mock v0.0.18/go.mod h1:CcgXcbMoRnf3rRVHqGssuBquZDIcaplxL2W6G+xs7kM=
Expand Down Expand Up @@ -770,8 +770,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down
24 changes: 12 additions & 12 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/codeready-toolchain/host-operator/controllers/toolchainstatus"
"github.com/codeready-toolchain/host-operator/controllers/usersignup"
"github.com/codeready-toolchain/host-operator/controllers/usersignupcleanup"
"github.com/codeready-toolchain/host-operator/deploy"
"github.com/codeready-toolchain/host-operator/pkg/apis"
"github.com/codeready-toolchain/host-operator/pkg/capacity"
"github.com/codeready-toolchain/host-operator/pkg/cluster"
Expand All @@ -34,6 +35,7 @@ import (
"github.com/codeready-toolchain/host-operator/pkg/templates/usertiers"
"github.com/codeready-toolchain/host-operator/version"
"github.com/codeready-toolchain/toolchain-common/controllers/toolchainclustercache"
"github.com/codeready-toolchain/toolchain-common/controllers/toolchainclusterresources"
commonclient "github.com/codeready-toolchain/toolchain-common/pkg/client"
commoncluster "github.com/codeready-toolchain/toolchain-common/pkg/cluster"
commonconfig "github.com/codeready-toolchain/toolchain-common/pkg/configuration"
Expand Down Expand Up @@ -81,20 +83,10 @@ func printVersion() {
setupLog.Info(fmt.Sprintf("BuildTime: %s", version.BuildTime))
}

//+kubebuilder:rbac:groups=toolchain.dev.openshift.com,resources=tiertemplates,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=toolchain.dev.openshift.com,resources=tiertemplates/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=toolchain.dev.openshift.com,resources=tiertemplates/finalizers,verbs=update

//+kubebuilder:rbac:groups=toolchain.dev.openshift.com,resources=usertiers,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=toolchain.dev.openshift.com,resources=usertiers/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=toolchain.dev.openshift.com,resources=usertiers/finalizers,verbs=update

//+kubebuilder:rbac:groups=toolchain.dev.openshift.com,resources=toolchainclusters,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=toolchain.dev.openshift.com,resources=toolchainclusters/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=toolchain.dev.openshift.com,resources=toolchainclusters/finalizers,verbs=update

//+kubebuilder:rbac:groups=toolchain.dev.openshift.com,resources=*,verbs=*
//+kubebuilder:rbac:groups="",resources=secrets;configmaps;services;services/finalizers;serviceaccounts;pods,verbs=get;list;watch;update;patch;create;delete
//+kubebuilder:rbac:groups=apps,resources=deployments;deployments/finalizers;replicasets,verbs=get;list;watch;update;patch;create;delete
//+kubebuilder:rbac:groups=rbac.authorization.k8s.io;authorization.openshift.io,resources=rolebindings;roles,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=monitoring.coreos.com,resources=servicemonitors,verbs=get;list;watch;update;patch;create;delete

func main() { // nolint:gocyclo
Expand Down Expand Up @@ -215,6 +207,14 @@ func main() { // nolint:gocyclo
}

// Setup all Controllers
if err = (&toolchainclusterresources.Reconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
Templates: &deploy.ToolchainClusterTemplateFS,
}).SetupWithManager(mgr, namespace); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "ToolchainClusterResources")
os.Exit(1)
}
if err = toolchainclustercache.NewReconciler(
mgr,
namespace,
Expand Down
4 changes: 0 additions & 4 deletions make/go.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ vendor:

NSTEMPLATES_BASEDIR = deploy/templates/nstemplatetiers
NSTEMPLATES_FILES = $(wildcard $(NSTEMPLATES_BASEDIR)/**/*.yaml)
NSTEMPLATES_TEST_BASEDIR = test/templates/nstemplatetiers

USERTEMPLATES_BASEDIR = deploy/templates/usertiers
USERTEMPLATES_TEST_BASEDIR = test/templates/usertiers
Expand Down Expand Up @@ -57,9 +56,6 @@ generate-assets: go-bindata
@echo "generating bindata for files in $(NSTEMPLATES_BASEDIR) ..."
@rm ./pkg/templates/nstemplatetiers/nstemplatetier_assets.go 2>/dev/null || true
@$(GO_BINDATA) -pkg nstemplatetiers -o ./pkg/templates/nstemplatetiers/nstemplatetier_assets.go -nometadata -nocompress -prefix $(NSTEMPLATES_BASEDIR) $(NSTEMPLATES_BASEDIR)/...
@echo "generating bindata for files in $(NSTEMPLATES_TEST_BASEDIR) ..."
@rm ./test/templates/nstemplatetiers/nstemplatetier_assets.go 2>/dev/null || true
@$(GO_BINDATA) -pkg nstemplatetiers_test -o ./test/templates/nstemplatetiers/nstemplatetier_assets.go -nometadata -nocompress -prefix $(NSTEMPLATES_TEST_BASEDIR) -ignore doc.go $(NSTEMPLATES_TEST_BASEDIR)/...

@echo "generating bindata for files in $(USERTEMPLATES_BASEDIR) ..."
@rm ./pkg/templates/usertiers/usertier_assets.go 2>/dev/null || true
Expand Down
Loading

0 comments on commit 4ab5809

Please sign in to comment.