Skip to content

Commit

Permalink
Makefile: move depds to end of update
Browse files Browse the repository at this point in the history
We need to do all of the updates to API content before we update the
top-level vendor directory, or we don't pull in generated

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
  • Loading branch information
stevekuznetsov committed Feb 15, 2024
1 parent 6cef2d2 commit 2f135f5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pre-commit: all verify test
build: hypershift-operator control-plane-operator control-plane-pki-operator hypershift product-cli

.PHONY: update
update: deps api api-docs app-sre-saas-template clients
update: api-deps api api-docs deps clients app-sre-saas-template

.PHONY: verify
verify: update staticcheck fmt vet promtool
Expand Down Expand Up @@ -202,6 +202,9 @@ deps:
$(GO) mod verify
$(GO) list -m -mod=readonly -json all > /dev/null
(cd hack/tools && $(GO) mod tidy && $(GO) mod vendor && $(GO) mod verify && $(GO) list -m -mod=readonly -json all > /dev/null)

.PHONY: api-deps
api-deps:
cd api && \
$(GO) mod tidy && \
$(GO) mod vendor && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ func (r *reconciler) Reconcile(ctx context.Context, _ reconcile.Request) (reconc

cfg := hypershiftv1beta1applyconfigurations.HostedControlPlane(r.hcpName, r.hcpNamespace)
cfg.Status = hypershiftv1beta1applyconfigurations.HostedControlPlaneStatus().WithNodeCount(len(nodes.Items))
_, err := r.client.HypershiftV1beta1().HostedControlPlanes(r.hcpNamespace).Apply(ctx, cfg, metav1.ApplyOptions{FieldManager: ControllerName})
_, err := r.client.HypershiftV1beta1().HostedControlPlanes(r.hcpNamespace).ApplyStatus(ctx, cfg, metav1.ApplyOptions{FieldManager: ControllerName})
return reconcile.Result{}, err
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package nodecount

import (
"fmt"
"time"

hypershiftclient "github.com/openshift/hypershift/client/clientset/clientset"
Expand All @@ -20,20 +19,16 @@ func Setup(opts *operator.HostedClusterConfigOperatorConfig) error {
if err != nil {
return err
}
if _, err := ctrl.NewControllerManagedBy(opts.Manager).
return ctrl.NewControllerManagedBy(opts.Manager).
Named(ControllerName).
For(&corev1.Node{}).
WithOptions(controller.Options{
RateLimiter: workqueue.NewItemExponentialFailureRateLimiter(1*time.Second, 10*time.Second),
}).Build(&reconciler{
}).Complete(&reconciler{
hcpName: opts.HCPName,
hcpNamespace: opts.Namespace,
client: hypershiftClient,
lister: opts.CPCluster.GetClient(),
guestClusterClient: opts.Manager.GetClient(),
}); err != nil {
return fmt.Errorf("failed setting up with a controller manager %w", err)
}

return nil
})
}

0 comments on commit 2f135f5

Please sign in to comment.