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

Function ExpectRemoteContainerFileContents

e2e/framework/helper.go:158–170  ·  view source on GitHub ↗
(labelSelector, container string, namespace string, filePath string, contents string)

Source from the content-addressed store, hash-verified

156}
157
158func ExpectRemoteContainerFileContents(labelSelector, container string, namespace string, filePath string, contents string) {
159 kubeClient, err := kube.NewKubeHelper()
160 ExpectNoErrorWithOffset(1, err)
161
162 err = wait.PollUntilContextTimeout(context.TODO(), time.Second, time.Minute*2, true, func(_ context.Context) (done bool, err error) {
163 out, err := kubeClient.ExecByContainer(labelSelector, container, namespace, []string{"cat", filePath})
164 if err != nil {
165 return false, nil
166 }
167 return out == contents, nil
168 })
169 ExpectNoErrorWithOffset(1, err)
170}
171
172func ExpectLocalFileContentsImmediately(filePath string, contents string) {
173 out, err := os.ReadFile(filePath)

Callers 1

sync.goFile · 0.92

Calls 3

ExecByContainerMethod · 0.95
NewKubeHelperFunction · 0.92
ExpectNoErrorWithOffsetFunction · 0.85

Tested by

no test coverage detected