use controller-runtime signals (#2589)
This commit is contained in:
+2
-2
@@ -20,18 +20,18 @@ import (
|
||||
"os"
|
||||
|
||||
"go.uber.org/zap"
|
||||
"sigs.k8s.io/controller-runtime/pkg/manager/signals"
|
||||
|
||||
"github.com/fission/fission/cmd/builder/app"
|
||||
"github.com/fission/fission/pkg/utils/loggerfactory"
|
||||
"github.com/fission/fission/pkg/utils/profile"
|
||||
"github.com/fission/fission/pkg/utils/signals"
|
||||
)
|
||||
|
||||
// Usage: builder <shared volume path>
|
||||
func main() {
|
||||
logger := loggerfactory.GetLogger()
|
||||
defer logger.Sync()
|
||||
ctx := signals.SetupSignalHandlerWithContext(logger)
|
||||
ctx := signals.SetupSignalHandler()
|
||||
profile.ProfileIfEnabled(ctx, logger)
|
||||
shareVolume := os.Args[1]
|
||||
if _, err := os.Stat(shareVolume); err != nil {
|
||||
|
||||
+3
-2
@@ -17,10 +17,11 @@ limitations under the License.
|
||||
package main
|
||||
|
||||
import (
|
||||
"sigs.k8s.io/controller-runtime/pkg/manager/signals"
|
||||
|
||||
"github.com/fission/fission/cmd/fetcher/app"
|
||||
"github.com/fission/fission/pkg/utils/loggerfactory"
|
||||
"github.com/fission/fission/pkg/utils/profile"
|
||||
"github.com/fission/fission/pkg/utils/signals"
|
||||
)
|
||||
|
||||
// Usage: fetcher <shared volume path>
|
||||
@@ -28,7 +29,7 @@ func main() {
|
||||
logger := loggerfactory.GetLogger()
|
||||
defer logger.Sync()
|
||||
|
||||
ctx := signals.SetupSignalHandlerWithContext(logger)
|
||||
ctx := signals.SetupSignalHandler()
|
||||
profile.ProfileIfEnabled(ctx, logger)
|
||||
app.Run(ctx, logger)
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import (
|
||||
"strconv"
|
||||
|
||||
docopt "github.com/docopt/docopt-go"
|
||||
"sigs.k8s.io/controller-runtime/pkg/manager/signals"
|
||||
|
||||
"go.uber.org/zap"
|
||||
|
||||
@@ -41,7 +42,6 @@ import (
|
||||
"github.com/fission/fission/pkg/utils/loggerfactory"
|
||||
"github.com/fission/fission/pkg/utils/otel"
|
||||
"github.com/fission/fission/pkg/utils/profile"
|
||||
"github.com/fission/fission/pkg/utils/signals"
|
||||
)
|
||||
|
||||
func runController(ctx context.Context, logger *zap.Logger, port int) {
|
||||
@@ -199,7 +199,7 @@ Options:
|
||||
logger := loggerfactory.GetLogger()
|
||||
defer exitWithSync(logger)
|
||||
|
||||
ctx := signals.SetupSignalHandlerWithContext(logger)
|
||||
ctx := signals.SetupSignalHandler()
|
||||
profile.ProfileIfEnabled(ctx, logger)
|
||||
|
||||
version := fmt.Sprintf("Fission Bundle Version: %v", info.BuildInfo().String())
|
||||
|
||||
@@ -19,10 +19,10 @@ package main
|
||||
import (
|
||||
"github.com/docopt/docopt-go"
|
||||
"go.uber.org/zap"
|
||||
"sigs.k8s.io/controller-runtime/pkg/manager/signals"
|
||||
|
||||
"github.com/fission/fission/pkg/info"
|
||||
"github.com/fission/fission/pkg/utils/loggerfactory"
|
||||
"github.com/fission/fission/pkg/utils/signals"
|
||||
)
|
||||
|
||||
func getStringArgWithDefault(arg interface{}, defaultValue string) string {
|
||||
@@ -58,7 +58,7 @@ Options:
|
||||
zap.Error(err))
|
||||
}
|
||||
|
||||
ctx := signals.SetupSignalHandlerWithContext(logger)
|
||||
ctx := signals.SetupSignalHandler()
|
||||
crd := crdBackedClient.GetFunctionCRD(ctx)
|
||||
if crd == nil {
|
||||
logger.Info("nothing to do since CRDs are not present on the cluster")
|
||||
|
||||
Reference in New Issue
Block a user