Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issue 902: chaosblade operator match containerId #210

Merged
merged 1 commit into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions exec/container/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/chaosblade-io/chaosblade-exec-cri/exec/container"
"github.com/chaosblade-io/chaosblade-spec-go/util"
"github.com/sirupsen/logrus"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"

"github.com/chaosblade-io/chaosblade-spec-go/spec"

Expand Down Expand Up @@ -161,7 +161,7 @@ func getMatchedContainerMetaList(pods []v1.Pod, containerIdsValue, containerName
if expectedContainerId == "" {
continue
}
if strings.HasPrefix(containerId, expectedContainerId) {
if strings.HasPrefix(expectedContainerId, containerId) {
if containerStatusErr != nil {
return containerObjectMetaList, spec.ResponseFailWithFlags(spec.ParameterInvalid,
model.ContainerIdsFlag.Name, expectedContainerId,
Expand Down
5 changes: 3 additions & 2 deletions exec/model/executor_copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ package model
import (
"context"
"fmt"
"path"
"sync"

"github.com/chaosblade-io/chaosblade-exec-cri/exec/container"
"github.com/chaosblade-io/chaosblade-operator/channel"
"github.com/chaosblade-io/chaosblade-operator/pkg/apis/chaosblade/v1alpha1"
Expand All @@ -30,8 +33,6 @@ import (
v1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/types"
"path"
"sync"
)

type ExperimentIdentifierInPod struct {
Expand Down