Skip to content

Commit

Permalink
chore: remove need for root
Browse files Browse the repository at this point in the history
  • Loading branch information
squakez committed Feb 27, 2023
1 parent b910564 commit 2e35ba1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
10 changes: 5 additions & 5 deletions pkg/controller/catalog/catalog_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ import (
"github.com/apache/camel-k/pkg/util/monitoring"
)

// Add creates a new catalog Controller and adds it to the Manager. The Manager will set fields on the Controller
// Add creates a new Catalog Controller and adds it to the Manager. The Manager will set fields on the Controller
// and Start it when the Manager is Started.
func Add(ctx context.Context, mgr manager.Manager, c client.Client) error {
return add(mgr, newReconciler(mgr, c))
}

func newReconciler(mgr manager.Manager, c client.Client) reconcile.Reconciler {
return monitoring.NewInstrumentedReconciler(
&reconcilecatalog{
&reconcileCatalog{
client: c,
scheme: mgr.GetScheme(),
recorder: mgr.GetEventRecorderFor("camel-k-catalog-controller"),
Expand Down Expand Up @@ -94,10 +94,10 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error {
Complete(r)
}

var _ reconcile.Reconciler = &reconcilecatalog{}
var _ reconcile.Reconciler = &reconcileCatalog{}

// reconcilecatalog reconciles a catalog object.
type reconcilecatalog struct {
type reconcileCatalog struct {
// This client, initialized using mgr.Client() above, is a split client
// that reads objects from the cache and writes to the API server
client client.Client
Expand All @@ -110,7 +110,7 @@ type reconcilecatalog struct {
// Note:
// The Controller will requeue the Request to be processed again if the returned error is non-nil or
// Result.Requeue is true, otherwise upon completion it will remove the work from the queue.
func (r *reconcilecatalog) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error) {
func (r *reconcileCatalog) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error) {
rlog := Log.WithValues("request-namespace", request.Namespace, "request-name", request.Name)
rlog.Info("Reconciling CamelCatalog")

Expand Down
2 changes: 0 additions & 2 deletions pkg/controller/catalog/initialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ func initialize(options spectrum.Options, registryAddress string, catalog *v1.Ca
// Now we properly set the base and the target image
options.Base = catalog.Spec.GetQuarkusToolingImage()
options.Target = imageName
// TODO properly build in the container withouth being root
options.RunAs = "0"

err := buildRuntimeBuilderImage(options)

Expand Down
4 changes: 2 additions & 2 deletions pkg/resources/resources.go

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

0 comments on commit 2e35ba1

Please sign in to comment.