diff --git a/api/const.go b/api/const.go new file mode 100644 index 000000000..640a83fc4 --- /dev/null +++ b/api/const.go @@ -0,0 +1,22 @@ +/* + * Copyright 2023 Red Hat, Inc. and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package api + +const ( + // ComponentName just a name to identify this package/component/application + ComponentName = "sonataflow" +) diff --git a/api/go.mod b/api/go.mod index 1856585c7..76565e68a 100644 --- a/api/go.mod +++ b/api/go.mod @@ -70,7 +70,7 @@ require ( k8s.io/apiextensions-apiserver v0.27.2 // indirect k8s.io/client-go v0.27.2 // indirect k8s.io/component-base v0.27.2 // indirect - k8s.io/klog/v2 v2.90.1 // indirect + k8s.io/klog/v2 v2.100.1 // indirect k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect k8s.io/utils v0.0.0-20230313181309-38a27ef9d749 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect diff --git a/api/go.sum b/api/go.sum index a821b6858..03f6be6e0 100644 --- a/api/go.sum +++ b/api/go.sum @@ -271,8 +271,7 @@ k8s.io/client-go v0.27.2 h1:vDLSeuYvCHKeoQRhCXjxXO45nHVv2Ip4Fe0MfioMrhE= k8s.io/client-go v0.27.2/go.mod h1:tY0gVmUsHrAmjzHX9zs7eCjxcBsf8IiNe7KQ52biTcQ= k8s.io/component-base v0.27.2 h1:neju+7s/r5O4x4/txeUONNTS9r1HsPbyoPBAtHsDCpo= k8s.io/component-base v0.27.2/go.mod h1:5UPk7EjfgrfgRIuDBFtsEFAe4DAvP3U+M8RTzoSJkpo= -k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw= -k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg= k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg= k8s.io/utils v0.0.0-20230313181309-38a27ef9d749 h1:xMMXJlJbsU8w3V5N2FLDQ8YgU8s1EoULdbQBcAeNJkY= diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index 8d6a14b62..811c34c7c 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -33,6 +33,7 @@ spec: - /usr/local/bin/manager args: - --leader-elect + - '-v=2' image: controller:latest name: manager securityContext: diff --git a/container-builder/util/const.go b/container-builder/api/const.go similarity index 91% rename from container-builder/util/const.go rename to container-builder/api/const.go index 28968f4b3..be5f3c8be 100644 --- a/container-builder/util/const.go +++ b/container-builder/api/const.go @@ -1,5 +1,5 @@ /* - * Copyright 2022 Red Hat, Inc. and/or its affiliates. + * Copyright 2023 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package util +package api const ( // ComponentName just a name to identify this package/component/application diff --git a/container-builder/builder/kaniko_docker_integration_test.go b/container-builder/builder/kaniko_docker_integration_test.go index c1ca30b7b..c90a3357a 100644 --- a/container-builder/builder/kaniko_docker_integration_test.go +++ b/container-builder/builder/kaniko_docker_integration_test.go @@ -22,11 +22,12 @@ import ( "testing" "time" - "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" + "k8s.io/klog/v2" "github.com/kiegroup/kogito-serverless-operator/container-builder/common" + "github.com/kiegroup/kogito-serverless-operator/container-builder/util/log" ) func TestKanikoTestSuite(t *testing.T) { @@ -39,7 +40,7 @@ func (suite *KanikoDockerTestSuite) TestKanikoBuild() { //registry, err, repos := checkEmptyDockerRegistry(suite) mydir, err := os.Getwd() if err != nil { - logrus.Error(err) + klog.V(log.E).ErrorS(err, "error getting working directory.") } dockefileDir := mydir + "/../examples/dockerfiles" assert.Nil(suite.T(), suite.Docker.PullImage("gcr.io/kaniko-project/executor:latest"), "Pull image failed") @@ -52,11 +53,11 @@ func (suite *KanikoDockerTestSuite) TestKanikoBuild() { RegistryFinalImageName: imageName, ReadBuildOutput: false, } - logrus.Infof("Start Kaniko build") + klog.V(log.I).InfoS("Start Kaniko build") start := time.Now() imageID, error := KanikoBuild(suite.Docker.Connection, config) timeElapsed := time.Since(start) - logrus.Infof("The Kaniko build took %s", timeElapsed) + klog.V(log.I).InfoS("The Kaniko build took", "duration", timeElapsed) assert.Nil(suite.T(), error, "ContainerBuild failed") assert.NotNil(suite.T(), imageID, error, "ContainerBuild failed") //@TODO investigate when the code will be in the mono repo @@ -74,7 +75,7 @@ func checkEmptyDockerRegistry(suite *KanikoDockerTestSuite) (common.RegistryCont assert.Truef(suite.T(), suite.RegistryID != "", "Registry not started") registry, err := common.GetRegistryContainer() if err != nil { - logrus.Error("registry not found") + klog.V(log.E).ErrorS(err, "registry not found") } repos, _ := registry.GetRepositories() assert.True(suite.T(), len(repos) == 0) diff --git a/container-builder/builder/kaniko_integration_test_suite.go b/container-builder/builder/kaniko_integration_test_suite.go index f268b7d06..74e93af64 100644 --- a/container-builder/builder/kaniko_integration_test_suite.go +++ b/container-builder/builder/kaniko_integration_test_suite.go @@ -20,11 +20,12 @@ package builder import ( "time" - "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" + "k8s.io/klog/v2" "github.com/kiegroup/kogito-serverless-operator/container-builder/common" + "github.com/kiegroup/kogito-serverless-operator/container-builder/util/log" ) type KanikoDockerTestSuite struct { @@ -46,7 +47,7 @@ func (suite *KanikoDockerTestSuite) SetupSuite() { pullErr := suite.Docker.PullImage(EXECUTOR_IMAGE) if pullErr != nil { - logrus.Infof("Pull Kaniko executor Error:%s", pullErr) + klog.V(log.E).ErrorS(pullErr, "Pull Kaniko executor") } time.Sleep(4 * time.Second) // Needed on CI } @@ -59,14 +60,14 @@ func (suite *KanikoDockerTestSuite) TearDownSuite() { suite.LocalRegistry.StopRegistry() } purged, err := suite.Docker.PurgeContainer("", common.REGISTRY_IMG) - logrus.Infof("Purged containers %t", purged) + klog.V(log.I).InfoS("Purged containers", "containers", purged) if err != nil { - logrus.Infof("Purged registry err %t", err) + klog.V(log.E).ErrorS(err, "Purged registry") } purgedBuild, err := suite.Docker.PurgeContainer("", EXECUTOR_IMAGE) if err != nil { - logrus.Infof("Purged container err %t", err) + klog.V(log.E).ErrorS(err, "Purged container") } - logrus.Infof("Purged container build %t", purgedBuild) + klog.V(log.I).InfoS("Purged container build", "container", purgedBuild) } diff --git a/container-builder/builder/kaniko_vanilla.go b/container-builder/builder/kaniko_vanilla.go index 5fbbd22ce..029d14c96 100644 --- a/container-builder/builder/kaniko_vanilla.go +++ b/container-builder/builder/kaniko_vanilla.go @@ -19,11 +19,14 @@ import ( "context" "os" + "k8s.io/klog/v2" + "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/docker/docker/client" "github.com/docker/docker/pkg/stdcopy" - "github.com/sirupsen/logrus" + + "github.com/kiegroup/kogito-serverless-operator/container-builder/util/log" ) type KanikoVanillaConfig struct { @@ -62,28 +65,25 @@ func KanikoBuild(connection *client.Client, config KanikoVanillaConfig) (string, }, hostConfig, nil, nil, config.ContainerName) if err != nil { - logrus.Error(err) + klog.V(log.E).ErrorS(err, "error during KanikoBuild, ContainerCreate") } if err := connection.ContainerStart(ctx, resp.ID, types.ContainerStartOptions{}); err != nil { - logrus.Error(err) - } - if err != nil { - logrus.Error(err) + klog.V(log.E).ErrorS(err, "error during KanikoBuild, ContainerStart") } statusCh, errCh := connection.ContainerWait(ctx, resp.ID, container.WaitConditionNotRunning) select { case err := <-errCh: if err != nil { - logrus.Error(err) + klog.V(log.E).ErrorS(err, "error during KanikoBuild, ContainerWait") } case <-statusCh: } out, err := connection.ContainerLogs(ctx, resp.ID, types.ContainerLogsOptions{ShowStdout: true}) if err != nil { - logrus.Error(err) + klog.V(log.E).ErrorS(err, "error during KanikoBuild, ContainerLogs") } if config.ReadBuildOutput { stdcopy.StdCopy(os.Stdout, os.Stderr, out) diff --git a/container-builder/builder/kubernetes/action.go b/container-builder/builder/kubernetes/action.go index 36ad955c9..096f2b499 100644 --- a/container-builder/builder/kubernetes/action.go +++ b/container-builder/builder/kubernetes/action.go @@ -19,11 +19,9 @@ import ( "github.com/kiegroup/kogito-serverless-operator/container-builder/api" "github.com/kiegroup/kogito-serverless-operator/container-builder/client" - "github.com/kiegroup/kogito-serverless-operator/container-builder/util/log" ) type Action interface { - log.Injectable client.Injectable // Name returns user-friendly name for the action Name() string @@ -37,7 +35,6 @@ type Action interface { type baseAction struct { client client.Client - L log.Logger } // TODO: implement our client wrapper @@ -45,7 +42,3 @@ type baseAction struct { func (action *baseAction) InjectClient(client client.Client) { action.client = client } - -func (action *baseAction) InjectLogger(log log.Logger) { - action.L = log -} diff --git a/container-builder/builder/kubernetes/builder.go b/container-builder/builder/kubernetes/builder.go index fa92595d7..b92bd9673 100644 --- a/container-builder/builder/kubernetes/builder.go +++ b/container-builder/builder/kubernetes/builder.go @@ -18,11 +18,12 @@ import ( "context" "fmt" + "k8s.io/klog/v2" + corev1 "k8s.io/api/core/v1" "github.com/kiegroup/kogito-serverless-operator/container-builder/api" "github.com/kiegroup/kogito-serverless-operator/container-builder/client" - "github.com/kiegroup/kogito-serverless-operator/container-builder/util" "github.com/kiegroup/kogito-serverless-operator/container-builder/util/log" ) @@ -49,7 +50,6 @@ type containerBuildContext struct { } type builder struct { - L log.Logger Context containerBuildContext } @@ -94,7 +94,6 @@ type schedulerHandler interface { func FromBuild(build *api.ContainerBuild) ContainerBuilder { return &builder{ - L: log.WithName(util.ComponentName), Context: containerBuildContext{ ContainerBuild: build, C: context.TODO(), @@ -174,20 +173,19 @@ func (b *builder) Reconcile() (*api.ContainerBuild, error) { target := b.Context.ContainerBuild.DeepCopy() for _, a := range actions { - a.InjectLogger(b.L) a.InjectClient(b.Context.Client) if a.CanHandle(target) { - b.L.Infof("Invoking action %s", a.Name()) + klog.V(log.I).InfoS("Invoking action", "buildAction", a.Name()) newTarget, err := a.Handle(b.Context.C, target) if err != nil { - b.L.Errorf(err, "Failed to invoke action %s", a.Name()) + klog.V(log.E).ErrorS(err, "Failed to invoke action", "buildAction", a.Name()) return nil, err } if newTarget != nil { if newTarget.Status.Phase != target.Status.Phase { - b.L.Info( + klog.V(log.I).InfoS( "state transition", "phase-from", target.Status.Phase, "phase-to", newTarget.Status.Phase, diff --git a/container-builder/builder/kubernetes/builder_kaniko.go b/container-builder/builder/kubernetes/builder_kaniko.go index f5250496a..b346591f8 100644 --- a/container-builder/builder/kubernetes/builder_kaniko.go +++ b/container-builder/builder/kubernetes/builder_kaniko.go @@ -20,8 +20,6 @@ import ( corev1 "k8s.io/api/core/v1" "github.com/kiegroup/kogito-serverless-operator/container-builder/api" - "github.com/kiegroup/kogito-serverless-operator/container-builder/util" - "github.com/kiegroup/kogito-serverless-operator/container-builder/util/log" ) type kanikoScheduler struct { @@ -60,7 +58,6 @@ func (k kanikoSchedulerHandler) CreateScheduler(info ContainerBuilderInfo, build sched := &kanikoScheduler{ &scheduler{ builder: builder{ - L: log.WithName(util.ComponentName), Context: buildCtx, }, Resources: make([]resource, 0), diff --git a/container-builder/builder/kubernetes/recovery.go b/container-builder/builder/kubernetes/recovery.go index 73b95bfc8..da02c1b35 100644 --- a/container-builder/builder/kubernetes/recovery.go +++ b/container-builder/builder/kubernetes/recovery.go @@ -20,6 +20,10 @@ import ( "context" "time" + "k8s.io/klog/v2" + + "github.com/kiegroup/kogito-serverless-operator/container-builder/util/log" + "github.com/jpillora/backoff" "github.com/kiegroup/kogito-serverless-operator/container-builder/api" @@ -86,9 +90,9 @@ func (action *errorRecoveryAction) Handle(ctx context.Context, build *api.Contai build.Status.Failure.Recovery.Attempt++ build.Status.Failure.Recovery.AttemptTime = metav1.Now() - action.L.Infof("Recovery attempt (%d/%d)", - build.Status.Failure.Recovery.Attempt, - build.Status.Failure.Recovery.AttemptMax, + klog.V(log.I).InfoS("Recovery attempt", + "attempt", build.Status.Failure.Recovery.Attempt, + "attemptMax", build.Status.Failure.Recovery.AttemptMax, ) return build, nil diff --git a/container-builder/cleaner/docker_integration_test.go b/container-builder/cleaner/docker_integration_test.go index 9dcb5d1a0..c07dfe24b 100644 --- a/container-builder/cleaner/docker_integration_test.go +++ b/container-builder/cleaner/docker_integration_test.go @@ -22,11 +22,12 @@ import ( "testing" "time" - "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" + "k8s.io/klog/v2" "github.com/kiegroup/kogito-serverless-operator/container-builder/common" + "github.com/kiegroup/kogito-serverless-operator/container-builder/util/log" ) func TestDockerIntegrationTestSuite(t *testing.T) { @@ -43,21 +44,21 @@ func (suite *DockerTestSuite) TestImagesOperationsOnDockerRegistryForTest() { pullErr := suite.Docker.PullImage(common.TEST_IMG + ":" + common.LATEST_TAG) if pullErr != nil { - logrus.Infof("Pull Error:%s", pullErr) + klog.V(log.E).ErrorS(pullErr, "Pull Error") } assert.Nil(suite.T(), pullErr, "Pull image failed") time.Sleep(2 * time.Second) // Needed on CI assert.True(suite.T(), suite.LocalRegistry.IsImagePresent(common.TEST_IMG), "Test image not found in the registry after the pull") tagErr := suite.Docker.TagImage(common.TEST_IMG, common.TEST_IMG_LOCAL_TAG) if tagErr != nil { - logrus.Infof("Tag Error:%s", tagErr) + klog.V(log.E).ErrorS(tagErr, "Tag Error") } assert.Nil(suite.T(), tagErr, "Tag image failed") time.Sleep(2 * time.Second) // Needed on CI pushErr := suite.Docker.PushImage(common.TEST_IMG_LOCAL_TAG, common.REGISTRY_CONTAINER_URL_FROM_DOCKER_SOCKET, "", "") if pushErr != nil { - logrus.Infof("Push Error:%s", pushErr) + klog.V(log.E).ErrorS(pushErr, "Push Error") } assert.Nil(suite.T(), pushErr, "Push image in the Docker container failed") diff --git a/container-builder/cleaner/docker_integration_test_suite.go b/container-builder/cleaner/docker_integration_test_suite.go index be1304d64..fd23ce27e 100644 --- a/container-builder/cleaner/docker_integration_test_suite.go +++ b/container-builder/cleaner/docker_integration_test_suite.go @@ -18,11 +18,12 @@ package cleaner import ( - "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" + "k8s.io/klog/v2" "github.com/kiegroup/kogito-serverless-operator/container-builder/common" + "github.com/kiegroup/kogito-serverless-operator/container-builder/util/log" ) type DockerTestSuite struct { @@ -52,7 +53,7 @@ func (suite *DockerTestSuite) TearDownSuite() { } purged, err := suite.Docker.PurgeContainer("", common.REGISTRY_IMG) if err != nil { - logrus.Errorf("Error during purged container in TearDown Suite %t", err) + klog.V(log.E).ErrorS(err, "Error during purged container in TearDown Suite.") } - logrus.Infof("Purged containers %t", purged) + klog.V(log.I).InfoS("Purged container", "containers", purged) } diff --git a/container-builder/cleaner/registry_docker_integration_test.go b/container-builder/cleaner/registry_docker_integration_test.go index 19d6574a7..2e56ae1c3 100644 --- a/container-builder/cleaner/registry_docker_integration_test.go +++ b/container-builder/cleaner/registry_docker_integration_test.go @@ -22,11 +22,12 @@ import ( "testing" "time" - "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" + "k8s.io/klog/v2" "github.com/kiegroup/kogito-serverless-operator/container-builder/common" + "github.com/kiegroup/kogito-serverless-operator/container-builder/util/log" ) func TestRegistryDockerIntegrationTestSuite(t *testing.T) { @@ -34,7 +35,7 @@ func TestRegistryDockerIntegrationTestSuite(t *testing.T) { } func (suite *DockerTestSuite) TestDockerRegistry() { - logrus.Info("TestPullTagPush ") + klog.V(log.I).InfoS("TestPullTagPush ") assert.Truef(suite.T(), suite.RegistryID != "", "Registry not started") assert.Truef(suite.T(), suite.LocalRegistry.IsRegistryImagePresent(), "Registry image not present") assert.Truef(suite.T(), suite.LocalRegistry.GetRegistryRunningID() == suite.RegistryID, "Registry container not running") @@ -54,7 +55,7 @@ func (suite *DockerTestSuite) TestPullTagPush() { time.Sleep(2 * time.Second) // Needed on CI repos = CheckRepositoriesSize(suite.T(), initialRepoSize+1, registryContainer) - logrus.Info("Repo Size after pull image = ", len(repos)) + klog.V(log.I).InfoS("Repo Size after pull image", "size", len(repos)) } func dockerPullTagPushOnRegistryContainer(suite *DockerTestSuite) bool { diff --git a/container-builder/client/client.go b/container-builder/client/client.go index f6f0eb798..0a089cf1e 100644 --- a/container-builder/client/client.go +++ b/container-builder/client/client.go @@ -20,8 +20,9 @@ import ( "os" "path/filepath" + "k8s.io/klog/v2" + user "github.com/mitchellh/go-homedir" - "github.com/sirupsen/logrus" "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes" @@ -30,6 +31,8 @@ import ( ctrl "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/config" "sigs.k8s.io/controller-runtime/pkg/manager" + + "github.com/kiegroup/kogito-serverless-operator/container-builder/util/log" ) const ( @@ -161,7 +164,7 @@ func initialize(kubeconfig string) { if kc, err := shouldUseContainerMode(); kc && err == nil { return } else if err != nil { - logrus.Errorf("could not determine if running in a container: %v", err) + klog.V(log.E).ErrorS(err, "could not determine if running in a container") } var err error kubeconfig, err = getDefaultKubeConfigFile() diff --git a/container-builder/client/fastmapper.go b/container-builder/client/fastmapper.go index 459cff4a1..24a8666eb 100644 --- a/container-builder/client/fastmapper.go +++ b/container-builder/client/fastmapper.go @@ -17,14 +17,16 @@ package client import ( - "github.com/sirupsen/logrus" "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/discovery" "k8s.io/client-go/rest" "k8s.io/client-go/restmapper" + "k8s.io/klog/v2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/kiegroup/kogito-serverless-operator/container-builder/util/log" ) // FastMapperAllowedAPIGroups contains a set of API groups that are allowed when using the fastmapper. @@ -63,7 +65,7 @@ func newFastDiscoveryRESTMapperWithFilter(config *rest.Config, filter func(*meta for _, group := range groups.Groups { pinnedGroup := group pick := filter(&pinnedGroup) - logrus.Debugf("Group: %s %v", group.Name, pick) + klog.V(log.D).InfoS("Group", "name", pick) totalCount++ if !pick { continue @@ -77,7 +79,7 @@ func newFastDiscoveryRESTMapperWithFilter(config *rest.Config, filter func(*meta wg.Start(func() { discoverGroupResources(dc, gr) }) } wg.Wait() - logrus.Debugf("Picked %d/%d", pickedCount, totalCount) + klog.V(log.D).InfoS("Picked", "pickedCount", pickedCount, "totalCount", totalCount) return restmapper.NewDiscoveryRESTMapper(grs), nil } @@ -85,7 +87,7 @@ func discoverGroupResources(dc discovery.DiscoveryInterface, gr *restmapper.APIG for _, version := range gr.Group.Versions { resources, err := dc.ServerResourcesForGroupVersion(version.GroupVersion) if err != nil { - logrus.Fatal(err, version.GroupVersion) + klog.V(log.E).ErrorS(err, version.GroupVersion) } gr.VersionedResources[version.Version] = resources.APIResources } diff --git a/container-builder/common/docker.go b/container-builder/common/docker.go index 2859e6b3a..9fee8e910 100644 --- a/container-builder/common/docker.go +++ b/container-builder/common/docker.go @@ -22,13 +22,15 @@ import ( "encoding/json" "io/ioutil" + "k8s.io/klog/v2" + "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/client" - "github.com/sirupsen/logrus" "github.com/kiegroup/kogito-serverless-operator/container-builder/util" + "github.com/kiegroup/kogito-serverless-operator/container-builder/util/log" ) type Docker struct { @@ -51,7 +53,7 @@ func (d Docker) GetClientRemote(host string, cacertPath string, certPath string, func (d Docker) GetImages(args types.ImageListOptions) ([]types.ImageSummary, error) { images, err := d.Connection.ImageList(context.Background(), args) if err != nil { - logrus.Errorf("%s \n", err) + klog.V(log.E).ErrorS(err, "error during Get Images") return nil, err } return images, nil @@ -61,14 +63,14 @@ func (d Docker) GetImages(args types.ImageListOptions) ([]types.ImageSummary, er func (d Docker) RemoveImagesUntagged() (bool, error) { images, err := d.GetImages(types.ImageListOptions{All: true}) if err != nil { - logrus.Errorf("error during Remove Images Untagged %s", err) + klog.V(log.E).ErrorS(err, "error during Remove Images Untagged") return false, err } for _, image := range images { if image.RepoTags != nil && image.RepoTags[0] == ":" && image.RepoDigests[0] == "@" { item, err := d.Connection.ImageRemove(context.Background(), image.ID, types.ImageRemoveOptions{PruneChildren: true, Force: true}) if err != nil { - logrus.Errorf("%s %s\n", err, item) + klog.V(log.E).ErrorS(err, "error during Remove Images Untagged", "item", item) return false, err } } @@ -82,13 +84,13 @@ func (d Docker) RemoveDanglingImages() (bool, error) { filters.Add("dangling", "true") images, err := d.GetImages(types.ImageListOptions{Filters: filters}) if err != nil { - logrus.Errorf("%s \n", err) + klog.V(log.E).ErrorS(err, "error during Remove Dangling Images") return false, err } for _, image := range images { item, err := d.Connection.ImageRemove(context.Background(), image.ID, types.ImageRemoveOptions{PruneChildren: true, Force: true}) if err != nil { - logrus.Errorf("%s %s\n", err, item) + klog.V(log.E).ErrorS(err, "error during Remove Dangling Images", "item", item) return false, err } } @@ -101,10 +103,10 @@ func (d Docker) PurgeImages() (bool, error) { filters.Add("dangling", "true") report, err := d.Connection.ImagesPrune(context.Background(), filters) if err != nil { - logrus.Errorf("%s\n", err) + klog.V(log.E).ErrorS(err, "error during Purge Images") return false, err } else { - logrus.Info(report.ImagesDeleted) + klog.V(log.I).InfoS("Images purged", "images", report.ImagesDeleted) return true, nil } } @@ -112,14 +114,14 @@ func (d Docker) PurgeImages() (bool, error) { func (d Docker) PurgeContainer(id string, image string) (bool, error) { containers, err := d.Connection.ContainerList(context.Background(), types.ContainerListOptions{All: true}) if err != nil { - logrus.Errorf("%s\n", err) + klog.V(log.E).ErrorS(err, "error during Purge Container") return false, err } else { for _, container := range containers { if container.Image == image || container.ID == id { d.ContainerKill(container.ID) d.ContainerRemove(container.ID) - logrus.Infof("Purged container with ID %s", container.ID) + klog.V(log.I).InfoS("Purged container", "ID", container.ID) } } return true, nil @@ -138,13 +140,13 @@ func (d Docker) RemoveImagesFiltered(repo string, tag string) (bool, error) { images, err := d.GetImages(types.ImageListOptions{Filters: filters}) if err != nil { - logrus.Errorf("%s\n", err) + klog.V(log.E).ErrorS(err, "error during Remove Images Filtered") return false, err } for _, image := range images { item, err := d.Connection.ImageRemove(context.Background(), image.ID, types.ImageRemoveOptions{PruneChildren: true, Force: true}) if err != nil { - logrus.Errorf("%s %s\n", err, item) + klog.V(log.E).ErrorS(err, "error during Remove Images Filtered", "item", item) return false, err } } @@ -154,7 +156,7 @@ func (d Docker) RemoveImagesFiltered(repo string, tag string) (bool, error) { func (d Docker) TagImage(imageSource string, imageTag string) error { err := d.Connection.ImageTag(context.Background(), imageSource, imageTag) if err != nil { - logrus.Errorf("%s %s\n", err, "Error during tag image") + klog.V(log.E).ErrorS(err, "error during Tag Image") } return err } @@ -171,9 +173,8 @@ func (d Docker) PushImage(image string, url string, username string, password st opts := types.ImagePushOptions{RegistryAuth: authConfigEncoded} resp, err := d.Connection.ImagePush(context.Background(), image, opts) if err != nil { - logrus.Errorf("%s %s\n", err, "Error during push image") body, _ := ioutil.ReadAll(resp) - logrus.Error(string(body)) + klog.V(log.E).ErrorS(err, "error during Push Image", "body", body) } return err } @@ -181,7 +182,7 @@ func (d Docker) PushImage(image string, url string, username string, password st func (d Docker) PullImage(image string) error { _, err := d.Connection.ImagePull(context.Background(), image, types.ImagePullOptions{}) if err != nil { - logrus.Errorf("%s %s\n", err, "Error during pull image") + klog.V(log.E).ErrorS(err, "error during Pull Image") } return err } @@ -189,7 +190,7 @@ func (d Docker) PullImage(image string) error { func (d Docker) GetContainerID(imageName string) (string, error) { containers, err := d.Connection.ContainerList(context.Background(), types.ContainerListOptions{}) if err != nil { - logrus.Errorf("%s %s\n", err, "Error during container list") + klog.V(log.E).ErrorS(err, "error during Get Container ID") } for _, container := range containers { @@ -206,7 +207,7 @@ func (d Docker) ContainerStop(containerID string) error { } err := d.Connection.ContainerStop(context.Background(), containerID, stopOptions) if err != nil { - logrus.Errorf("%s %s\n", err, "Error during container stop") + klog.V(log.E).ErrorS(err, "error during Container Stop") } return err } @@ -214,7 +215,7 @@ func (d Docker) ContainerStop(containerID string) error { func (d Docker) ContainerKill(containerID string) error { err := d.Connection.ContainerKill(context.Background(), containerID, "SIGKILL") if err != nil { - logrus.Errorf("%s %s\n", err, "Error during container kill") + klog.V(log.E).ErrorS(err, "error during Container Kill") } return err } @@ -222,7 +223,7 @@ func (d Docker) ContainerKill(containerID string) error { func (d Docker) ContainerRemove(containerID string) error { err := d.Connection.ContainerRemove(context.Background(), containerID, types.ContainerRemoveOptions{}) if err != nil { - logrus.Errorf("%s %s\n", err, "Error during container remove") + klog.V(log.E).ErrorS(err, "error during Container Remove") } return err } diff --git a/container-builder/common/registry.go b/container-builder/common/registry.go index e003637f6..eb562ce1f 100644 --- a/container-builder/common/registry.go +++ b/container-builder/common/registry.go @@ -23,10 +23,13 @@ import ( "os" "time" + "k8s.io/klog/v2" + "github.com/docker/docker/client" registryContainer "github.com/heroku/docker-registry-client/registry" "github.com/opencontainers/go-digest" - "github.com/sirupsen/logrus" + + "github.com/kiegroup/kogito-serverless-operator/container-builder/util/log" ) const REGISTRY_IMG = "registry" @@ -102,7 +105,7 @@ func (r RegistryContainer) DeleteImage(repository string, tag string) error { defer resp.Body.Close() } if err != nil { - logrus.Error(err) + klog.V(log.E).ErrorS(err, "error during DeleteImage") return err } return nil @@ -117,7 +120,7 @@ func (r *RegistryContainer) url(pathTemplate string, args ...interface{}) string func GetRegistryContainer() (RegistryContainer, error) { registryContainerConnection, err := GetRegistryConnection(REGISTRY_CONTAINER_URL, "", "") if err != nil { - logrus.Errorf("Can't connect to the RegistryContainer") + klog.V(log.E).ErrorS(err, "Can't connect to the RegistryContainer") return RegistryContainer{}, err } return RegistryContainer{Connection: *registryContainerConnection}, nil @@ -136,11 +139,11 @@ func IsPortAvailable(port string) bool { func GetRegistryConnection(url string, username string, password string) (*registryContainer.Registry, error) { registryConn, err := registryContainer.New(url, username, password) if err != nil { - logrus.Error(err, "First Attempt to connect with RegistryContainer") + klog.V(log.E).ErrorS(err, "First Attempt to connect with RegistryContainer") } // we try ten times if the machine is slow and the registry needs time to start if err != nil { - logrus.Info("Waiting for a correct ping with RegistryContainer") + klog.V(log.I).InfoS("Waiting for a correct ping with RegistryContainer") for i := 0; i < 10; i++ { time.Sleep(1 * time.Second) diff --git a/container-builder/common/registry_docker.go b/container-builder/common/registry_docker.go index 76605827b..530ef9331 100644 --- a/container-builder/common/registry_docker.go +++ b/container-builder/common/registry_docker.go @@ -21,12 +21,15 @@ import ( "strings" "time" + "k8s.io/klog/v2" + "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/docker/docker/client" "github.com/docker/go-connections/nat" - "github.com/sirupsen/logrus" "golang.org/x/net/context" + + "github.com/kiegroup/kogito-serverless-operator/container-builder/util/log" ) func GetDockerConnection() (*client.Client, error) { @@ -45,7 +48,7 @@ func GetCustomDockerConnectionWithIP(ip string) (*client.Client, error) { func GetCustomRegistry() (DockerLocalRegistry, *client.Client, error) { connectionLocal, err := GetCustomDockerConnectionWithIP(REGISTRY_CONTAINER_URL_FROM_DOCKER_SOCKET) if err != nil { - logrus.Error(err) + klog.V(log.E).ErrorS(err, "error during Get Custom Registry") return DockerLocalRegistry{}, nil, err } @@ -74,12 +77,12 @@ func (d DockerLocalRegistry) StartRegistry() string { registryID := d.GetRegistryRunningID() if len(registryID) > 0 { - logrus.Infof("Registry ID %s is already running", registryID) + klog.V(log.I).InfoS("Registry ID is already running", "ID", registryID) return registryID } if !d.IsRegistryImagePresent() { - logrus.Info("Registry Image Pull") + klog.V(log.I).InfoS("Registry Image Pull") _, err := d.Connection.ImagePull(ctx, REGISTRY_IMG, types.ImagePullOptions{}) if err != nil { fmt.Println(err) @@ -89,7 +92,7 @@ func (d DockerLocalRegistry) StartRegistry() string { time.Sleep(2 * time.Second) // needed on CI - logrus.Info("Registry Container Create") + klog.V(log.I).InfoS("Registry Container Create") resp, err := d.Connection.ContainerCreate(ctx, &container.Config{ Image: REGISTRY_IMG, ExposedPorts: nat.PortSet{"5000": struct{}{}}, @@ -102,18 +105,17 @@ func (d DockerLocalRegistry) StartRegistry() string { REGISTRY_IMG) if err != nil { - logrus.Error(err) + klog.V(log.E).ErrorS(err, "error during Registry Container Create") } - logrus.Info("Starting Registry container") + klog.V(log.I).InfoS("Starting Registry Container") if err := d.Connection.ContainerStart(ctx, resp.ID, types.ContainerStartOptions{}); err != nil { - logrus.Info("error during Start registry") - logrus.Error(err) + klog.V(log.E).ErrorS(err, "error during Start Registry Container") return "" } // give some time to start - logrus.Info("Waiting 4 sec") + klog.V(log.I).InfoS("Waiting 4 seconds") time.Sleep(4 * time.Second) return d.GetRegistryRunningID() } @@ -121,13 +123,13 @@ func (d DockerLocalRegistry) StartRegistry() string { func (d DockerLocalRegistry) StopRegistry() bool { registryID := d.GetRegistryRunningID() if len(registryID) > 0 { - logrus.Info("StopRegistry Kill registry container.ID " + registryID) + klog.V(log.I).InfoS("StopRegistry Kill Container", "ID", registryID) ctx := context.Background() _ = d.Connection.ContainerKill(ctx, registryID, "SIGKILL") - logrus.Info("StopRegistry Removing container ID " + registryID) + klog.V(log.I).InfoS("StopRegistry Removing Container", "ID", registryID) err := d.Connection.ContainerRemove(ctx, registryID, types.ContainerRemoveOptions{}) if err != nil { - logrus.Info(err) + klog.V(log.E).ErrorS(err, "error during Stop Registry") return false } } @@ -137,9 +139,9 @@ func (d DockerLocalRegistry) StopRegistry() bool { func (d DockerLocalRegistry) StopAndRemoveContainer(containerID string) bool { if len(containerID) > 0 { ctx := context.Background() - logrus.Info("Docker StopAndRemoveContainer Kill registry container container.ID " + containerID) + klog.V(log.I).InfoS("Docker StopAndRemoveContainer Kill registry container", "ID", containerID) _ = d.Connection.ContainerKill(ctx, containerID, "SIGKILL") - logrus.Info("Docker StopAndRemoveContainer Removing container ID " + containerID) + klog.V(log.I).InfoS("Docker StopAndRemoveContainer Removing container", "ID", containerID) err := d.Connection.ContainerRemove(ctx, containerID, types.ContainerRemoveOptions{}) return err == nil } @@ -194,30 +196,30 @@ func SetupDockerSocket() (DockerLocalRegistry, string, Docker) { dockerSocketConn, err := GetDockerConnection() if err != nil { - logrus.Errorf("Can't get Docker socket") + klog.V(log.E).ErrorS(err, "Can't get Docker socket") return DockerLocalRegistry{}, "", Docker{} } dockerSock := Docker{Connection: dockerSocketConn} if err != nil { - logrus.Errorf("Pull error in SetupDockerSocket %s", err) + klog.V(log.E).ErrorS(err, "error during SetupDockerSocket") } _, err = dockerSock.PurgeContainer("", REGISTRY_IMG) if err != nil { - logrus.Errorf("Purge error in SetupDockerSocket %s", err) + klog.V(log.E).ErrorS(err, "error during SetupDockerSocket") } d := DockerLocalRegistry{Connection: dockerSocketConn} - logrus.Info("Check if registry image is present :", d.IsRegistryImagePresent()) + klog.V(log.I).InfoS("Check if registry image is present", "isPresent", d.IsRegistryImagePresent()) if !d.IsRegistryImagePresent() { dockerSock.PullImage(REGISTRY_IMG_FULL_TAG) } registryID := d.GetRegistryRunningID() if len(registryID) == 0 { registryID = d.StartRegistry() - logrus.Errorf("Registry started") + klog.V(log.E).ErrorS(err, "Registry started") } else { - logrus.Infof("Registry already up and running with ID %s", registryID) + klog.V(log.I).InfoS("Registry already up and running", "ID", registryID) } return d, registryID, dockerSock diff --git a/container-builder/go.mod b/container-builder/go.mod index 4420edd55..28c17ff8c 100644 --- a/container-builder/go.mod +++ b/container-builder/go.mod @@ -5,19 +5,18 @@ go 1.19 require ( github.com/docker/docker v23.0.3+incompatible github.com/docker/go-connections v0.4.1-0.20210727194412-58542c764a11 - github.com/go-logr/logr v1.2.4 github.com/hashicorp/go-version v1.6.0 github.com/heroku/docker-registry-client v0.0.0-20211012143308-9463674c8930 github.com/jpillora/backoff v1.0.0 github.com/mitchellh/go-homedir v1.1.0 github.com/opencontainers/go-digest v1.0.0 github.com/pkg/errors v0.9.1 - github.com/sirupsen/logrus v1.9.0 github.com/stretchr/testify v1.8.2 golang.org/x/net v0.10.0 k8s.io/api v0.27.2 k8s.io/apimachinery v0.27.2 k8s.io/client-go v0.27.2 + k8s.io/klog/v2 v2.100.1 sigs.k8s.io/controller-runtime v0.15.0 ) @@ -33,6 +32,7 @@ require ( github.com/evanphx/json-patch v5.6.0+incompatible // indirect github.com/evanphx/json-patch/v5 v5.6.0 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/go-logr/logr v1.2.4 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect github.com/go-openapi/jsonreference v0.20.1 // indirect github.com/go-openapi/swag v0.22.3 // indirect @@ -60,6 +60,7 @@ require ( github.com/prometheus/client_model v0.4.0 // indirect github.com/prometheus/common v0.42.0 // indirect github.com/prometheus/procfs v0.9.0 // indirect + github.com/sirupsen/logrus v1.9.0 // indirect github.com/spf13/pflag v1.0.5 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.9.0 // indirect @@ -78,7 +79,6 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.0.3 // indirect k8s.io/component-base v0.27.2 // indirect - k8s.io/klog/v2 v2.90.1 // indirect k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect k8s.io/utils v0.0.0-20230313181309-38a27ef9d749 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect diff --git a/container-builder/go.sum b/container-builder/go.sum index 7f3ecdd93..223c56157 100644 --- a/container-builder/go.sum +++ b/container-builder/go.sum @@ -458,8 +458,8 @@ k8s.io/client-go v0.27.2 h1:vDLSeuYvCHKeoQRhCXjxXO45nHVv2Ip4Fe0MfioMrhE= k8s.io/client-go v0.27.2/go.mod h1:tY0gVmUsHrAmjzHX9zs7eCjxcBsf8IiNe7KQ52biTcQ= k8s.io/component-base v0.27.2 h1:neju+7s/r5O4x4/txeUONNTS9r1HsPbyoPBAtHsDCpo= k8s.io/component-base v0.27.2/go.mod h1:5UPk7EjfgrfgRIuDBFtsEFAe4DAvP3U+M8RTzoSJkpo= -k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw= -k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= +k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg= k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg= k8s.io/utils v0.0.0-20230313181309-38a27ef9d749 h1:xMMXJlJbsU8w3V5N2FLDQ8YgU8s1EoULdbQBcAeNJkY= diff --git a/container-builder/util/log/log.go b/container-builder/util/log/log.go index 3acd8fd7a..1bca70923 100644 --- a/container-builder/util/log/log.go +++ b/container-builder/util/log/log.go @@ -16,119 +16,10 @@ package log -import ( - "fmt" - - "github.com/go-logr/logr" - logf "sigs.k8s.io/controller-runtime/pkg/log" - - "github.com/kiegroup/kogito-serverless-operator/container-builder/util" +// Constants for different log level verbosity. +const ( + E = iota + W = iota + I = iota + D = iota ) - -// Log --. -var Log Logger - -func init() { - Log = Logger{ - delegate: logf.Log.WithName(util.ComponentName), - } -} - -// Injectable identifies objects that can receive a Logger. -type Injectable interface { - InjectLogger(Logger) -} - -// Logger --. -type Logger struct { - delegate logr.Logger -} - -// Debugf --. -func (l Logger) Debugf(format string, args ...interface{}) { - l.delegate.V(1).Info(fmt.Sprintf(format, args...)) -} - -// Infof --. -func (l Logger) Infof(format string, args ...interface{}) { - l.delegate.Info(fmt.Sprintf(format, args...)) -} - -// Errorf --. -func (l Logger) Errorf(err error, format string, args ...interface{}) { - l.delegate.Error(err, fmt.Sprintf(format, args...)) -} - -// Debug --. -func (l Logger) Debug(msg string, keysAndValues ...interface{}) { - l.delegate.V(1).Info(msg, keysAndValues...) -} - -// Info --. -func (l Logger) Info(msg string, keysAndValues ...interface{}) { - l.delegate.Info(msg, keysAndValues...) -} - -// Error --. -func (l Logger) Error(err error, msg string, keysAndValues ...interface{}) { - l.delegate.Error(err, msg, keysAndValues...) -} - -// WithName --. -func (l Logger) WithName(name string) Logger { - return Logger{ - delegate: l.delegate.WithName(name), - } -} - -// WithValues --. -func (l Logger) WithValues(keysAndValues ...interface{}) Logger { - return Logger{ - delegate: l.delegate.WithValues(keysAndValues...), - } -} - -// AsLogger --. -func (l Logger) AsLogger() logr.Logger { - return l.delegate -} - -// WithName --. -func WithName(name string) Logger { - return Log.WithName(name) -} - -// WithValues --. -func WithValues(keysAndValues ...interface{}) Logger { - return Log.WithValues(keysAndValues...) -} - -// Debugf --. -func Debugf(format string, args ...interface{}) { - Log.Debugf(format, args...) -} - -// Infof --. -func Infof(format string, args ...interface{}) { - Log.Infof(format, args...) -} - -// Errorf --. -func Errorf(err error, format string, args ...interface{}) { - Log.Errorf(err, format, args...) -} - -// Debug --. -func Debug(msg string, keysAndValues ...interface{}) { - Log.Debug(msg, keysAndValues...) -} - -// Info --. -func Info(msg string, keysAndValues ...interface{}) { - Log.Info(msg, keysAndValues...) -} - -// Error --. -func Error(err error, msg string, keysAndValues ...interface{}) { - Log.Error(err, msg, keysAndValues...) -} diff --git a/controllers/builder/builder.go b/controllers/builder/builder.go index 99db6f88b..70b2a7545 100644 --- a/controllers/builder/builder.go +++ b/controllers/builder/builder.go @@ -16,18 +16,19 @@ package builder import ( "context" - "fmt" + + "k8s.io/klog/v2" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/client-go/rest" "sigs.k8s.io/controller-runtime/pkg/client" - ctrllog "sigs.k8s.io/controller-runtime/pkg/log" "github.com/kiegroup/kogito-serverless-operator/controllers/workflowdef" operatorapi "github.com/kiegroup/kogito-serverless-operator/api/v1alpha08" "github.com/kiegroup/kogito-serverless-operator/controllers/platform" + "github.com/kiegroup/kogito-serverless-operator/log" ) type buildManagerContext struct { @@ -43,18 +44,17 @@ type BuildManager interface { } func NewBuildManager(ctx context.Context, client client.Client, cliConfig *rest.Config, targetName, targetNamespace string) (BuildManager, error) { - logger := ctrllog.FromContext(ctx) p, err := platform.GetActivePlatform(ctx, client, targetNamespace) if err != nil { if errors.IsNotFound(err) { return nil, err } - logger.Error(err, fmt.Sprintf("Error retrieving the active platform. Workflow %s build cannot be performed!", targetName)) + klog.V(log.E).ErrorS(err, "Error retrieving the active platform. Workflow build cannot be performed!", "workflow", targetName) return nil, err } commonConfig, err := GetCommonConfigMap(client, targetNamespace) if err != nil { - logger.Error(err, "Failed to get common configMap for Workflow Builder. Make sure that sonataflow-operator-builder-config is present in the operator namespace.") + klog.V(log.E).ErrorS(err, "Failed to get common configMap for Workflow Builder. Make sure that sonataflow-operator-builder-config is present in the operator namespace.") return nil, err } managerContext := buildManagerContext{ @@ -69,7 +69,7 @@ func NewBuildManager(ctx context.Context, client client.Client, cliConfig *rest. case operatorapi.PlatformClusterKubernetes: return newContainerBuilderManager(managerContext, cliConfig), nil default: - logger.Info("Impossible to check the Cluster type in the SonataFlowPlatform") + klog.V(log.I).InfoS("Impossible to check the Cluster type in the SonataFlowPlatform") return newContainerBuilderManager(managerContext, cliConfig), nil } } diff --git a/controllers/builder/config.go b/controllers/builder/config.go index 7fbafb9e8..e64be2d27 100644 --- a/controllers/builder/config.go +++ b/controllers/builder/config.go @@ -19,6 +19,8 @@ import ( "fmt" "os" + "k8s.io/klog/v2" + "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -26,7 +28,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" operatorapi "github.com/kiegroup/kogito-serverless-operator/api/v1alpha08" - "github.com/kiegroup/kogito-serverless-operator/container-builder/util/log" + "github.com/kiegroup/kogito-serverless-operator/log" ) const ( @@ -78,13 +80,13 @@ func GetCommonConfigMap(client client.Client, fallbackNS string) (*corev1.Config err := client.Get(context.TODO(), types.NamespacedName{Name: ConfigMapName, Namespace: namespace}, existingConfigMap) if err != nil { - log.Error(err, "fetching configmap "+ConfigMapName) + klog.V(log.E).ErrorS(err, "fetching configmap", "name", ConfigMapName) return nil, err } err = isValidBuilderCommonConfigMap(existingConfigMap) if err != nil { - log.Error(err, "configmap "+ConfigMapName+" is not valid") + klog.V(log.E).ErrorS(err, "configmap is not valid", "name", ConfigMapName) return existingConfigMap, err } diff --git a/controllers/builder/containerbuilder.go b/controllers/builder/containerbuilder.go index ef1fc7010..d907f9758 100644 --- a/controllers/builder/containerbuilder.go +++ b/controllers/builder/containerbuilder.go @@ -17,10 +17,11 @@ package builder import ( "time" + "k8s.io/klog/v2" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/rest" - ctrllog "sigs.k8s.io/controller-runtime/pkg/log" operatorapi "github.com/kiegroup/kogito-serverless-operator/api/v1alpha08" clientr "github.com/kiegroup/kogito-serverless-operator/container-builder/client" @@ -30,6 +31,7 @@ import ( "github.com/kiegroup/kogito-serverless-operator/container-builder/api" builder "github.com/kiegroup/kogito-serverless-operator/container-builder/builder/kubernetes" "github.com/kiegroup/kogito-serverless-operator/container-builder/client" + "github.com/kiegroup/kogito-serverless-operator/log" ) const ( @@ -122,7 +124,6 @@ func (c *containerBuilderManager) reconcileBuild(build *api.ContainerBuild, cli } func (c *containerBuilderManager) buildImage(kb internalBuilder) (*api.ContainerBuild, error) { - log := ctrllog.FromContext(c.ctx) cli, err := client.FromCtrlClientSchemeAndConfig(c.client, c.client.Scheme(), c.restConfig) plat := api.PlatformContainerBuild{ ObjectReference: api.ObjectReference{ @@ -145,14 +146,13 @@ func (c *containerBuilderManager) buildImage(kb internalBuilder) (*api.Container build, err := newBuild(kb, plat, c.commonConfig.Data[configKeyDefaultExtension], cli) if err != nil { - log.Error(err, err.Error()) + klog.V(log.E).ErrorS(err, "error during build Image") return nil, err } return build, err } func (c *containerBuilderManager) scheduleBuild(kb internalBuilder) (*api.ContainerBuild, error) { - log := ctrllog.FromContext(c.ctx) cli, err := client.FromCtrlClientSchemeAndConfig(c.client, c.client.Scheme(), c.restConfig) plat := api.PlatformContainerBuild{ ObjectReference: api.ObjectReference{ @@ -175,7 +175,7 @@ func (c *containerBuilderManager) scheduleBuild(kb internalBuilder) (*api.Contai build, err := newBuild(kb, plat, c.commonConfig.Data[configKeyDefaultExtension], cli) if err != nil { - log.Error(err, err.Error()) + klog.V(log.E).ErrorS(err, "error during schedule build") return nil, err } return build, err diff --git a/controllers/platform/action.go b/controllers/platform/action.go index 8b6f2060a..46ab1b99e 100644 --- a/controllers/platform/action.go +++ b/controllers/platform/action.go @@ -18,7 +18,6 @@ import ( "context" "github.com/kiegroup/kogito-serverless-operator/container-builder/client" - "github.com/kiegroup/kogito-serverless-operator/container-builder/util/log" v08 "github.com/kiegroup/kogito-serverless-operator/api/v1alpha08" ) @@ -26,7 +25,6 @@ import ( // Action --. type Action interface { client.Injectable - log.Injectable // a user friendly name for the action Name() string @@ -40,13 +38,8 @@ type Action interface { type baseAction struct { client client.Client - Logger log.Logger } func (action *baseAction) InjectClient(client client.Client) { action.client = client } - -func (action *baseAction) InjectLogger(log log.Logger) { - action.Logger = log -} diff --git a/controllers/platform/defaults.go b/controllers/platform/defaults.go index e9a69af4e..a6da66cb9 100644 --- a/controllers/platform/defaults.go +++ b/controllers/platform/defaults.go @@ -17,10 +17,12 @@ package platform import ( "context" + "k8s.io/klog/v2" + ctrl "sigs.k8s.io/controller-runtime/pkg/client" "github.com/kiegroup/kogito-serverless-operator/container-builder/client" - "github.com/kiegroup/kogito-serverless-operator/container-builder/util/log" + "github.com/kiegroup/kogito-serverless-operator/log" "github.com/kiegroup/kogito-serverless-operator/utils" operatorapi "github.com/kiegroup/kogito-serverless-operator/api/v1alpha08" @@ -48,7 +50,7 @@ func ConfigureDefaults(ctx context.Context, c client.Client, p *operatorapi.Sona } if verbose && p.Spec.BuildPlatform.Timeout.Duration != 0 { - log.Log.Infof("Maven Timeout set to %s", p.Spec.BuildPlatform.Timeout.Duration) + klog.V(log.I).InfoS("Maven Timeout set", "timeout", p.Spec.BuildPlatform.Timeout.Duration) } updatePlatform(ctx, c, p) @@ -60,13 +62,13 @@ func updatePlatform(ctx context.Context, c client.Client, p *operatorapi.SonataF config := operatorapi.SonataFlowPlatform{} errGet := c.Get(ctx, ctrl.ObjectKey{Namespace: p.Namespace, Name: p.Name}, &config) if errGet != nil { - log.Error(errGet, "Error reading the Platform") + klog.V(log.E).ErrorS(errGet, "Error reading the Platform") } config.Spec = p.Spec config.Status.Cluster = p.Status.Cluster updateErr := c.Update(ctx, &config) if updateErr != nil { - log.Error(updateErr, "Error updating the BuildPlatform") + klog.V(log.E).ErrorS(updateErr, "Error updating the BuildPlatform") } } diff --git a/controllers/platform/initialize.go b/controllers/platform/initialize.go index a4dc08f9c..a1e022ff9 100644 --- a/controllers/platform/initialize.go +++ b/controllers/platform/initialize.go @@ -17,6 +17,8 @@ package platform import ( "context" + "k8s.io/klog/v2" + corev1 "k8s.io/api/core/v1" k8serrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/resource" @@ -27,6 +29,7 @@ import ( "github.com/kiegroup/kogito-serverless-operator/container-builder/client" operatorapi "github.com/kiegroup/kogito-serverless-operator/api/v1alpha08" + "github.com/kiegroup/kogito-serverless-operator/log" ) const ( @@ -76,13 +79,13 @@ func (action *initializeAction) Handle(ctx context.Context, platform *operatorap //If KanikoCache is enabled if IsKanikoCacheEnabled(platform) { // Create the persistent volume claim used by the Kaniko cache - action.Logger.Info("Create persistent volume claim") + klog.V(log.I).InfoS("Create persistent volume claim") err := createPersistentVolumeClaim(ctx, action.client, platform) if err != nil { return nil, err } // Create the Kaniko warmer pod that caches the base image into the SonataFlow builder volume - action.Logger.Info("Create Kaniko cache warmer pod") + klog.V(log.I).InfoS("Create Kaniko cache warmer pod") err = createKanikoCacheWarmerPod(ctx, action.client, platform) if err != nil { return nil, err diff --git a/controllers/platform/monitor.go b/controllers/platform/monitor.go index 4ac7ad6bb..c3b928568 100644 --- a/controllers/platform/monitor.go +++ b/controllers/platform/monitor.go @@ -17,8 +17,11 @@ package platform import ( "context" + "k8s.io/klog/v2" + "github.com/kiegroup/kogito-serverless-operator/api/metadata" operatorapi "github.com/kiegroup/kogito-serverless-operator/api/v1alpha08" + "github.com/kiegroup/kogito-serverless-operator/log" ) // NewMonitorAction returns an action that monitors the build platform after it's fully initialized. @@ -42,7 +45,7 @@ func (action *monitorAction) Handle(ctx context.Context, platform *operatorapi.S // Just track the version of the operator in the platform resource if platform.Status.Version != metadata.SpecVersion { platform.Status.Version = metadata.SpecVersion - action.Logger.Info("Platform version updated", "version", platform.Status.Version) + klog.V(log.I).InfoS("Platform version updated", "version", platform.Status.Version) } // Refresh applied configuration diff --git a/controllers/platform/platform.go b/controllers/platform/platform.go index bde459773..f252d3ff0 100644 --- a/controllers/platform/platform.go +++ b/controllers/platform/platform.go @@ -20,13 +20,15 @@ import ( "os" "strings" + "k8s.io/klog/v2" + coordination "k8s.io/api/coordination/v1" k8serrors "k8s.io/apimachinery/pkg/api/errors" ctrl "sigs.k8s.io/controller-runtime/pkg/client" "github.com/kiegroup/kogito-serverless-operator/api/metadata" - "github.com/kiegroup/kogito-serverless-operator/container-builder/util/log" + "github.com/kiegroup/kogito-serverless-operator/log" operatorapi "github.com/kiegroup/kogito-serverless-operator/api/v1alpha08" "github.com/kiegroup/kogito-serverless-operator/utils" @@ -118,7 +120,7 @@ func GetActivePlatform(ctx context.Context, c ctrl.Reader, namespace string) (*o // GetLocalPlatform returns the currently installed platform or any platform existing in local namespace. func GetLocalPlatform(ctx context.Context, c ctrl.Reader, namespace string, active bool) (*operatorapi.SonataFlowPlatform, error) { - log.Debug("Finding available platforms") + klog.V(log.D).InfoS("Finding available platforms") lst, err := ListPrimaryPlatforms(ctx, c, namespace) if err != nil { @@ -128,7 +130,7 @@ func GetLocalPlatform(ctx context.Context, c ctrl.Reader, namespace string, acti for _, platform := range lst.Items { platform := platform // pin if IsActive(&platform) { - log.Debugf("Found active local build platform %s", platform.Name) + klog.V(log.D).InfoS("Found active local build platform", "platform", platform.Name) return &platform, nil } } @@ -136,11 +138,11 @@ func GetLocalPlatform(ctx context.Context, c ctrl.Reader, namespace string, acti if !active && len(lst.Items) > 0 { // does not require the platform to be active, just return one if present res := lst.Items[0] - log.Debugf("Found local build platform %s", res.Name) + klog.V(log.D).InfoS("Found local build platform", "platform", res.Name) return &res, nil } - log.Debugf("Not found a local build platform") + klog.V(log.D).InfoS("Not found a local build platform") return nil, k8serrors.NewNotFound(operatorapi.Resource("SonataFlowPlatform"), DefaultPlatformName) } diff --git a/controllers/platform/platformutils.go b/controllers/platform/platformutils.go index d230c8620..983eb8eb5 100644 --- a/controllers/platform/platformutils.go +++ b/controllers/platform/platformutils.go @@ -21,6 +21,8 @@ import ( "strings" "time" + "k8s.io/klog/v2" + corev1 "k8s.io/api/core/v1" k8serrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -31,7 +33,7 @@ import ( "github.com/kiegroup/kogito-serverless-operator/container-builder/client" "github.com/kiegroup/kogito-serverless-operator/container-builder/util/defaults" - "github.com/kiegroup/kogito-serverless-operator/container-builder/util/log" + "github.com/kiegroup/kogito-serverless-operator/log" operatorapi "github.com/kiegroup/kogito-serverless-operator/api/v1alpha08" ) @@ -45,7 +47,7 @@ func ConfigureRegistry(ctx context.Context, c client.Client, p *operatorapi.Sona //@TODO Add a notification on the status about this registry value ignored when https://issues.redhat.com/browse/KOGITO-9218 will be implemented if p.Spec.BuildPlatform.BuildStrategy == operatorapi.PlatformBuildStrategy && p.Status.Cluster == operatorapi.PlatformClusterOpenShift { p.Spec.BuildPlatform.Registry = operatorapi.RegistrySpec{} - log.Info("Platform registry not set and ignored on openshift cluster") + klog.V(log.I).InfoS("Platform registry not set and ignored on openshift cluster") return nil } @@ -53,19 +55,19 @@ func ConfigureRegistry(ctx context.Context, c client.Client, p *operatorapi.Sona // try KEP-1755 address, err := GetRegistryAddress(ctx, c) if err != nil && verbose { - log.Error(err, "Cannot find a registry where to push images via KEP-1755") + klog.V(log.E).ErrorS(err, "Cannot find a registry where to push images via KEP-1755") } else if err == nil && address != nil { p.Spec.BuildPlatform.Registry.Address = *address } } - log.Debugf("Final Registry Address: %s", p.Spec.BuildPlatform.Registry.Address) + klog.V(log.D).InfoS("Final Registry Address", "address", p.Spec.BuildPlatform.Registry.Address) return nil } func SetPlatformDefaults(p *operatorapi.SonataFlowPlatform, verbose bool) error { if p.Spec.BuildPlatform.BuildStrategyOptions == nil { - log.Debugf("SonataFlow Platform [%s]: setting publish strategy options", p.Namespace) + klog.V(log.D).InfoS("SonataFlow Platform: setting publish strategy options", "namespace", p.Namespace) p.Spec.BuildPlatform.BuildStrategyOptions = map[string]string{} } @@ -73,15 +75,15 @@ func SetPlatformDefaults(p *operatorapi.SonataFlowPlatform, verbose bool) error d := p.Spec.BuildPlatform.GetTimeout().Duration.Truncate(time.Second) if verbose && p.Spec.BuildPlatform.Timeout.Duration != d { - log.Log.Infof("ContainerBuild timeout minimum unit is sec (configured: %s, truncated: %s)", p.Spec.BuildPlatform.GetTimeout().Duration, d) + klog.V(log.I).InfoS("ContainerBuild timeout minimum unit is sec", "configured", p.Spec.BuildPlatform.GetTimeout().Duration, "truncated", d) } - log.Debugf("SonataFlow Platform [%s]: setting build timeout", p.Namespace) + klog.V(log.D).InfoS("SonataFlow Platform: setting build timeout", "namespace", p.Namespace) p.Spec.BuildPlatform.Timeout = &metav1.Duration{ Duration: d, } } else { - log.Debugf("SonataFlow Platform [%s]: setting default build timeout to 5 minutes", p.Namespace) + klog.V(log.D).InfoS("SonataFlow Platform setting default build timeout to 5 minutes", "namespace", p.Namespace) p.Spec.BuildPlatform.Timeout = &metav1.Duration{ Duration: 5 * time.Minute, } @@ -101,15 +103,15 @@ func SetPlatformDefaults(p *operatorapi.SonataFlowPlatform, verbose bool) error defaultKanikoBuildCache := "false" p.Spec.BuildPlatform.BuildStrategyOptions[kanikoBuildCacheEnabled] = defaultKanikoBuildCache if verbose { - log.Log.Infof("Kaniko cache set to %s", defaultKanikoBuildCache) + klog.V(log.I).InfoS("Kaniko cache set", "value", defaultKanikoBuildCache) } } setStatusAdditionalInfo(p) if verbose { - log.Log.Infof("BaseImage set to %s", p.Spec.BuildPlatform.BaseImage) - log.Log.Infof("Timeout set to %s", p.Spec.BuildPlatform.GetTimeout()) + klog.V(log.I).InfoS("BaseImage set", "value", p.Spec.BuildPlatform.BaseImage) + klog.V(log.I).InfoS("Timeout set", "value", p.Spec.BuildPlatform.GetTimeout()) } return nil } @@ -117,11 +119,11 @@ func SetPlatformDefaults(p *operatorapi.SonataFlowPlatform, verbose bool) error func setStatusAdditionalInfo(platform *operatorapi.SonataFlowPlatform) { platform.Status.Info = make(map[string]string) - log.Debugf("SonataFlow Platform [%s]: setting build publish strategy", platform.Namespace) + klog.V(log.D).InfoS("SonataFlow Platform setting build publish strategy", "namespace", platform.Namespace) if platform.Spec.BuildPlatform.BuildStrategy == operatorapi.OperatorBuildStrategy { platform.Status.Info["kanikoVersion"] = defaults.KanikoVersion } - log.Debugf("SonataFlow [%s]: setting status info", platform.Namespace) + klog.V(log.D).InfoS("SonataFlow setting status info", "namespace", platform.Namespace) platform.Status.Info["goVersion"] = runtime.Version() platform.Status.Info["goOS"] = runtime.GOOS } diff --git a/controllers/platform/warm.go b/controllers/platform/warm.go index f7786502e..2a756fa10 100644 --- a/controllers/platform/warm.go +++ b/controllers/platform/warm.go @@ -18,12 +18,15 @@ import ( "context" "errors" + "k8s.io/klog/v2" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" ctrl "sigs.k8s.io/controller-runtime/pkg/client" operatorapi "github.com/kiegroup/kogito-serverless-operator/api/v1alpha08" + "github.com/kiegroup/kogito-serverless-operator/log" ) func NewWarmAction(reader ctrl.Reader) Action { @@ -65,13 +68,13 @@ func (action *warmAction) Handle(ctx context.Context, platform *operatorapi.Sona switch pod.Status.Phase { case corev1.PodSucceeded: - action.Logger.Info("Kaniko cache successfully warmed up") + klog.V(log.I).InfoS("Kaniko cache successfully warmed up") platform.Status.Phase = operatorapi.PlatformPhaseCreating return platform, nil case corev1.PodFailed: return nil, errors.New("failed to warm up Kaniko cache") default: - action.Logger.Info("Waiting for Kaniko cache to warm up...") + klog.V(log.I).InfoS("Waiting for Kaniko cache to warm up...") // Requeue return nil, nil } diff --git a/controllers/profiles/ensurer.go b/controllers/profiles/ensurer.go index 2087734b2..93af57708 100644 --- a/controllers/profiles/ensurer.go +++ b/controllers/profiles/ensurer.go @@ -17,7 +17,10 @@ package profiles import ( "context" - "github.com/go-logr/logr" + "k8s.io/klog/v2" + + "github.com/kiegroup/kogito-serverless-operator/log" + "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" @@ -29,10 +32,9 @@ type ObjectEnsurer interface { } // newDefaultObjectEnsurer see defaultObjectEnsurer -func newDefaultObjectEnsurer(client client.Client, logger *logr.Logger, creator objectCreator) ObjectEnsurer { +func newDefaultObjectEnsurer(client client.Client, creator objectCreator) ObjectEnsurer { return &defaultObjectEnsurer{ client: client, - logger: logger, creator: creator, } } @@ -40,7 +42,6 @@ func newDefaultObjectEnsurer(client client.Client, logger *logr.Logger, creator // defaultObjectEnsurer provides the engine for a ReconciliationState that needs to create or update a given Kubernetes object during the reconciliation cycle. type defaultObjectEnsurer struct { client client.Client - logger *logr.Logger creator objectCreator } @@ -82,7 +83,7 @@ func (d *defaultObjectEnsurer) ensure(ctx context.Context, workflow *operatorapi }); err != nil { return nil, result, err } - d.logger.Info("Object operation finalized", "result", result, "kind", object.GetObjectKind().GroupVersionKind().String(), "name", object.GetName(), "namespace", object.GetNamespace()) + klog.V(log.I).InfoS("Object operation finalized", "result", result, "kind", object.GetObjectKind().GroupVersionKind().String(), "name", object.GetName(), "namespace", object.GetNamespace()) return object, result, nil } diff --git a/controllers/profiles/profile.go b/controllers/profiles/profile.go index 1c2816de8..cd112ed7c 100644 --- a/controllers/profiles/profile.go +++ b/controllers/profiles/profile.go @@ -15,7 +15,6 @@ package profiles import ( - "github.com/go-logr/logr" "k8s.io/client-go/rest" "sigs.k8s.io/controller-runtime/pkg/client" @@ -27,7 +26,7 @@ const ( defaultProfile = metadata.ProdProfile ) -type reconcilerBuilder func(client client.Client, config *rest.Config, logger *logr.Logger) ProfileReconciler +type reconcilerBuilder func(client client.Client, config *rest.Config) ProfileReconciler var profileBuilders = map[metadata.ProfileType]reconcilerBuilder{ metadata.ProdProfile: newProdProfileReconciler, diff --git a/controllers/profiles/reconciler.go b/controllers/profiles/reconciler.go index acdbe972c..02de8092b 100644 --- a/controllers/profiles/reconciler.go +++ b/controllers/profiles/reconciler.go @@ -18,15 +18,17 @@ import ( "context" "fmt" + "k8s.io/klog/v2" + "k8s.io/client-go/rest" "github.com/kiegroup/kogito-serverless-operator/api/metadata" - "github.com/go-logr/logr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" operatorapi "github.com/kiegroup/kogito-serverless-operator/api/v1alpha08" + "github.com/kiegroup/kogito-serverless-operator/log" ) // ProfileReconciler is the public interface to have access to this package and perform the actual reconciliation flow. @@ -64,7 +66,6 @@ type ProfileReconciler interface { // stateSupport is the shared structure with common accessors used throughout the whole reconciliation profiles type stateSupport struct { - logger *logr.Logger client client.Client } @@ -73,7 +74,7 @@ func (s stateSupport) performStatusUpdate(ctx context.Context, workflow *operato var err error workflow.Status.ObservedGeneration = workflow.Generation if err = s.client.Status().Update(ctx, workflow); err != nil { - s.logger.Error(err, "Failed to update Workflow status") + klog.V(log.E).ErrorS(err, "Failed to update Workflow status") return false, err } return true, err @@ -108,7 +109,7 @@ func (b baseReconciler) Reconcile(ctx context.Context, workflow *operatorapi.Son return result, err } b.objects = objects - b.logger.Info("Returning from reconciliation", "Result", result) + klog.V(log.I).InfoS("Returning from reconciliation", "Result", result) return result, err } @@ -125,10 +126,9 @@ type ReconciliationState interface { } // newReconciliationStateMachine builder for the reconciliationStateMachine -func newReconciliationStateMachine(logger *logr.Logger, states ...ReconciliationState) *reconciliationStateMachine { +func newReconciliationStateMachine(states ...ReconciliationState) *reconciliationStateMachine { return &reconciliationStateMachine{ states: states, - logger: logger, } } @@ -138,19 +138,18 @@ func newReconciliationStateMachine(logger *logr.Logger, states ...Reconciliation // TODO: implement state transition, so based on a given condition we do the status update which actively transition the object state type reconciliationStateMachine struct { states []ReconciliationState - logger *logr.Logger } func (r *reconciliationStateMachine) do(ctx context.Context, workflow *operatorapi.SonataFlow) (ctrl.Result, []client.Object, error) { for _, h := range r.states { if h.CanReconcile(workflow) { - r.logger.Info("Found a condition to reconcile.", "Conditions", workflow.Status.Conditions) + klog.V(log.I).InfoS("Found a condition to reconcile.", "Conditions", workflow.Status.Conditions) result, objs, err := h.Do(ctx, workflow) if err != nil { return result, objs, err } if err = h.PostReconcile(ctx, workflow); err != nil { - r.logger.Error(err, "Error in Post Reconcile actions.", "Workflow", workflow.Name, "Conditions", workflow.Status.Conditions) + klog.V(log.E).ErrorS(err, "Error in Post Reconcile actions.", "Workflow", workflow.Name, "Conditions", workflow.Status.Conditions) } return result, objs, err } @@ -159,6 +158,6 @@ func (r *reconciliationStateMachine) do(ctx context.Context, workflow *operatora } // NewReconciler creates a new ProfileReconciler based on the given workflow and context. -func NewReconciler(client client.Client, config *rest.Config, logger *logr.Logger, workflow *operatorapi.SonataFlow) ProfileReconciler { - return profileBuilder(workflow)(client, config, logger) +func NewReconciler(client client.Client, config *rest.Config, workflow *operatorapi.SonataFlow) ProfileReconciler { + return profileBuilder(workflow)(client, config) } diff --git a/controllers/profiles/reconciler_dev.go b/controllers/profiles/reconciler_dev.go index d702fd523..353ff1cbe 100644 --- a/controllers/profiles/reconciler_dev.go +++ b/controllers/profiles/reconciler_dev.go @@ -20,6 +20,8 @@ import ( "path" "time" + "k8s.io/klog/v2" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/kiegroup/kogito-serverless-operator/workflowproj" @@ -29,11 +31,11 @@ import ( "github.com/kiegroup/kogito-serverless-operator/api/metadata" "github.com/kiegroup/kogito-serverless-operator/controllers/workflowdef" + "github.com/kiegroup/kogito-serverless-operator/log" "github.com/kiegroup/kogito-serverless-operator/utils" "github.com/kiegroup/kogito-serverless-operator/controllers/platform" - "github.com/go-logr/logr" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -42,7 +44,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "github.com/kiegroup/kogito-serverless-operator/api" - operatorapi "github.com/kiegroup/kogito-serverless-operator/api/v1alpha08" kubeutil "github.com/kiegroup/kogito-serverless-operator/utils/kubernetes" ) @@ -76,9 +77,8 @@ func (d developmentProfile) GetProfile() metadata.ProfileType { return metadata.DevProfile } -func newDevProfileReconciler(client client.Client, config *rest.Config, logger *logr.Logger) ProfileReconciler { +func newDevProfileReconciler(client client.Client, config *rest.Config) ProfileReconciler { support := &stateSupport{ - logger: logger, client: client, } @@ -92,7 +92,7 @@ func newDevProfileReconciler(client client.Client, config *rest.Config, logger * enrichers = newDevelopmentObjectEnrichers(support) } - stateMachine := newReconciliationStateMachine(logger, + stateMachine := newReconciliationStateMachine( &ensureRunningDevWorkflowReconciliationState{stateSupport: support, ensurers: ensurers}, &followDeployDevWorkflowReconciliationState{stateSupport: support, enrichers: enrichers}, &recoverFromFailureDevReconciliationState{stateSupport: support}) @@ -101,39 +101,39 @@ func newDevProfileReconciler(client client.Client, config *rest.Config, logger * baseReconciler: newBaseProfileReconciler(support, stateMachine), } - logger.Info("Reconciling in", "profile", profile.GetProfile()) + klog.V(log.I).InfoS("Reconciling in", "profile", profile.GetProfile()) return profile } func newDevelopmentObjectEnsurers(support *stateSupport) *devProfileObjectEnsurers { return &devProfileObjectEnsurers{ - deployment: newDefaultObjectEnsurer(support.client, support.logger, devDeploymentCreator), - service: newDefaultObjectEnsurer(support.client, support.logger, devServiceCreator), + deployment: newDefaultObjectEnsurer(support.client, devDeploymentCreator), + service: newDefaultObjectEnsurer(support.client, devServiceCreator), network: newDummyObjectEnsurer(), - definitionConfigMap: newDefaultObjectEnsurer(support.client, support.logger, workflowDefConfigMapCreator), - propertiesConfigMap: newDefaultObjectEnsurer(support.client, support.logger, workflowPropsConfigMapCreator), + definitionConfigMap: newDefaultObjectEnsurer(support.client, workflowDefConfigMapCreator), + propertiesConfigMap: newDefaultObjectEnsurer(support.client, workflowPropsConfigMapCreator), } } func newDevelopmentObjectEnsurersForOpenShift(support *stateSupport) *devProfileObjectEnsurers { return &devProfileObjectEnsurers{ - deployment: newDefaultObjectEnsurer(support.client, support.logger, devDeploymentCreator), - service: newDefaultObjectEnsurer(support.client, support.logger, defaultServiceCreator), - network: newDefaultObjectEnsurer(support.client, support.logger, defaultNetworkCreator), - definitionConfigMap: newDefaultObjectEnsurer(support.client, support.logger, workflowDefConfigMapCreator), - propertiesConfigMap: newDefaultObjectEnsurer(support.client, support.logger, workflowPropsConfigMapCreator), + deployment: newDefaultObjectEnsurer(support.client, devDeploymentCreator), + service: newDefaultObjectEnsurer(support.client, defaultServiceCreator), + network: newDefaultObjectEnsurer(support.client, defaultNetworkCreator), + definitionConfigMap: newDefaultObjectEnsurer(support.client, workflowDefConfigMapCreator), + propertiesConfigMap: newDefaultObjectEnsurer(support.client, workflowPropsConfigMapCreator), } } func newDevelopmentObjectEnrichers(support *stateSupport) *devProfileObjectEnrichers { return &devProfileObjectEnrichers{ - networkInfo: newStatusEnricher(support.client, support.logger, defaultDevStatusEnricher), + networkInfo: newStatusEnricher(support.client, defaultDevStatusEnricher), } } func newDevelopmentObjectEnrichersForOpenShift(support *stateSupport) *devProfileObjectEnrichers { return &devProfileObjectEnrichers{ - networkInfo: newStatusEnricher(support.client, support.logger, devStatusEnricherForOpenShift), + networkInfo: newStatusEnricher(support.client, devStatusEnricherForOpenShift), } } @@ -213,7 +213,7 @@ func (e *ensureRunningDevWorkflowReconciliationState) Do(ctx context.Context, wo // First time reconciling this object, mark as wait for deployment if workflow.Status.GetTopLevelCondition().IsUnknown() { - e.logger.Info("Workflow is in WaitingForDeployment Condition") + klog.V(log.I).InfoS("Workflow is in WaitingForDeployment Condition") workflow.Status.Manager().MarkFalse(api.RunningConditionType, api.WaitingForDeploymentReason, "") if _, err = e.performStatusUpdate(ctx, workflow); err != nil { return ctrl.Result{RequeueAfter: requeueAfterFailure}, objs, err @@ -224,7 +224,7 @@ func (e *ensureRunningDevWorkflowReconciliationState) Do(ctx context.Context, wo // Is the deployment still available? convertedDeployment := deployment.(*appsv1.Deployment) if !kubeutil.IsDeploymentAvailable(convertedDeployment) { - e.logger.Info("Workflow is not running due to a problem in the Deployment. Attempt to recover.") + klog.V(log.I).InfoS("Workflow is not running due to a problem in the Deployment. Attempt to recover.") workflow.Status.Manager().MarkFalse(api.RunningConditionType, api.DeploymentUnavailableReason, getDeploymentFailureMessage(convertedDeployment)) if _, err = e.performStatusUpdate(ctx, workflow); err != nil { return ctrl.Result{RequeueAfter: requeueAfterFailure}, objs, err @@ -256,7 +256,7 @@ func (f *followDeployDevWorkflowReconciliationState) Do(ctx context.Context, wor if kubeutil.IsDeploymentAvailable(deployment) { workflow.Status.Manager().MarkTrue(api.RunningConditionType) - f.logger.Info("Workflow is in Running Condition") + klog.V(log.I).InfoS("Workflow is in Running Condition") if _, err := f.performStatusUpdate(ctx, workflow); err != nil { return ctrl.Result{RequeueAfter: requeueAfterFailure}, nil, err @@ -266,7 +266,7 @@ func (f *followDeployDevWorkflowReconciliationState) Do(ctx context.Context, wor if !kubeutil.IsDeploymentFailed(deployment) { workflow.Status.Manager().MarkFalse(api.RunningConditionType, api.WaitingForDeploymentReason, "") - f.logger.Info("Workflow is in WaitingForDeployment Condition") + klog.V(log.I).InfoS("Workflow is in WaitingForDeployment Condition") if _, err := f.performStatusUpdate(ctx, workflow); err != nil { return ctrl.Result{RequeueAfter: requeueAfterFailure}, nil, err } @@ -276,7 +276,7 @@ func (f *followDeployDevWorkflowReconciliationState) Do(ctx context.Context, wor failedReason := getDeploymentFailureMessage(deployment) workflow.Status.LastTimeRecoverAttempt = metav1.Now() workflow.Status.Manager().MarkFalse(api.RunningConditionType, api.DeploymentFailureReason, failedReason) - f.logger.Info("Workflow deployment failed", "Reason Message", failedReason) + klog.V(log.I).InfoS("Workflow deployment failed", "Reason Message", failedReason) _, err := f.performStatusUpdate(ctx, workflow) return ctrl.Result{RequeueAfter: requeueAfterFailure}, nil, err } @@ -312,7 +312,7 @@ func (r *recoverFromFailureDevReconciliationState) Do(ctx context.Context, workf if err := r.client.Get(ctx, client.ObjectKeyFromObject(workflow), deployment); err != nil { // if the deployment is not there, let's try to reset the status condition and make the reconciliation fix the objects if errors.IsNotFound(err) { - r.logger.Info("Tried to recover from failed state, no deployment found, trying to reset the workflow conditions") + klog.V(log.I).InfoS("Tried to recover from failed state, no deployment found, trying to reset the workflow conditions") workflow.Status.RecoverFailureAttempts = 0 workflow.Status.Manager().MarkUnknown(api.RunningConditionType, "", "") if _, updateErr := r.performStatusUpdate(ctx, workflow); updateErr != nil { @@ -360,7 +360,7 @@ func (r *recoverFromFailureDevReconciliationState) Do(ctx context.Context, workf }) if retryErr != nil { - r.logger.Info("Error during Deployment rollout") + klog.V(log.E).ErrorS(retryErr, "Error during Deployment rollout") return ctrl.Result{RequeueAfter: requeueRecoverDeploymentErrorInterval}, nil, nil } diff --git a/controllers/profiles/reconciler_dev_test.go b/controllers/profiles/reconciler_dev_test.go index 4ceb9bd6e..79c883294 100644 --- a/controllers/profiles/reconciler_dev_test.go +++ b/controllers/profiles/reconciler_dev_test.go @@ -35,20 +35,18 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/intstr" clientruntime "sigs.k8s.io/controller-runtime/pkg/client" - ctrllog "sigs.k8s.io/controller-runtime/pkg/log" "github.com/kiegroup/kogito-serverless-operator/api" "github.com/kiegroup/kogito-serverless-operator/test" ) func Test_OverrideStartupProbe(t *testing.T) { - logger := ctrllog.FromContext(context.TODO()) workflow := test.GetBaseSonataFlow(t.Name()) client := test.NewKogitoClientBuilder().WithRuntimeObjects(workflow).WithStatusSubresource(workflow).Build() config := &rest.Config{} - devReconciler := newDevProfileReconciler(client, config, &logger) + devReconciler := newDevProfileReconciler(client, config) result, err := devReconciler.Reconcile(context.TODO(), workflow) assert.NoError(t, err) @@ -69,7 +67,6 @@ func Test_OverrideStartupProbe(t *testing.T) { } func Test_recoverFromFailureNoDeployment(t *testing.T) { - logger := ctrllog.FromContext(context.TODO()) workflow := test.GetBaseSonataFlow(t.Name()) workflowID := clientruntime.ObjectKeyFromObject(workflow) @@ -77,7 +74,7 @@ func Test_recoverFromFailureNoDeployment(t *testing.T) { client := test.NewKogitoClientBuilder().WithRuntimeObjects(workflow).WithStatusSubresource(workflow).Build() config := &rest.Config{} - reconciler := newDevProfileReconciler(client, config, &logger) + reconciler := newDevProfileReconciler(client, config) // we are in failed state and have no objects result, err := reconciler.Reconcile(context.TODO(), workflow) @@ -114,13 +111,12 @@ func Test_recoverFromFailureNoDeployment(t *testing.T) { } func Test_newDevProfile(t *testing.T) { - logger := ctrllog.FromContext(context.TODO()) workflow := test.GetBaseSonataFlow(t.Name()) client := test.NewKogitoClientBuilder().WithRuntimeObjects(workflow).WithStatusSubresource(workflow).Build() config := &rest.Config{} - devReconciler := newDevProfileReconciler(client, config, &logger) + devReconciler := newDevProfileReconciler(client, config) result, err := devReconciler.Reconcile(context.TODO(), workflow) assert.NoError(t, err) @@ -191,11 +187,10 @@ func Test_newDevProfile(t *testing.T) { } func Test_devProfileImageDefaultsNoPlatform(t *testing.T) { - logger := ctrllog.FromContext(context.TODO()) workflow := test.GetBaseSonataFlowWithDevProfile(t.Name()) client := test.NewKogitoClientBuilder().WithRuntimeObjects(workflow).WithStatusSubresource(workflow).Build() config := &rest.Config{} - devReconciler := newDevProfileReconciler(client, config, &logger) + devReconciler := newDevProfileReconciler(client, config) result, err := devReconciler.Reconcile(context.TODO(), workflow) assert.NoError(t, err) @@ -207,14 +202,13 @@ func Test_devProfileImageDefaultsNoPlatform(t *testing.T) { } func Test_devProfileWithImageSnapshotOverrideWithPlatform(t *testing.T) { - logger := ctrllog.FromContext(context.TODO()) workflow := test.GetBaseSonataFlowWithDevProfile(t.Name()) platform := test.GetBasePlatformWithDevBaseImageInReadyPhase(workflow.Namespace) client := test.NewKogitoClientBuilder().WithRuntimeObjects(workflow, platform).WithStatusSubresource(workflow, platform).Build() config := &rest.Config{} - devReconciler := newDevProfileReconciler(client, config, &logger) + devReconciler := newDevProfileReconciler(client, config) result, err := devReconciler.Reconcile(context.TODO(), workflow) assert.NoError(t, err) @@ -226,14 +220,13 @@ func Test_devProfileWithImageSnapshotOverrideWithPlatform(t *testing.T) { } func Test_devProfileWithWPlatformWithoutDevBaseImageAndWithBaseImage(t *testing.T) { - logger := ctrllog.FromContext(context.TODO()) workflow := test.GetBaseSonataFlowWithDevProfile(t.Name()) platform := test.GetBasePlatformWithBaseImageInReadyPhase(workflow.Namespace) client := test.NewKogitoClientBuilder().WithRuntimeObjects(workflow, platform).WithStatusSubresource(workflow, platform).Build() config := &rest.Config{} - devReconciler := newDevProfileReconciler(client, config, &logger) + devReconciler := newDevProfileReconciler(client, config) result, err := devReconciler.Reconcile(context.TODO(), workflow) assert.NoError(t, err) @@ -245,14 +238,13 @@ func Test_devProfileWithWPlatformWithoutDevBaseImageAndWithBaseImage(t *testing. } func Test_devProfileWithPlatformWithoutDevBaseImageAndWithoutBaseImage(t *testing.T) { - logger := ctrllog.FromContext(context.TODO()) workflow := test.GetBaseSonataFlowWithDevProfile(t.Name()) platform := test.GetBasePlatformInReadyPhase(workflow.Namespace) client := test.NewKogitoClientBuilder().WithRuntimeObjects(workflow, platform).WithStatusSubresource(workflow, platform).Build() config := &rest.Config{} - devReconciler := newDevProfileReconciler(client, config, &logger) + devReconciler := newDevProfileReconciler(client, config) result, err := devReconciler.Reconcile(context.TODO(), workflow) assert.NoError(t, err) @@ -264,7 +256,6 @@ func Test_devProfileWithPlatformWithoutDevBaseImageAndWithoutBaseImage(t *testin } func Test_newDevProfileWithExternalConfigMaps(t *testing.T) { - logger := ctrllog.FromContext(context.TODO()) configmapName := "mycamel-configmap" workflow := test.GetBaseSonataFlowWithDevProfile(t.Name()) workflow.Spec.Resources.ConfigMaps = append(workflow.Spec.Resources.ConfigMaps, @@ -273,7 +264,7 @@ func Test_newDevProfileWithExternalConfigMaps(t *testing.T) { config := &rest.Config{} client := test.NewKogitoClientBuilder().WithRuntimeObjects(workflow).WithStatusSubresource(workflow).Build() - devReconciler := newDevProfileReconciler(client, config, &logger) + devReconciler := newDevProfileReconciler(client, config) camelXmlRouteFileName := "camelroute-xml" xmlRoute := ` diff --git a/controllers/profiles/reconciler_prod.go b/controllers/profiles/reconciler_prod.go index 80d0ab54e..adb702929 100644 --- a/controllers/profiles/reconciler_prod.go +++ b/controllers/profiles/reconciler_prod.go @@ -18,6 +18,10 @@ import ( "context" "time" + "k8s.io/klog/v2" + + "github.com/kiegroup/kogito-serverless-operator/log" + "github.com/kiegroup/kogito-serverless-operator/api/metadata" "github.com/kiegroup/kogito-serverless-operator/utils" kubeutil "github.com/kiegroup/kogito-serverless-operator/utils/kubernetes" @@ -28,7 +32,6 @@ import ( "github.com/kiegroup/kogito-serverless-operator/controllers/workflowdef" - "github.com/go-logr/logr" appsv1 "k8s.io/api/apps/v1" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -68,20 +71,18 @@ type prodObjectEnsurers struct { func newProdObjectEnsurers(support *stateSupport) *prodObjectEnsurers { return &prodObjectEnsurers{ - deployment: newDefaultObjectEnsurer(support.client, support.logger, defaultDeploymentCreator), - service: newDefaultObjectEnsurer(support.client, support.logger, defaultServiceCreator), - propertiesConfigMap: newDefaultObjectEnsurer(support.client, support.logger, workflowPropsConfigMapCreator), + deployment: newDefaultObjectEnsurer(support.client, defaultDeploymentCreator), + service: newDefaultObjectEnsurer(support.client, defaultServiceCreator), + propertiesConfigMap: newDefaultObjectEnsurer(support.client, workflowPropsConfigMapCreator), } } -func newProdProfileReconciler(client client.Client, config *rest.Config, logger *logr.Logger) ProfileReconciler { +func newProdProfileReconciler(client client.Client, config *rest.Config) ProfileReconciler { support := &stateSupport{ - logger: logger, client: client, } // the reconciliation state machine stateMachine := newReconciliationStateMachine( - logger, &newBuilderReconciliationState{stateSupport: support}, &followBuildStatusReconciliationState{stateSupport: support}, &deployWorkflowReconciliationState{stateSupport: support, ensurers: newProdObjectEnsurers(support)}, @@ -116,7 +117,7 @@ func (h *newBuilderReconciliationState) Do(ctx context.Context, workflow *operat _, err = h.performStatusUpdate(ctx, workflow) return ctrl.Result{RequeueAfter: requeueWhileWaitForPlatform}, nil, err } - h.logger.Error(err, "Failed to get active platform") + klog.V(log.E).ErrorS(err, "Failed to get active platform") return ctrl.Result{RequeueAfter: requeueWhileWaitForPlatform}, nil, err } // If there is an active platform we have got all the information to build but... @@ -133,7 +134,7 @@ func (h *newBuilderReconciliationState) Do(ctx context.Context, workflow *operat _, err = h.performStatusUpdate(ctx, workflow) } else { // TODO: not ideal, but we will improve it on https://issues.redhat.com/browse/KOGITO-8792 - h.logger.Info("Build is in failed state, try to delete the SonataFlowBuild to restart a new build cycle") + klog.V(log.I).InfoS("Build is in failed state, try to delete the SonataFlowBuild to restart a new build cycle") } return ctrl.Result{RequeueAfter: requeueAfterStartingBuild}, nil, err @@ -151,7 +152,7 @@ func (h *followBuildStatusReconciliationState) Do(ctx context.Context, workflow // Let's retrieve the build to check the status build, err := builder.NewSonataFlowBuildManager(ctx, h.client).GetOrCreateBuild(workflow) if err != nil { - h.logger.Error(err, "Failed to get or create the build for the workflow.") + klog.V(log.E).ErrorS(err, "Failed to get or create the build for the workflow.") workflow.Status.Manager().MarkFalse(api.BuiltConditionType, api.BuildFailedReason, build.Status.Error) if _, err = h.performStatusUpdate(ctx, workflow); err != nil { return ctrl.Result{}, nil, err @@ -160,7 +161,7 @@ func (h *followBuildStatusReconciliationState) Do(ctx context.Context, workflow } if build.Status.BuildPhase == operatorapi.BuildPhaseSucceeded { - h.logger.Info("Workflow build has finished") + klog.V(log.I).InfoS("Workflow build has finished") //If we have finished a build and the workflow is not running, we will start the provisioning phase workflow.Status.Manager().MarkTrue(api.BuiltConditionType) _, err = h.performStatusUpdate(ctx, workflow) @@ -267,7 +268,7 @@ func (h *deployWorkflowReconciliationState) handleObjects(ctx context.Context, w objs := []client.Object{existingDeployment, existingService, propsCM} if !requeue { - h.logger.Info("Skip reconcile: Deployment and service already exists", + klog.V(log.I).InfoS("Skip reconcile: Deployment and service already exists", "Deployment.Namespace", existingDeployment.Namespace, "Deployment.Name", existingDeployment.Name) // TODO: very naive, the state should observe the Deployment's status: https://issues.redhat.com/browse/KOGITO-8524 workflow.Status.Manager().MarkTrue(api.RunningConditionType) @@ -321,7 +322,7 @@ func mountProdConfigMapsMutateVisitor(propsCM *v1.ConfigMap) mutateVisitor { // isWorkflowChanged marks the workflow status as unknown to require a new build reconciliation func (h *deployWorkflowReconciliationState) isWorkflowChanged(workflow *operatorapi.SonataFlow) bool { - generation := kubeutil.GetLastGeneration(workflow.Namespace, workflow.Name, h.client, context.TODO(), h.logger) + generation := kubeutil.GetLastGeneration(workflow.Namespace, workflow.Name, h.client, context.TODO()) if generation > workflow.Status.ObservedGeneration { return true } diff --git a/controllers/profiles/reconciler_prod_test.go b/controllers/profiles/reconciler_prod_test.go index b20c05a53..f3df43d28 100644 --- a/controllers/profiles/reconciler_prod_test.go +++ b/controllers/profiles/reconciler_prod_test.go @@ -24,16 +24,13 @@ import ( "github.com/stretchr/testify/assert" v1 "k8s.io/api/apps/v1" clientruntime "sigs.k8s.io/controller-runtime/pkg/client" - ctrllog "sigs.k8s.io/controller-runtime/pkg/log" "github.com/kiegroup/kogito-serverless-operator/api" operatorapi "github.com/kiegroup/kogito-serverless-operator/api/v1alpha08" - "github.com/kiegroup/kogito-serverless-operator/test" ) func Test_reconcilerProdBuildConditions(t *testing.T) { - logger := ctrllog.FromContext(context.TODO()) workflow := test.GetBaseSonataFlow(t.Name()) platform := test.GetBasePlatformInReadyPhase(t.Name()) client := test.NewKogitoClientBuilder(). @@ -41,7 +38,7 @@ func Test_reconcilerProdBuildConditions(t *testing.T) { WithStatusSubresource(workflow, platform, &operatorapi.SonataFlowBuild{}).Build() config := &rest.Config{} - result, err := NewReconciler(client, config, &logger, workflow).Reconcile(context.TODO(), workflow) + result, err := NewReconciler(client, config, workflow).Reconcile(context.TODO(), workflow) assert.NoError(t, err) assert.NotNil(t, result.RequeueAfter) @@ -49,7 +46,7 @@ func Test_reconcilerProdBuildConditions(t *testing.T) { assert.False(t, workflow.Status.IsReady()) // still building - result, err = NewReconciler(client, config, &logger, workflow).Reconcile(context.TODO(), workflow) + result, err = NewReconciler(client, config, workflow).Reconcile(context.TODO(), workflow) assert.NoError(t, err) assert.Equal(t, requeueWhileWaitForBuild, result.RequeueAfter) assert.True(t, workflow.Status.IsBuildRunningOrUnknown()) @@ -62,7 +59,7 @@ func Test_reconcilerProdBuildConditions(t *testing.T) { assert.NoError(t, client.Status().Update(context.TODO(), build)) // last reconciliation cycle waiting for build - result, err = NewReconciler(client, config, &logger, workflow).Reconcile(context.TODO(), workflow) + result, err = NewReconciler(client, config, workflow).Reconcile(context.TODO(), workflow) assert.NoError(t, err) assert.Equal(t, requeueWhileWaitForBuild, result.RequeueAfter) assert.False(t, workflow.Status.IsBuildRunningOrUnknown()) @@ -70,27 +67,26 @@ func Test_reconcilerProdBuildConditions(t *testing.T) { assert.Equal(t, api.WaitingForBuildReason, workflow.Status.GetTopLevelCondition().Reason) // now we create the objects - result, err = NewReconciler(client, config, &logger, workflow).Reconcile(context.TODO(), workflow) + result, err = NewReconciler(client, config, workflow).Reconcile(context.TODO(), workflow) assert.NoError(t, err) assert.False(t, workflow.Status.IsBuildRunningOrUnknown()) assert.False(t, workflow.Status.IsReady()) assert.Equal(t, api.WaitingForDeploymentReason, workflow.Status.GetTopLevelCondition().Reason) // now with the objects created, it should be running - result, err = NewReconciler(client, config, &logger, workflow).Reconcile(context.TODO(), workflow) + result, err = NewReconciler(client, config, workflow).Reconcile(context.TODO(), workflow) assert.NoError(t, err) assert.False(t, workflow.Status.IsBuildRunningOrUnknown()) assert.True(t, workflow.Status.IsReady()) } func Test_deployWorkflowReconciliationHandler_handleObjects(t *testing.T) { - logger := ctrllog.FromContext(context.TODO()) workflow := test.GetBaseSonataFlow(t.Name()) platform := test.GetBasePlatformInReadyPhase(t.Name()) client := test.NewKogitoClientBuilder().WithRuntimeObjects(workflow, platform).WithStatusSubresource(workflow, platform).Build() handler := &deployWorkflowReconciliationState{ stateSupport: fakeReconcilerSupport(client), - ensurers: newProdObjectEnsurers(&stateSupport{logger: &logger, client: client}), + ensurers: newProdObjectEnsurers(&stateSupport{client: client}), } result, objects, err := handler.Do(context.TODO(), workflow) assert.Greater(t, result.RequeueAfter, int64(0)) @@ -128,7 +124,6 @@ func Test_deployWorkflowReconciliationHandler_handleObjects(t *testing.T) { } func Test_GenerationAnnotationCheck(t *testing.T) { - logger := ctrllog.FromContext(context.TODO()) // we load a workflow with metadata.generation to 0 workflow := test.GetBaseSonataFlow(t.Name()) platform := test.GetBasePlatformInReadyPhase(t.Name()) @@ -138,7 +133,7 @@ func Test_GenerationAnnotationCheck(t *testing.T) { handler := &deployWorkflowReconciliationState{ stateSupport: fakeReconcilerSupport(client), - ensurers: newProdObjectEnsurers(&stateSupport{logger: &logger, client: client}), + ensurers: newProdObjectEnsurers(&stateSupport{client: client}), } result, objects, err := handler.Do(context.TODO(), workflow) assert.Greater(t, result.RequeueAfter, int64(time.Second)) @@ -151,7 +146,7 @@ func Test_GenerationAnnotationCheck(t *testing.T) { workflowChanged.Generation = int64(1) handler = &deployWorkflowReconciliationState{ stateSupport: fakeReconcilerSupport(client), - ensurers: newProdObjectEnsurers(&stateSupport{logger: &logger, client: client}), + ensurers: newProdObjectEnsurers(&stateSupport{client: client}), } result, objects, err = handler.Do(context.TODO(), workflowChanged) assert.NoError(t, err) diff --git a/controllers/profiles/reconciler_test.go b/controllers/profiles/reconciler_test.go index d83f602e5..4fbd03553 100644 --- a/controllers/profiles/reconciler_test.go +++ b/controllers/profiles/reconciler_test.go @@ -15,16 +15,11 @@ package profiles import ( - "context" - "sigs.k8s.io/controller-runtime/pkg/client" - ctrllog "sigs.k8s.io/controller-runtime/pkg/log" ) func fakeReconcilerSupport(client client.Client) *stateSupport { - logger := ctrllog.FromContext(context.TODO()) return &stateSupport{ - logger: &logger, client: client, } } diff --git a/controllers/profiles/status_enricher.go b/controllers/profiles/status_enricher.go index 859c811ac..89100805b 100644 --- a/controllers/profiles/status_enricher.go +++ b/controllers/profiles/status_enricher.go @@ -17,20 +17,21 @@ package profiles import ( "context" + "k8s.io/klog/v2" + "k8s.io/client-go/rest" - "github.com/go-logr/logr" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" operatorapi "github.com/kiegroup/kogito-serverless-operator/api/v1alpha08" + "github.com/kiegroup/kogito-serverless-operator/log" ) // newStatusEnricher see defaultObjectEnsurer -func newStatusEnricher(client client.Client, logger *logr.Logger, enricher statusEnricherFn) *statusEnricher { +func newStatusEnricher(client client.Client, enricher statusEnricherFn) *statusEnricher { return &statusEnricher{ client: client, - logger: logger, enricher: enricher, } } @@ -43,7 +44,6 @@ type statusEnricherFn func(ctx context.Context, client client.Client, workflow * type statusEnricher struct { client client.Client config *rest.Config - logger *logr.Logger enricher statusEnricherFn } @@ -54,6 +54,6 @@ func (d *statusEnricher) Enrich(ctx context.Context, workflow *operatorapi.Sonat return result, err } - d.logger.Info("Enrichment operation finalized", "result", result, "workflow", workflow.GetName(), "namespace", workflow.GetNamespace()) + klog.V(log.I).InfoS("Enrichment operation finalized", "result", result, "workflow", workflow.GetName(), "namespace", workflow.GetNamespace()) return result, nil } diff --git a/controllers/sonataflow_controller.go b/controllers/sonataflow_controller.go index edfc47298..335ed67f4 100644 --- a/controllers/sonataflow_controller.go +++ b/controllers/sonataflow_controller.go @@ -16,7 +16,8 @@ package controllers import ( "context" - "fmt" + + "k8s.io/klog/v2" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" @@ -29,14 +30,13 @@ import ( ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/handler" - ctrllog "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/reconcile" "github.com/kiegroup/kogito-serverless-operator/api" "github.com/kiegroup/kogito-serverless-operator/controllers/profiles" - "github.com/kiegroup/kogito-serverless-operator/container-builder/util/log" + "github.com/kiegroup/kogito-serverless-operator/log" operatorapi "github.com/kiegroup/kogito-serverless-operator/api/v1alpha08" "github.com/kiegroup/kogito-serverless-operator/controllers/platform" @@ -63,13 +63,12 @@ type SonataFlowReconciler struct { // For more details, check Reconcile and its Result here: // - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.11.2/pkg/reconcile func (r *SonataFlowReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { - logger := ctrllog.FromContext(ctx) // Make sure the operator is allowed to act on namespace if ok, err := platform.IsOperatorAllowedOnNamespace(ctx, r.Client, req.Namespace); err != nil { return reconcile.Result{}, err } else if !ok { - logger.Info(fmt.Sprintf("Ignoring request because the operator hasn't got the permissions to work on namespace %s", req.Namespace)) + klog.V(log.I).InfoS("Ignoring request because the operator hasn't got the permissions to work on namespace", "namespace", req.Namespace) return reconcile.Result{}, nil } @@ -80,17 +79,17 @@ func (r *SonataFlowReconciler) Reconcile(ctx context.Context, req ctrl.Request) if errors.IsNotFound(err) { return ctrl.Result{}, nil } - logger.Error(err, "Failed to get SonataFlow") + klog.V(log.E).ErrorS(err, "Failed to get SonataFlow") return ctrl.Result{}, err } // Only process resources assigned to the operator if !platform.IsOperatorHandlerConsideringLock(ctx, r.Client, req.Namespace, workflow) { - logger.Info("Ignoring request because resource is not assigned to current operator") + klog.V(log.I).InfoS("Ignoring request because resource is not assigned to current operator") return reconcile.Result{}, nil } - return profiles.NewReconciler(r.Client, r.Config, &logger, workflow).Reconcile(ctx, workflow) + return profiles.NewReconciler(r.Client, r.Config, workflow).Reconcile(ctx, workflow) } func platformEnqueueRequestsFromMapFunc(c client.Client, p *operatorapi.SonataFlowPlatform) []reconcile.Request { @@ -106,14 +105,14 @@ func platformEnqueueRequestsFromMapFunc(c client.Client, p *operatorapi.SonataFl } if err := c.List(context.Background(), list, opts...); err != nil { - log.Error(err, "Failed to list workflows") + klog.V(log.E).ErrorS(err, "Failed to list workflows") return requests } for _, workflow := range list.Items { cond := workflow.Status.GetTopLevelCondition() if cond.IsFalse() && api.WaitingForPlatformReason == cond.Reason { - log.Infof("Platform %s ready, wake-up workflow: %s", p.Name, workflow.Name) + klog.V(log.I).InfoS("Platform ready, wake-up workflow", "platform", p.Name, "workflow", workflow.Name) requests = append(requests, reconcile.Request{ NamespacedName: types.NamespacedName{ Namespace: workflow.Namespace, @@ -137,7 +136,7 @@ func (r *SonataFlowReconciler) SetupWithManager(mgr ctrl.Manager) error { Watches(&operatorapi.SonataFlowPlatform{}, handler.EnqueueRequestsFromMapFunc(func(c context.Context, a client.Object) []reconcile.Request { platform, ok := a.(*operatorapi.SonataFlowPlatform) if !ok { - log.Error(fmt.Errorf("type assertion failed: %v", a), "Failed to retrieve workflow list") + klog.V(log.E).InfoS("Failed to retrieve workflow list. Type assertion failed", "assertion", a) return []reconcile.Request{} } return platformEnqueueRequestsFromMapFunc(mgr.GetClient(), platform) diff --git a/controllers/sonataflowbuild_controller.go b/controllers/sonataflowbuild_controller.go index 403afe466..8ead7077c 100644 --- a/controllers/sonataflowbuild_controller.go +++ b/controllers/sonataflowbuild_controller.go @@ -19,6 +19,8 @@ import ( "fmt" "time" + "k8s.io/klog/v2" + buildv1 "github.com/openshift/api/build/v1" imgv1 "github.com/openshift/api/image/v1" corev1 "k8s.io/api/core/v1" @@ -28,12 +30,12 @@ import ( "k8s.io/client-go/tools/record" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" - ctrllog "sigs.k8s.io/controller-runtime/pkg/log" "github.com/kiegroup/kogito-serverless-operator/utils" operatorapi "github.com/kiegroup/kogito-serverless-operator/api/v1alpha08" "github.com/kiegroup/kogito-serverless-operator/controllers/builder" + "github.com/kiegroup/kogito-serverless-operator/log" ) // SonataFlowBuildReconciler reconciles a SonataFlowBuild object @@ -62,21 +64,20 @@ const ( // For more details, check Reconcile and its Result here: // - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.12.1/pkg/reconcile func (r *SonataFlowBuildReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { - log := ctrllog.FromContext(ctx) build := &operatorapi.SonataFlowBuild{} err := r.Client.Get(ctx, req.NamespacedName, build) if err != nil { if errors.IsNotFound(err) { return ctrl.Result{}, nil } - log.Error(err, "Failed to get the SonataFlowBuild") + klog.V(log.E).ErrorS(err, "Failed to get the SonataFlowBuild") return ctrl.Result{}, err } phase := build.Status.BuildPhase buildManager, err := builder.NewBuildManager(ctx, r.Client, r.Config, build.Name, build.Namespace) if err != nil { - log.Error(err, "Failed to get create a build manager to handle the workflow build") + klog.V(log.E).ErrorS(err, "Failed to get create a build manager to handle the workflow build") return ctrl.Result{}, err } diff --git a/controllers/sonataflowplatform_controller.go b/controllers/sonataflowplatform_controller.go index ff634bb45..330a9a456 100644 --- a/controllers/sonataflowplatform_controller.go +++ b/controllers/sonataflowplatform_controller.go @@ -19,6 +19,8 @@ import ( "fmt" "time" + "k8s.io/klog/v2" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" @@ -28,15 +30,14 @@ import ( "sigs.k8s.io/controller-runtime/pkg/reconcile" clientr "github.com/kiegroup/kogito-serverless-operator/container-builder/client" - klog "github.com/kiegroup/kogito-serverless-operator/container-builder/util/log" "github.com/kiegroup/kogito-serverless-operator/controllers/platform" ctrlrun "sigs.k8s.io/controller-runtime" ctrl "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/log" operatorapi "github.com/kiegroup/kogito-serverless-operator/api/v1alpha08" + "github.com/kiegroup/kogito-serverless-operator/log" ) // SonataFlowPlatformReconciler reconciles a SonataFlowPlatform object @@ -64,13 +65,11 @@ type SonataFlowPlatformReconciler struct { // For more details, check Reconcile and its Result here: // - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.12.1/pkg/reconcile func (r *SonataFlowPlatformReconciler) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error) { - logger := log.FromContext(ctx) - // Make sure the operator is allowed to act on namespace if ok, err := platform.IsOperatorAllowedOnNamespace(ctx, r.Reader, req.Namespace); err != nil { return reconcile.Result{}, err } else if !ok { - logger.Info(fmt.Sprintf("Ignoring request because the operator hasn't got the permissions to work on namespace %s", req.Namespace)) + klog.V(log.I).InfoS("Ignoring request because the operator hasn't got the permissions to work on namespace", "namespace", req.Namespace) return reconcile.Result{}, nil } @@ -92,7 +91,7 @@ func (r *SonataFlowPlatformReconciler) Reconcile(ctx context.Context, req reconc // Only process resources assigned to the operator if !platform.IsOperatorHandlerConsideringLock(ctx, r.Reader, req.Namespace, &instance) { - logger.Info("Ignoring request because resource is not assigned to current operator") + klog.V(log.I).InfoS("Ignoring request because resource is not assigned to current operator") return reconcile.Result{}, nil } actions := []platform.Action{ @@ -107,15 +106,13 @@ func (r *SonataFlowPlatformReconciler) Reconcile(ctx context.Context, req reconc var err error target := instance.DeepCopy() - targetLog := klog.Log for _, a := range actions { cli, _ := clientr.FromCtrlClientSchemeAndConfig(r.Client, r.Scheme, r.Config) a.InjectClient(cli) - a.InjectLogger(targetLog) if a.CanHandle(target) { - targetLog.Info("Invoking action", "Name", a.Name()) + klog.V(log.I).InfoS("Invoking action", "Name", a.Name()) phaseFrom := target.Status.Phase @@ -141,7 +138,7 @@ func (r *SonataFlowPlatformReconciler) Reconcile(ctx context.Context, req reconc targetPhase = target.Status.Phase if targetPhase != phaseFrom { - logger.Info( + klog.V(log.I).InfoS( "state transition", "phase-from", phaseFrom, "phase-to", target.Status.Phase, diff --git a/controllers/suite_test.go b/controllers/suite_test.go index eef36d766..4fd5048ee 100644 --- a/controllers/suite_test.go +++ b/controllers/suite_test.go @@ -24,8 +24,6 @@ import ( "k8s.io/client-go/rest" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/envtest" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/log/zap" apiv08 "github.com/kiegroup/kogito-serverless-operator/api/v1alpha08" //+kubebuilder:scaffold:imports @@ -45,8 +43,6 @@ func TestAPIs(t *testing.T) { } var _ = BeforeSuite(func() { - logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true))) - By("bootstrapping test environment") testEnv = &envtest.Environment{ CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")}, diff --git a/controllers/workflowdef/json.go b/controllers/workflowdef/json.go index 5ebba3207..35123f0d1 100644 --- a/controllers/workflowdef/json.go +++ b/controllers/workflowdef/json.go @@ -18,23 +18,24 @@ import ( "context" "encoding/json" - ctrllog "sigs.k8s.io/controller-runtime/pkg/log" + "github.com/kiegroup/kogito-serverless-operator/log" + + "k8s.io/klog/v2" operatorapi "github.com/kiegroup/kogito-serverless-operator/api/v1alpha08" ) // GetJSONWorkflow return a Kogito compliant JSON format workflow as bytearray give a specific workflow CR func GetJSONWorkflow(workflowCR *operatorapi.SonataFlow, ctx context.Context) ([]byte, error) { - logger := ctrllog.FromContext(ctx) // apply workflow metadata workflow, err := operatorapi.ToCNCFWorkflow(workflowCR, ctx) if err != nil { - logger.Error(err, "Failed converting SonataFlow into Workflow") + klog.V(log.E).ErrorS(err, "Failed converting SonataFlow into Workflow") return nil, err } jsonWorkflow, err := json.Marshal(workflow) if err != nil { - logger.Error(err, "Failed converting SonataFlow into JSON") + klog.V(log.E).ErrorS(err, "Failed converting SonataFlow into JSON") return nil, err } return jsonWorkflow, nil diff --git a/go.mod b/go.mod index 30d28c301..b948eee25 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ replace ( // Direct dependencies (please keep organized, no indirects) require ( github.com/RHsyseng/operator-utils v1.4.12 - github.com/go-logr/logr v1.2.4 + github.com/go-logr/logr v1.2.4 // indirect github.com/kiegroup/kogito-serverless-operator/api v0.0.0 github.com/kiegroup/kogito-serverless-operator/container-builder v0.0.0 github.com/kiegroup/kogito-serverless-operator/workflowproj v0.0.0 @@ -33,7 +33,10 @@ require ( sigs.k8s.io/yaml v1.3.0 ) -require github.com/davecgh/go-spew v1.1.1 +require ( + github.com/davecgh/go-spew v1.1.1 + k8s.io/klog/v2 v2.100.1 +) require ( github.com/beorn7/perks v1.0.1 // indirect @@ -44,7 +47,6 @@ require ( github.com/evanphx/json-patch/v5 v5.6.0 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/ghodss/yaml v1.0.0 // indirect - github.com/go-logr/zapr v1.2.4 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect github.com/go-openapi/jsonreference v0.20.1 // indirect github.com/go-openapi/swag v0.22.3 // indirect @@ -81,12 +83,8 @@ require ( github.com/prometheus/procfs v0.9.0 // indirect github.com/santhosh-tekuri/jsonschema/v5 v5.3.0 // indirect github.com/senseyeio/duration v0.0.0-20180430131211-7c2a214ada46 // indirect - github.com/sirupsen/logrus v1.9.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/vmware-labs/yaml-jsonpath v0.3.2 // indirect - go.uber.org/atomic v1.10.0 // indirect - go.uber.org/multierr v1.9.0 // indirect - go.uber.org/zap v1.24.0 // indirect golang.org/x/crypto v0.8.0 // indirect golang.org/x/net v0.10.0 // indirect golang.org/x/oauth2 v0.7.0 // indirect @@ -104,7 +102,6 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/apiextensions-apiserver v0.27.2 // indirect k8s.io/component-base v0.27.2 // indirect - k8s.io/klog/v2 v2.90.1 // indirect k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect k8s.io/utils v0.0.0-20230313181309-38a27ef9d749 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect diff --git a/go.sum b/go.sum index d7487c6cf..9fbb21269 100644 --- a/go.sum +++ b/go.sum @@ -6,8 +6,6 @@ github.com/RHsyseng/operator-utils v1.4.12 h1:q1mbX48Ljpz9x/ck00+Zq5py+Gsbbm6Lqw github.com/RHsyseng/operator-utils v1.4.12/go.mod h1:DquDurcTo2Fuc/yxz35y3Y2U7Y28j8JTEnlYbQM+gvg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= -github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= @@ -53,7 +51,6 @@ github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbV github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo= -github.com/go-logr/zapr v1.2.4/go.mod h1:FyHWQIzQORZ0QVE1BtVHv3cKtNLuXsbNLtpuhNapBOA= github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/jsonreference v0.20.1 h1:FBLnyygC4/IZZr893oiomc9XaghoveYTrLC1F86HID8= @@ -210,8 +207,6 @@ github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/serverlessworkflow/sdk-go/v2 v2.2.3 h1:s5+8GegK4vIMKAg2ETdO9OovSROGwVPPvrGz74G17oQ= github.com/serverlessworkflow/sdk-go/v2 v2.2.3/go.mod h1:YmKuDaZ81zLyIfYZtgkcUpOzGN8xWMWeZGGaO5pW0Us= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= @@ -236,18 +231,11 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1: github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= -go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= -go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -258,10 +246,8 @@ golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -293,7 +279,6 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -314,7 +299,6 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -341,7 +325,6 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo= golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -418,8 +401,8 @@ k8s.io/client-go v0.27.2 h1:vDLSeuYvCHKeoQRhCXjxXO45nHVv2Ip4Fe0MfioMrhE= k8s.io/client-go v0.27.2/go.mod h1:tY0gVmUsHrAmjzHX9zs7eCjxcBsf8IiNe7KQ52biTcQ= k8s.io/component-base v0.27.2 h1:neju+7s/r5O4x4/txeUONNTS9r1HsPbyoPBAtHsDCpo= k8s.io/component-base v0.27.2/go.mod h1:5UPk7EjfgrfgRIuDBFtsEFAe4DAvP3U+M8RTzoSJkpo= -k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw= -k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= +k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg= k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg= k8s.io/utils v0.0.0-20230313181309-38a27ef9d749 h1:xMMXJlJbsU8w3V5N2FLDQ8YgU8s1EoULdbQBcAeNJkY= diff --git a/go.work.sum b/go.work.sum index b4c7b34dc..b09eb4e40 100644 --- a/go.work.sum +++ b/go.work.sum @@ -23,6 +23,7 @@ cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aD cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= +cloud.google.com/go v0.98.0 h1:w6LozQJyDDEyhf64Uusu1LCcnLt0I1VMLiJC2kV+eXk= cloud.google.com/go v0.98.0/go.mod h1:ua6Ush4NALrHk5QXDWnjvZHN93OuF0HfuEPq9I1X0cM= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= @@ -30,6 +31,7 @@ cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvf cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/compute/metadata v0.2.0 h1:nBbNSZyDpkNlo3DepaaLKVuO7ClyifSAmNloSCZrHnQ= cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= @@ -42,53 +44,92 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.18.2 h1:5NQw6tOn3eMm0oE8vTkfjau18kjL79FlMjy/CHTpmoY= cloud.google.com/go/storage v1.18.2/go.mod h1:AiIj7BWXyhO5gGVmYJ+S8tbkCx3yb0IMjua8Aw4naVM= +contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200907061046-05415f1de66d h1:LblfooH1lKOpp1hIhukktmSAxFkqMPFk9KR6iZ0MJNI= contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200907061046-05415f1de66d/go.mod h1:IshRmMJBhDfFj5Y67nVhMYTTIze91RUeT73ipWKs/GY= +contrib.go.opencensus.io/exporter/prometheus v0.4.0 h1:0QfIkj9z/iVZgK31D9H9ohjjIDApI2GOPScCKwxedbs= contrib.go.opencensus.io/exporter/prometheus v0.4.0/go.mod h1:o7cosnyfuPVK0tB8q0QmaQNhGnptITnPQB+z1+qeFB0= +contrib.go.opencensus.io/exporter/zipkin v0.1.2 h1:YqE293IZrKtqPnpwDPH/lOqTWD/s3Iwabycam74JV3g= contrib.go.opencensus.io/exporter/zipkin v0.1.2/go.mod h1:mP5xM3rrgOjpn79MM8fZbj3gsxcuytSqtH0dxSWW1RE= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= +github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= +github.com/OpenPeeDeeP/depguard v1.0.0 h1:k9QF73nrHT3nPLz3lu6G5s+3Hi8Je36ODr1F5gjAXXM= +github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 h1:fLjPD/aNc3UIOA6tDi6QXUemppXK3P9BI7mr2hd6gx8= +github.com/alecthomas/kingpin/v2 v2.3.1 h1:ANLJcKmQm4nIaog7xdr/id6FM6zm5hHnfZrvtKPxqGg= github.com/alecthomas/kingpin/v2 v2.3.1/go.mod h1:oYL5vtsvEHZGHxU7DMp32Dvx+qL+ptGn6lWaot2vCNE= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= +github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= +github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 h1:yL7+Jz0jTC6yykIK/Wh74gnTJnrGr5AyrNMXuA0gves= github.com/antlr/antlr4/runtime/Go/antlr v1.4.10/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 h1:4daAzAu0S6Vi7/lbWECcX0j45yZReDZ56BQsrVBOEEY= github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= +github.com/blendle/zapdriver v1.3.1 h1:C3dydBOWYRiOk+B8X9IVZ5IOe+7cl+tGOexN4QqHfpE= github.com/blendle/zapdriver v1.3.1/go.mod h1:mdXfREi6u5MArG4j9fewC+FGnXaBR+T4Ox4J2u4eHCc= +github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= +github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= +github.com/census-instrumentation/opencensus-proto v0.3.0 h1:t/LhUZLVitR1Ow2YOnduCsavhwFUklBMoGVYUCqmCqk= github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= +github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4 h1:hzAQntlaYRkVSFEfj9OTWlVV1H155FMD8BTKktLv0QI= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1 h1:zH8ljVhhq7yC0MIeUL/IviMtY8hx2mK8cN9wEYb8ggw= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd/v22 v22.4.0 h1:y9YHcjnjynCd/DVbg5j9L/33jQM3MxJlbj/zWskzfGU= github.com/coreos/go-systemd/v22 v22.4.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.9 h1:uDmaGzcdjhF4i/plgjmEsriH11Y0o7RKapEf/LDaM3w= +github.com/dgryski/go-gk v0.0.0-20200319235926-a69029f61654 h1:XOPLOMn/zT4jIgxfxSsoXPxkrzz0FaCHwp33x5POJ+Q= github.com/dgryski/go-gk v0.0.0-20200319235926-a69029f61654/go.mod h1:qm+vckxRlDt0aOla0RYJJVeqHZlWfOm2UIxHaqPB46E= +github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ= +github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1 h1:xvqufLtNVwAhN8NMyWklVgxnWohi+wtMGQMhtxexlm0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= +github.com/envoyproxy/protoc-gen-validate v0.1.0 h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A= +github.com/fatih/color v1.6.0 h1:66qjqZk8kalYAvDRtM1AdAJQI0tj4Wrue3Eq3B3pmFU= +github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/flowstack/go-jsonschema v0.1.1 h1:dCrjGJRXIlbDsLAgTJZTjhwUJnnxVWl1OgNyYh5nyDc= +github.com/go-critic/go-critic v0.3.5-0.20190526074819-1df300866540 h1:djv/qAomOVj8voCHt0M0OYwR/4vfDq1zNKSPKjJCexs= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -96,31 +137,58 @@ github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +github.com/go-lintpack/lintpack v0.5.2 h1:DI5mA3+eKdWeJ40nU4d6Wc26qmdG8RCi/btYq0TuRN0= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4= +github.com/go-ole/go-ole v1.2.1 h1:2lOsA72HgjxAuMlKpFiCbHTvu44PIVkZ5hqm3RSdI/E= +github.com/go-openapi/analysis v0.19.10 h1:5BHISBAXOc/aJK25irLZnx2D3s6WyYaY9D4gmuz9fdE= github.com/go-openapi/analysis v0.19.10/go.mod h1:qmhS3VNFxBlquFJ0RGoDtylO9y4pgTAUNE9AEEMdlJQ= +github.com/go-openapi/errors v0.19.7 h1:Lcq+o0mSwCLKACMxZhreVHigB9ebghJ/lrmeaqASbjo= github.com/go-openapi/errors v0.19.7/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/loads v0.19.5 h1:jZVYWawIQiA1NBnHla28ktg6hrcfTHsCE+3QLVRBIls= github.com/go-openapi/loads v0.19.5/go.mod h1:dswLCAdonkRufe/gSUC3gN8nTSaB9uaS2es0x5/IbjY= +github.com/go-openapi/runtime v0.19.16 h1:tQMAY5s5BfmmCC31+ufDCsGrr8iO1A8UIdYfDo5ADvs= github.com/go-openapi/runtime v0.19.16/go.mod h1:5P9104EJgYcizotuXhEuUrzVc+j1RiSjahULvYmlv98= +github.com/go-openapi/spec v0.19.9 h1:9z9cbFuZJ7AcvOHKIY+f6Aevb4vObNDkTEyoMfO7rAc= github.com/go-openapi/spec v0.19.9/go.mod h1:vqK/dIdLGCosfvYsQV3WfC7N3TiZSnGY2RZKoFK7X28= +github.com/go-openapi/strfmt v0.19.5 h1:0utjKrw+BAh8s57XE9Xz8DUBsVvPmRUB6styvl9wWIM= github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= +github.com/go-openapi/validate v0.19.11 h1:8lCr0b9lNWKjVjW/hSZZvltUy+bULl7vbnCTsOzlhPo= github.com/go-openapi/validate v0.19.11/go.mod h1:Rzou8hA/CBw8donlS6WNEUQupNvUZ0waH08tGe6kAQ4= +github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-toolsmith/astcast v1.0.0 h1:JojxlmI6STnFVG9yOImLeGREv8W2ocNUM+iOhR6jE7g= +github.com/go-toolsmith/astcopy v1.0.0 h1:OMgl1b1MEpjFQ1m5ztEO06rz5CUd3oBv9RF7+DyvdG8= +github.com/go-toolsmith/astequal v1.0.0 h1:4zxD8j3JRFNyLN46lodQuqz3xdKSrur7U/sr0SDS/gQ= +github.com/go-toolsmith/astfmt v1.0.0 h1:A0vDDXt+vsvLEdbMFJAUBI/uTbRw1ffOPnxsILnFL6k= +github.com/go-toolsmith/astinfo v0.0.0-20180906194353-9809ff7efb21 h1:wP6mXeB2V/d1P1K7bZ5vDUO3YqEzcvOREOxZPEu3gVI= +github.com/go-toolsmith/astp v1.0.0 h1:alXE75TXgcmupDsMK1fRAy0YUzLzqPVvBKoyWV+KPXg= +github.com/go-toolsmith/pkgload v1.0.0 h1:4DFWWMXVfbcN5So1sBNW9+yeiMqLFGl1wFLTL5R0Tgg= +github.com/go-toolsmith/strparse v1.0.0 h1:Vcw78DnpCAKlM20kSbAyO4mPfJn/lyYA4BJUDxe2Jb4= +github.com/go-toolsmith/typep v1.0.0 h1:zKymWyA1TRYvqYrYDrfEMZULyrhcnGY3x7LDKU2XQaA= +github.com/gobuffalo/flect v0.2.4 h1:BSYA8+T60cdyq+vynaSUjqSVI9mDEg9ZfQUXKmfjo4I= github.com/gobuffalo/flect v0.2.4/go.mod h1:1ZyCLIbg0YD7sDkzvFdPoOydPtD8y9JQnrOROolUcM8= +github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1 h1:G5FRp8JnTd7RQH5kemVNlMeyXQAztQ3mOWV95KxsXH8= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= @@ -133,9 +201,28 @@ github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaW github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 h1:23T5iq8rbUYlhpt5DB4XJkc6BU31uODLD1o1gKvZmD0= +github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a h1:w8hkcTqaFpzKqonE9uMCefW1WDie15eSP/4MssdenaM= +github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6 h1:YYWNAGTKWhKpcLLt7aSj/odlKrSrelQwlovBpDuf19w= +github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613 h1:9kfjN3AdxcbsZBf8NjltjWihK2QfBBBZuv91cMFfDHw= +github.com/golangci/go-tools v0.0.0-20190318055746-e32c54105b7c h1:/7detzz5stiXWPzkTlPTzkBEIIE4WGpppBJYjKqBiPI= +github.com/golangci/goconst v0.0.0-20180610141641-041c5f2b40f3 h1:pe9JHs3cHHDQgOFXJJdYkK6fLz2PWyYtP4hthoCMvs8= +github.com/golangci/gocyclo v0.0.0-20180528134321-2becd97e67ee h1:J2XAy40+7yz70uaOiMbNnluTg7gyQhtGqLQncQh+4J8= +github.com/golangci/gofmt v0.0.0-20181222123516-0b8337e80d98 h1:0OkFarm1Zy2CjCiDKfK9XHgmc2wbDlRMD2hD8anAJHU= +github.com/golangci/golangci-lint v1.17.2-0.20190909185456-6163a8a79084 h1:Z4/yXcGr9zrQrcvHkC8f3agyK1dwt/t6zC/8gi6X64Q= +github.com/golangci/gosec v0.0.0-20190211064107-66fb7fc33547 h1:fUdgm/BdKvwOHxg5AhNbkNRp2mSy8sxTXyBVs/laQHo= +github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc h1:gLLhTLMk2/SutryVJ6D4VZCU3CUqr8YloG7FPIBWFpI= +github.com/golangci/lint-1 v0.0.0-20190420132249-ee948d087217 h1:En/tZdwhAn0JNwLuXzP3k2RVtMqMmOEK7Yu/g3tmtJE= +github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca h1:kNY3/svz5T29MYHubXix4aDDuE3RWHkPvopM/EDv/MA= +github.com/golangci/misspell v0.0.0-20180809174111-950f5d19e770 h1:EL/O5HGrF7Jaq0yNhBLucz9hTuRzj2LdwGBOaENgxIk= +github.com/golangci/prealloc v0.0.0-20180630174525-215b22d4de21 h1:leSNB7iYzLYSSx3J/s5sVf4Drkc68W2wm4Ixh/mr0us= +github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0 h1:HVfrLniijszjS1aiNg8JbBMO2+E1WIQ+j/gL4SQqGPg= +github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 h1:zwtduBRr5SSWhqsYNgcuWO2kFlpdOZbP0+yRjmvPGys= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= +github.com/google/cel-go v0.12.6 h1:kjeKudqV0OygrAqA9fX6J55S8gj+Jre2tckIm5RoG4M= github.com/google/cel-go v0.12.6/go.mod h1:Jk7ljRzLBhkmiAwBoUxB1sZSCVBAzkqPF25olK/iRDw= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -144,9 +231,12 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-github/v27 v27.0.6 h1:oiOZuBmGHvrGM1X9uNUAUlLgp5r1UUO/M/KnbHnLRlQ= github.com/google/go-github/v27 v27.0.6/go.mod h1:/0Gr8pJ55COkmv+S/yPKCczSkUPIM/LnFyubufRNIS0= +github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/mako v0.0.0-20190821191249-122f8dcef9e3 h1:/o5e44nTD/QEEiWPGSFT3bSqcq3Qg7q27N9bv4gKh5M= github.com/google/mako v0.0.0-20190821191249-122f8dcef9e3/go.mod h1:YzLcVlL+NqWnmUEPuhS1LxDDwGO9WNbVlEXaF4IH35g= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -169,17 +259,33 @@ github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm4 github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= +github.com/googleapis/gax-go/v2 v2.1.1 h1:dp3bWCh+PPO1zjRRiCSczJav13sBvG4UhNyVTa1KqdU= github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= +github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= +github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3 h1:JVnpOZS+qxli+rgVl98ILOXVNbW+kb5wcxeGx8ShUIw= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 h1:BZHcxBETFHIdVyhyEfOvn/RdU/QGdLI4y34qQGjGWO0= github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce h1:xdsDDbiBDQTKASoGEZ+pEmF1OnWuu8AQ9I8iNbHNeno= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639 h1:mV02weKRL81bEnm8A0HT1/CAelMQDBuQIfLw8n+d6xI= +github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/influxdata/tdigest v0.0.0-20180711151920-a7d76c6f093a h1:vMqgISSVkIqWxCIZs8m1L4096temR7IbYyNdMiBxSPA= github.com/influxdata/tdigest v0.0.0-20180711151920-a7d76c6f093a/go.mod h1:9GkyshztGufsdPQWjH+ifgnIr3xNUL5syI70g2dzU1o= +github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= +github.com/jonboulle/clockwork v0.2.2 h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ= github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -187,30 +293,53 @@ github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= +github.com/kisielk/errcheck v1.5.0 h1:e8esj/e4R+SAOwFwN+n3zr0nYeCyeweozKfO23MvHzY= +github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= +github.com/klauspost/compress v1.4.1 h1:8VMb5+0wMgdBykOV96DwNwKFQ+WTI4pzYURP99CcB9E= +github.com/klauspost/cpuid v1.2.0 h1:NMpwD2G9JSFOE1/TJjGSo5zG7Yb2bTe7eq1jH+irmeE= +github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw= +github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e h1:9MlwzLdW7QSDrhDjFlsEYmxpFyIoXmYRon3dt0io31k= +github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= +github.com/mattn/go-isatty v0.0.3 h1:ns/ykhmWi7G9O+8a448SecJU3nSMBXJfqQkl0upE1jI= +github.com/mattn/goveralls v0.0.2 h1:7eJB6EqsPhRVxvwEXGnqdO2sJI0PTsrWoTMXEk9/OQc= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.2/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/mitchellh/go-ps v0.0.0-20170309133038-4fdf99ab2936 h1:kw1v0NlnN+GZcU8Ma8CLF2Zzgjfx95gs3/GN3vYAPpo= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/moby/term v0.0.0-20221205130635-1aeaba878587/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mozilla/tls-observatory v0.0.0-20180409132520-8791a200eb40 h1:Q0XH6Ql1+Z6YbUKyWyI0sD8/9yH0U8x86yA8LuWMJwY= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/nbutton23/zxcvbn-go v0.0.0-20171102151520-eafdab6b0663 h1:Ri1EhipkbhWsffPJ3IPlrb4SkTOPa2PfRXp3jchBczw= github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU= github.com/onsi/ginkgo/v2 v2.9.1/go.mod h1:FEcmzVcCHl+4o9bQZVab+4dC9+j+91t2FHSzmGAPfuo= github.com/onsi/gomega v1.27.4/go.mod h1:riYq/GJKh8hhoM01HN6Vmuy93AarCXCBGpvFDK3q3fQ= github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg= +github.com/openshift/build-machinery-go v0.0.0-20220913142420-e25cf57ea46d h1:RR4ah7FfaPR1WePizm0jlrsbmPu91xQZnAsVVreQV1k= github.com/openshift/build-machinery-go v0.0.0-20220913142420-e25cf57ea46d/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/openzipkin/zipkin-go v0.3.0 h1:XtuXmOLIXLjiU2XduuWREDT0LOKtSgos/g7i7RYyoZQ= github.com/openzipkin/zipkin-go v0.3.0/go.mod h1:4c3sLeE8xjNqehmF5RpAFLPLJxXscc0R4l6Zg0P1tTQ= +github.com/pelletier/go-toml v1.1.0 h1:cmiOvKzEunMsAxyhXSzpL5Q1CRKpVv0KQsnAIcSEVYM= +github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -232,33 +361,75 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= +github.com/prometheus/statsd_exporter v0.21.0 h1:hA05Q5RFeIjgwKIYEdFd59xu5Wwaznf33yKI+pyX6T8= github.com/prometheus/statsd_exporter v0.21.0/go.mod h1:rbT83sZq2V+p73lHhPZfMc3MLCHmSHelCh9hSGYNLTQ= +github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c h1:JoUA0uz9U0FVFq5p4LjEq4C0VgQ0El320s3Ms0V4eww= +github.com/rogpeppe/fastuuid v1.2.0 h1:Ppwyp6VYCF1nvBTXL3trRso7mXMlRrw9ooo375wvi2s= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/go-glob v0.0.0-20170128012129-256dc444b735 h1:7YvPJVmEeFHR1Tj9sZEYsmarJEQfMVYpd/Vyy/A8dqE= +github.com/shirou/gopsutil v0.0.0-20180427012116-c95755e4bcd7 h1:80VN+vGkqM773Br/uNNTSheo3KatTgV8IpjIKjvVLng= +github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 h1:udFKJ0aHUL60LboW/A+DfgoHVedieIzIXE8uylPue0U= +github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e h1:MZM7FHLqUHYI0Y/mQAt3d2aYa0SiNms/hFqC9qJYolM= +github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041 h1:llrF3Fs4018ePo4+G/HV/uQUqEI1HMDjCeOf2V6puPc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= +github.com/sourcegraph/go-diff v0.5.1 h1:gO6i5zugwzo1RVTvgvfwCOSVegNuvnNi6bAD1QCmkHs= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= +github.com/spf13/afero v1.1.0 h1:bopulORc2JeYaxfHLvJa5NzxviA9PoWhpiiJkru7Ji4= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/cast v1.2.0 h1:HHl1DSRbEQN2i8tJmtS6ViPyHx35+p51amrdsiTCrkg= +github.com/spf13/cobra v1.6.0 h1:42a0n6jwCot1pUmomAp4T7DeMD+20LFv4Q54pxLf2LI= github.com/spf13/cobra v1.6.0/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= +github.com/spf13/jwalterweatherman v0.0.0-20180109140146-7c0cea34c8ec h1:2ZXvIUGghLpdTVHR1UfvfrzoVlZaE/yOWC5LueIHZig= +github.com/spf13/viper v1.0.2 h1:Ncr3ZIuJn322w2k1qmzXDnkLAdQMlJqBa9kfAH+irso= +github.com/stoewer/go-strcase v1.2.0 h1:Z2iHWqGXH00XYgqDmNgQbIBxf3wrNq0F3feEy0ainaU= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/timakin/bodyclose v0.0.0-20190721030226-87058b9bfcec h1:AmoEvWAO3nDx1MEcMzPh+GzOOIA5Znpv6++c7bePPY0= +github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7otjonDflCTK0BCfls4SPy3NcCVb5dqqmbRknE= github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk= +github.com/tsenart/vegeta/v12 v12.8.4 h1:UQ7tG7WkDorKj0wjx78Z4/vsMBP8RJQMGJqRVrkvngg= github.com/tsenart/vegeta/v12 v12.8.4/go.mod h1:ZiJtwLn/9M4fTPdMY7bdbIeyNeFVE8/AHbWFqCsUuho= +github.com/ultraware/funlen v0.0.1 h1:UeC9tpM4wNWzUJfan8z9sFE4QCzjjzlCZmuJN+aOkH0= +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= +github.com/valyala/fasthttp v1.2.0 h1:dzZJf2IuMiclVjdw0kkT+f9u4YdrapbNyGAN47E/qnk= +github.com/valyala/quicktemplate v1.1.1 h1:C58y/wN0FMTi2PR0n3onltemfFabany53j7M6SDDB8k= +github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a h1:0R4NLDRDZX6JcmhJgXi5E4b8Wg84ihbmUKp/GvSPEzc= +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= +github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= +github.com/xhit/go-str2duration v1.2.0 h1:BcV5u025cITWxEQKGWr1URRzrcXtu7uk8+luz3Yuhwc= github.com/xhit/go-str2duration v1.2.0/go.mod h1:3cPSlfZlUHVlneIVfePFWcJZsuwf+P1v2SRTV4cUmp4= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= +go.etcd.io/etcd/api/v3 v3.5.7 h1:sbcmosSVesNrWOJ58ZQFitHMdncusIifYcrBfwrlJSY= go.etcd.io/etcd/api/v3 v3.5.7/go.mod h1:9qew1gCdDDLu+VwmeG+iFpL+QlpHTo7iubavdVDgCAA= +go.etcd.io/etcd/client/pkg/v3 v3.5.7 h1:y3kf5Gbp4e4q7egZdn5T7W9TSHUvkClN6u+Rq9mEOmg= go.etcd.io/etcd/client/pkg/v3 v3.5.7/go.mod h1:o0Abi1MK86iad3YrWhgUsbGx1pmTS+hrORWc2CamuhY= +go.etcd.io/etcd/client/v2 v2.305.7 h1:AELPkjNR3/igjbO7CjyF1fPuVPjrblliiKj+Y6xSGOU= go.etcd.io/etcd/client/v2 v2.305.7/go.mod h1:GQGT5Z3TBuAQGvgPfhR7VPySu/SudxmEkRq9BgzFU6s= +go.etcd.io/etcd/client/v3 v3.5.7 h1:u/OhpiuCgYY8awOHlhIhmGIGpxfBU/GZBUP3m/3/Iz4= go.etcd.io/etcd/client/v3 v3.5.7/go.mod h1:sOWmj9DZUMyAngS7QQwCyAXXAL6WhgTOPLNS/NabQgw= +go.etcd.io/etcd/pkg/v3 v3.5.7 h1:obOzeVwerFwZ9trMWapU/VjDcYUJb5OfgC1zqEGWO/0= go.etcd.io/etcd/pkg/v3 v3.5.7/go.mod h1:kcOfWt3Ov9zgYdOiJ/o1Y9zFfLhQjylTgL4Lru8opRo= +go.etcd.io/etcd/raft/v3 v3.5.7 h1:aN79qxLmV3SvIq84aNTliYGmjwsW6NqJSnqmI1HLJKc= go.etcd.io/etcd/raft/v3 v3.5.7/go.mod h1:TflkAb/8Uy6JFBxcRaH2Fr6Slm9mCPVdI2efzxY96yU= +go.etcd.io/etcd/server/v3 v3.5.7 h1:BTBD8IJUV7YFgsczZMHhMTS67XuA4KpRquL0MFOJGRk= go.etcd.io/etcd/server/v3 v3.5.7/go.mod h1:gxBgT84issUVBRpZ3XkW1T55NjOb4vZZRI4wVvNhf4A= +go.mongodb.org/mongo-driver v1.5.1 h1:9nOVLGDfOaZ9R0tBumx/BcuqkbFpyTCU2r/Po7A2azI= go.mongodb.org/mongo-driver v1.5.1/go.mod h1:gRXCHX4Jo7J0IJ1oDQyUxF7jfy19UfxniMS4xxMmUqw= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= @@ -266,18 +437,30 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.35.0 h1:xFSRQBbXF6VvYRf2lqMJXxoB72XI1K/azav8TekHHSw= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.35.0/go.mod h1:h8TWwRAhQpOd0aM5nYsRD8+flnkj+526GEIVlarH7eY= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.35.1 h1:sxoY9kG1s1WpSYNyzm24rlwH4lnRYFXUVVBmKMBfRgw= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.35.1/go.mod h1:9NiG9I2aHTKkcxqCILhjtyNA1QEiCjdBACv4IvrFQ+c= +go.opentelemetry.io/otel v1.10.0 h1:Y7DTJMR6zs1xkS/upamJYk0SxxN4C9AqRd77jmZnyY4= go.opentelemetry.io/otel v1.10.0/go.mod h1:NbvWjCthWHKBEUMpf0/v8ZRZlni86PpGFEMA9pnQSnQ= +go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0 h1:TaB+1rQhddO1sF71MpZOZAuSPW1klK2M8XxfrBMfK7Y= go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0/go.mod h1:78XhIg8Ht9vR4tbLNUhXsiOnE2HOuSeKAiAcoVQEpOY= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0 h1:pDDYmo0QadUPal5fwXoY1pmMpFcdyhXOmL5drCrI3vU= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0/go.mod h1:Krqnjl22jUJ0HgMzw5eveuCvFDXY4nSYb4F8t5gdrag= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0 h1:KtiUEhQmj/Pa874bVYKGNVdq8NPKiacPbaRRtgXi+t4= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0/go.mod h1:OfUCyyIiDvNXHWpcWgbF+MWvqPZiNa3YDEnivcnYsV0= +go.opentelemetry.io/otel/metric v0.31.0 h1:6SiklT+gfWAwWUR0meEMxQBtihpiEs4c+vL9spDTqUs= go.opentelemetry.io/otel/metric v0.31.0/go.mod h1:ohmwj9KTSIeBnDBm/ZwH2PSZxZzoOaG2xZeekTRzL5A= +go.opentelemetry.io/otel/sdk v1.10.0 h1:jZ6K7sVn04kk/3DNUdJ4mqRlGDiXAVuIG+MMENpTNdY= go.opentelemetry.io/otel/sdk v1.10.0/go.mod h1:vO06iKzD5baltJz1zarxMCNHFpUlUiOy4s65ECtn6kE= +go.opentelemetry.io/otel/trace v1.10.0 h1:npQMbR8o7mum8uF95yFbOEJffhs1sbCOfDh8zAJiH5E= go.opentelemetry.io/otel/trace v1.10.0/go.mod h1:Sij3YYczqAdz+EhmGhE6TpTxUO5/F/AzrK+kxfGqySM= +go.opentelemetry.io/proto/otlp v0.19.0 h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw= go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/automaxprocs v1.4.0 h1:CpDZl6aOlLhReez+8S3eEotD7Jx0Os++lemPlMULQP0= go.uber.org/automaxprocs v1.4.0/go.mod h1:/mTEdr7LvHhs0v7mjdxDreTz1OG5zdZGqgOnhWiR/+Q= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= @@ -287,6 +470,7 @@ go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4 h1:c2HOrn5iMezYjSlGPncknSEr/8x5LELb/ilJbXi9DEA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= @@ -301,6 +485,7 @@ golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+o golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= @@ -482,6 +667,7 @@ golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -513,6 +699,7 @@ google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqiv google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= google.golang.org/api v0.58.0/go.mod h1:cAbP2FsxoGVNwtgNAmmn3y5G1TWAiVYRmg4yku3lv+E= +google.golang.org/api v0.61.0 h1:TXXKS1slM3b2bZNJwD5DV/Tp6/M2cLzLOLh9PjDhrw8= google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= @@ -575,6 +762,7 @@ google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ6 google.golang.org/genproto v0.0.0-20211016002631-37fc39342514/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21 h1:hrbNEivu7Zn1pxvHk6MBrq9iE22woVILTHqexqBxe6I= google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -596,31 +784,49 @@ google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnD google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.51.0 h1:E1eGv1FTqoLIdnBCZufiSHgKjlqG6fKFf6pPWtMTh8U= google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/airbrake/gobrake.v2 v2.0.9 h1:7z2uVWwn7oVeeugY1DtlPAy5H+KYgB1KeKTnqjNatLo= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/errgo.v2 v2.1.0 h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= +gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 h1:OAj3g0cR6Dx/R07QgQe8wkA9RNjB2u4i700xBkIT4e0= +gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc h1:/hemPrYIhOhy8zYrNj+069zDB68us2sMGsfkFJO0iZs= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +k8s.io/apiserver v0.27.2 h1:p+tjwrcQEZDrEorCZV2/qE8osGTINPuS5ZNqWAvKm5E= k8s.io/apiserver v0.27.2/go.mod h1:EsOf39d75rMivgvvwjJ3OW/u9n1/BmUMK5otEOJrb1Y= +k8s.io/code-generator v0.27.2 h1:RmK0CnU5qRaK6WRtSyWNODmfTZNoJbrizpVcsgbtrvI= k8s.io/code-generator v0.27.2/go.mod h1:DPung1sI5vBgn4AGKtlPRQAyagj/ir/4jI55ipZHVww= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/gengo v0.0.0-20220902162205-c0856e24416d/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/gengo v0.0.0-20221011193443-fad74ee6edd9 h1:iu3o/SxaHVI7tKPtkGzD3M9IzrE21j+CUKH98NQJ8Ms= k8s.io/gengo v0.0.0-20221011193443-fad74ee6edd9/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/kms v0.27.2 h1:wCdmPCa3kubcVd3AssOeaVjLQSu45k5g/vruJ3iqwDU= k8s.io/kms v0.27.2/go.mod h1:dahSqjI05J55Fo5qipzvHSRbm20d7llrSeQjjl86A7c= k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +knative.dev/hack v0.0.0-20230417170854-f591fea109b3 h1:+W4WBOq83tfGXKhtv8OB/uJeYqze3zh69GKiz1ucuqk= knative.dev/hack v0.0.0-20230417170854-f591fea109b3/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q= +mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed h1:WX1yoOaKQfddO/mLzdV4wptyWgoH/6hwLs7QHTixo0I= +mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b h1:DxJ5nJdkhDlLok9K6qO+5290kphDJbHOQO1DFFFTeBo= +mvdan.cc/unparam v0.0.0-20190209190245-fbb59629db34 h1:duVSyluuJA+u0BnkcLR01smoLrGgDTfWt5c8ODYG8fU= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.1.2 h1:trsWhjU5jZrx6UvFu4WzQDrN7Pga4a7Qg+zcfcj64PA= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.1.2/go.mod h1:+qG7ISXqCDVVcyO8hLn12AKVYYUjM7ftlqsqmrhMZE0= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4 h1:JPJh2pk3+X4lXAkZIk2RuE/7/FoK9maXw+TNPJhVS/c= diff --git a/log/log.go b/log/log.go new file mode 100644 index 000000000..faf57c9c4 --- /dev/null +++ b/log/log.go @@ -0,0 +1,25 @@ +/* + * Copyright 2023 Red Hat, Inc. and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package log + +// Constants for different log level verbosity. +const ( + E = iota + W = iota + I = iota + D = iota +) diff --git a/main.go b/main.go index 4535db69b..8b129177d 100644 --- a/main.go +++ b/main.go @@ -18,6 +18,8 @@ import ( "flag" "os" + "k8s.io/klog/v2" + "github.com/kiegroup/kogito-serverless-operator/utils" "github.com/kiegroup/kogito-serverless-operator/controllers" @@ -32,15 +34,14 @@ import ( clientgoscheme "k8s.io/client-go/kubernetes/scheme" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/healthz" - "sigs.k8s.io/controller-runtime/pkg/log/zap" operatorapi "github.com/kiegroup/kogito-serverless-operator/api/v1alpha08" + "github.com/kiegroup/kogito-serverless-operator/log" //+kubebuilder:scaffold:imports ) var ( - scheme = runtime.NewScheme() - setupLog = ctrl.Log.WithName("setup") + scheme = runtime.NewScheme() ) func init() { @@ -53,19 +54,14 @@ func main() { var metricsAddr string var enableLeaderElection bool var probeAddr string + klog.InitFlags(nil) flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.") flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.") flag.BoolVar(&enableLeaderElection, "leader-elect", false, "Enable leader election for controller manager. "+ "Enabling this will ensure there is only one active controller manager.") - opts := zap.Options{ - Development: true, - } - opts.BindFlags(flag.CommandLine) flag.Parse() - ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts))) - mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ Scheme: scheme, MetricsBindAddress: metricsAddr, @@ -75,7 +71,7 @@ func main() { LeaderElectionID: "1be5e57d.kie.org", }) if err != nil { - setupLog.Error(err, "unable to start manager") + klog.V(log.E).ErrorS(err, "unable to start manager") os.Exit(1) } @@ -87,7 +83,7 @@ func main() { Config: mgr.GetConfig(), Recorder: mgr.GetEventRecorderFor("workflow-controller"), }).SetupWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create controller", "controller", "SonataFlow") + klog.V(log.E).ErrorS(err, "unable to create controller", "controller", "SonataFlow") os.Exit(1) } if err = (&controllers.SonataFlowBuildReconciler{ @@ -96,7 +92,7 @@ func main() { Config: mgr.GetConfig(), Recorder: mgr.GetEventRecorderFor("build-controller"), }).SetupWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create controller", "controller", "SonataFlowBuild") + klog.V(log.E).ErrorS(err, "unable to create controller", "controller", "SonataFlowBuild") os.Exit(1) } @@ -107,7 +103,7 @@ func main() { Config: mgr.GetConfig(), Recorder: mgr.GetEventRecorderFor("platform-controller"), }).SetupWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create controller", "controller", "SonataFlowPlatform") + klog.V(log.E).ErrorS(err, "unable to create controller", "controller", "SonataFlowPlatform") os.Exit(1) } //+kubebuilder:scaffold:builder @@ -117,17 +113,17 @@ func main() { } if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil { - setupLog.Error(err, "unable to set up health check") + klog.V(log.E).ErrorS(err, "unable to set up health check") os.Exit(1) } if err := mgr.AddReadyzCheck("readyz", healthz.Ping); err != nil { - setupLog.Error(err, "unable to set up ready check") + klog.V(log.E).ErrorS(err, "unable to set up ready check") os.Exit(1) } - setupLog.Info("starting manager") + klog.V(log.I).InfoS("starting manager") if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil { - setupLog.Error(err, "problem running manager") + klog.V(log.E).ErrorS(err, "problem running manager") os.Exit(1) } diff --git a/modules/org.kie.kogito.app.builder/module.yaml b/modules/org.kie.kogito.app.builder/module.yaml index f8b1eb4a2..2b39d29e6 100644 --- a/modules/org.kie.kogito.app.builder/module.yaml +++ b/modules/org.kie.kogito.app.builder/module.yaml @@ -20,5 +20,9 @@ artifacts: path: "../../../../utils" dest: /workspace/utils + - name: log + path: "../../../../log" + dest: /workspace/log + execute: - script: install.sh \ No newline at end of file diff --git a/test/mock_service.go b/test/mock_service.go index 84413ee8e..76e694b96 100644 --- a/test/mock_service.go +++ b/test/mock_service.go @@ -17,7 +17,8 @@ package test import ( "context" - "github.com/RHsyseng/operator-utils/pkg/logs" + "k8s.io/klog/v2" + oappsv1 "github.com/openshift/api/apps/v1" buildv1 "github.com/openshift/api/build/v1" consolev1 "github.com/openshift/api/console/v1" @@ -32,10 +33,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/fake" apiv08 "github.com/kiegroup/kogito-serverless-operator/api/v1alpha08" + "github.com/kiegroup/kogito-serverless-operator/log" ) -var logger = logs.GetLogger("kieapp.test") - type MockPlatformService struct { Client clientv1.Client scheme *runtime.Scheme @@ -112,7 +112,7 @@ func MockServiceWithExtraScheme(objs ...runtime.Object) *MockPlatformService { } } client := fake.NewFakeClientWithScheme(scheme) - logger.Debugf("Fake client created as %v", client) + klog.V(log.D).InfoS("Fake client created", "client", client) return &MockPlatformService{ Client: client, scheme: scheme, diff --git a/test/yaml.go b/test/yaml.go index 044fea116..7c6f2acb6 100644 --- a/test/yaml.go +++ b/test/yaml.go @@ -20,13 +20,15 @@ import ( "runtime" "strings" + "k8s.io/klog/v2" + "github.com/davecgh/go-spew/spew" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/yaml" - "github.com/kiegroup/kogito-serverless-operator/container-builder/util/log" + "github.com/kiegroup/kogito-serverless-operator/log" operatorapi "github.com/kiegroup/kogito-serverless-operator/api/v1alpha08" ) @@ -54,17 +56,17 @@ func GetSonataFlow(path string, namespace string) *operatorapi.SonataFlow { ksw := &operatorapi.SonataFlow{} yamlFile, err := os.ReadFile(path) if err != nil { - log.Errorf(err, "yamlFile.Get err #%v ", err) + klog.V(log.E).ErrorS(err, "yamlFile.Get") panic(err) } // Important: Here we are reading the CR deployment file from a given path and creating an &operatorapi.SonataFlow struct err = yaml.NewYAMLOrJSONDecoder(bytes.NewReader(yamlFile), 100).Decode(ksw) if err != nil { - log.Errorf(err, "Unmarshal: #%v", err) + klog.V(log.E).ErrorS(err, "Unmarshal") panic(err) } - log.Debugf("Successfully read KSW #%v ", spew.Sprint(ksw)) + klog.V(log.D).InfoS("Successfully read KSW", "ksw", spew.Sprint(ksw)) ksw.Namespace = namespace return ksw } @@ -73,16 +75,16 @@ func GetSonataFlowPlatform(path string) *operatorapi.SonataFlowPlatform { ksp := &operatorapi.SonataFlowPlatform{} yamlFile, err := os.ReadFile(path) if err != nil { - log.Errorf(err, "yamlFile.Get err #%v ", err) + klog.V(log.E).ErrorS(err, "yamlFile.Get") panic(err) } // Important: Here we are reading the CR deployment file from a given path and creating a &operatorapi.SonataFlowPlatform struct err = yaml.NewYAMLOrJSONDecoder(bytes.NewReader(yamlFile), 100).Decode(ksp) if err != nil { - log.Errorf(err, "Unmarshal: %v", err) + klog.V(log.E).ErrorS(err, "Unmarshal") panic(err) } - log.Debugf("Successfully read KSP #%v ", ksp) + klog.V(log.D).InfoS("Successfully read KSP", "ksp", ksp) return ksp } @@ -114,12 +116,12 @@ func GetSonataFlowBuilderConfig(path, namespace string) *corev1.ConfigMap { cm := &corev1.ConfigMap{} yamlFile, err := os.ReadFile(path + manifestsPath + sonataFlowBuilderConfig) if err != nil { - log.Errorf(err, "yamlFile.Get err #%v ", err) + klog.V(log.E).ErrorS(err, "yamlFile.Get") panic(err) } err = yaml.NewYAMLOrJSONDecoder(bytes.NewReader(yamlFile), 100).Decode(cm) if err != nil { - log.Errorf(err, "Unmarshal: #%v", err) + klog.V(log.E).ErrorS(err, "Unmarshal") panic(err) } cm.Namespace = namespace @@ -146,7 +148,7 @@ func GetPathForSamples(path string) string { func GetBaseSonataFlow(namespace string) *operatorapi.SonataFlow { _, file, _, ok := runtime.Caller(1) - log.Info("caller:" + file) + klog.V(log.I).InfoS("caller", "file", file) if ok { return GetSonataFlow(GetPathForSamples(file)+SonataFlowSampleYamlCR, namespace) } else { diff --git a/utils/kubernetes/annotations.go b/utils/kubernetes/annotations.go index 389bee917..6608dc20e 100644 --- a/utils/kubernetes/annotations.go +++ b/utils/kubernetes/annotations.go @@ -17,24 +17,26 @@ package kubernetes import ( "context" - operatorapi "github.com/kiegroup/kogito-serverless-operator/api/v1alpha08" + "k8s.io/klog/v2" + + "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/go-logr/logr" - client "sigs.k8s.io/controller-runtime/pkg/client" + operatorapi "github.com/kiegroup/kogito-serverless-operator/api/v1alpha08" + "github.com/kiegroup/kogito-serverless-operator/log" ) -func getWorkflow(namespace string, name string, c client.Client, ctx context.Context, logger *logr.Logger) *operatorapi.SonataFlow { +func getWorkflow(namespace string, name string, c client.Client, ctx context.Context) *operatorapi.SonataFlow { serverlessWorkflowType := &operatorapi.SonataFlow{} serverlessWorkflowType.Namespace = namespace serverlessWorkflowType.Name = name serverlessWorkflow := &operatorapi.SonataFlow{} if err := c.Get(ctx, client.ObjectKeyFromObject(serverlessWorkflowType), serverlessWorkflow); err != nil { - logger.Error(err, "Error during Get") + klog.V(log.E).ErrorS(err, "unable to retrieve SonataFlow definition") } return serverlessWorkflow } -func GetLastGeneration(namespace string, name string, c client.Client, ctx context.Context, logger *logr.Logger) int64 { - workflow := getWorkflow(namespace, name, c, ctx, logger) +func GetLastGeneration(namespace string, name string, c client.Client, ctx context.Context) int64 { + workflow := getWorkflow(namespace, name, c, ctx) return workflow.Generation } diff --git a/workflowproj/go.mod b/workflowproj/go.mod index 4a6316880..3fb2f8c30 100644 --- a/workflowproj/go.mod +++ b/workflowproj/go.mod @@ -74,7 +74,7 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/apiextensions-apiserver v0.27.2 // indirect k8s.io/component-base v0.27.2 // indirect - k8s.io/klog/v2 v2.90.1 // indirect + k8s.io/klog/v2 v2.100.1 // indirect k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect k8s.io/utils v0.0.0-20230313181309-38a27ef9d749 // indirect knative.dev/pkg v0.0.0-20230525143525-9bda38b21643 // indirect diff --git a/workflowproj/go.sum b/workflowproj/go.sum index 8e48c5838..afc3e9d8f 100644 --- a/workflowproj/go.sum +++ b/workflowproj/go.sum @@ -379,8 +379,8 @@ k8s.io/client-go v0.27.2 h1:vDLSeuYvCHKeoQRhCXjxXO45nHVv2Ip4Fe0MfioMrhE= k8s.io/client-go v0.27.2/go.mod h1:tY0gVmUsHrAmjzHX9zs7eCjxcBsf8IiNe7KQ52biTcQ= k8s.io/component-base v0.27.2 h1:neju+7s/r5O4x4/txeUONNTS9r1HsPbyoPBAtHsDCpo= k8s.io/component-base v0.27.2/go.mod h1:5UPk7EjfgrfgRIuDBFtsEFAe4DAvP3U+M8RTzoSJkpo= -k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw= -k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= +k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg= k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg= k8s.io/utils v0.0.0-20230313181309-38a27ef9d749 h1:xMMXJlJbsU8w3V5N2FLDQ8YgU8s1EoULdbQBcAeNJkY=