MCPcopy Index your code
hub / github.com/devspace-sh/devspace / ExpectRemoteFileNotFound

Function ExpectRemoteFileNotFound

e2e/framework/helper.go:134–156  ·  view source on GitHub ↗
(imageSelector string, namespace string, filePath string)

Source from the content-addressed store, hash-verified

132}
133
134func ExpectRemoteFileNotFound(imageSelector string, namespace string, filePath string) {
135 kubeClient, err := kube.NewKubeHelper()
136 ExpectNoErrorWithOffset(1, err)
137
138 fileExists := "file exists"
139 fileNotFound := "file not found"
140 err = wait.PollUntilContextTimeout(context.TODO(), time.Second, time.Minute*2, true, func(_ context.Context) (done bool, err error) {
141 test := []string{"sh", "-c", fmt.Sprintf("test -e %s && echo %s || echo %s", filePath, fileExists, fileNotFound)}
142 out, err := kubeClient.ExecByImageSelector(imageSelector, namespace, test)
143 if err != nil {
144 return false, err
145 }
146
147 out = strings.Trim(out, "\n")
148
149 if out == fileExists {
150 return false, errors.New("file should not exist")
151 }
152
153 return out == fileNotFound, nil
154 })
155 ExpectNoErrorWithOffset(1, err)
156}
157
158func ExpectRemoteContainerFileContents(labelSelector, container string, namespace string, filePath string, contents string) {
159 kubeClient, err := kube.NewKubeHelper()

Callers 1

sync.goFile · 0.92

Calls 3

ExecByImageSelectorMethod · 0.95
NewKubeHelperFunction · 0.92
ExpectNoErrorWithOffsetFunction · 0.85

Tested by

no test coverage detected