Skip to content

Commit

Permalink
Fix stuff, add debug print
Browse files Browse the repository at this point in the history
  • Loading branch information
barchw committed Dec 12, 2024
1 parent 9ffab9b commit f44d243
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and Cust
generate-integration-test-manifest: manifests kustomize module-version
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
$(KUSTOMIZE) build config/default -o tests/integration/steps/operator_generated_manifest.yaml
yq eval '(.spec.template.spec.containers[0].env //= []) += {"name": "DEBUG_PRINT_IOP", "value": "true"}' -i my-app-deployment.yaml

.PHONY: generate
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
Expand Down
10 changes: 8 additions & 2 deletions internal/restarter/sidecars.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package restarter
import (
"context"
"fmt"
"google.golang.org/protobuf/types/known/structpb"
"strings"

"github.com/kyma-project/istio/operator/internal/compatibility"
Expand Down Expand Up @@ -68,7 +67,14 @@ func (s *SidecarsRestarter) Restart(ctx context.Context, istioCR *v1alpha2.Istio
return described_errors.NewDescribedError(err, "Could not get Istio version from istio operator file"), false
}

expectedImage := pods.NewSidecarImage(iop.Spec.Hub, iop.Spec.Tag.(*structpb.Value).GetStringValue())
tag, ok := iop.Spec.Tag.(string)
if !ok {
ctrl.Log.Error(err, "Error getting Istio tag from istio operator file")
s.StatusHandler.SetCondition(istioCR, v1alpha2.NewReasonWithMessage(v1alpha2.ConditionReasonProxySidecarRestartFailed))
return described_errors.NewDescribedError(err, "Could not get Istio tag from istio operator file"), false
}

expectedImage := pods.NewSidecarImage(iop.Spec.Hub, tag)
s.Log.Info("Running proxy sidecar reset", "expected image", expectedImage)

err = gatherer.VerifyIstioPodsVersion(ctx, s.Client, istioImageVersion.Version())
Expand Down

0 comments on commit f44d243

Please sign in to comment.