lburgazzoli closed pull request #281: chore(dev) make dev mode 10x faster on remote clusters by caching client URL: https://github.com/apache/camel-k/pull/281
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/pkg/client/cmd/install.go b/pkg/client/cmd/install.go index 5b86a8b..2bafe94 100644 --- a/pkg/client/cmd/install.go +++ b/pkg/client/cmd/install.go @@ -19,6 +19,8 @@ package cmd import ( "fmt" + "github.com/operator-framework/operator-sdk/pkg/k8sclient" + "time" "github.com/apache/camel-k/pkg/install" "github.com/pkg/errors" @@ -56,6 +58,9 @@ type installCmdOptions struct { } func (o *installCmdOptions) install(cmd *cobra.Command, args []string) error { + // Let's use a fast refresh period when running with the CLI + k8sclient.ResetCacheEvery(8 * time.Second) + err := install.SetupClusterwideResources() if err != nil && k8serrors.IsForbidden(err) { fmt.Println("Current user is not authorized to create cluster-wide objects like custom resource definitions or cluster roles: ", err) diff --git a/pkg/client/cmd/root.go b/pkg/client/cmd/root.go index c69f063..ed02838 100644 --- a/pkg/client/cmd/root.go +++ b/pkg/client/cmd/root.go @@ -19,10 +19,6 @@ package cmd import ( "context" - "time" - - "github.com/operator-framework/operator-sdk/pkg/k8sclient" - "github.com/apache/camel-k/pkg/util/kubernetes" "github.com/pkg/errors" "github.com/spf13/cobra" @@ -63,9 +59,6 @@ func NewKamelCommand(ctx context.Context) (*cobra.Command, error) { } } - // Let's use a fast refresh period when running with the CLI - k8sclient.ResetCacheEvery(2 * time.Second) - // Initialize the Kubernetes client to allow using the operator-sdk return kubernetes.InitKubeClient(options.KubeConfig) }, diff --git a/pkg/install/operator.go b/pkg/install/operator.go index 3af6a0e..147bbb5 100644 --- a/pkg/install/operator.go +++ b/pkg/install/operator.go @@ -87,7 +87,7 @@ func installKnative(namespace string) error { // Platform installs the platform custom resource func Platform(namespace string, registry string, organization string, pushSecret string) error { - if err := waitForPlatformCRDAvailable(namespace, 15*time.Second); err != nil { + if err := waitForPlatformCRDAvailable(namespace, 25*time.Second); err != nil { return err } isOpenshift, err := openshift.IsOpenShift() ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services