-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
[kubectl_manifest] panic: runtime error: slice bounds out of range #181
Comments
Thanks, I will have a look. Although thats not a proper way of using kubectl_file_documents. You will be far better of with
If you are using count and the number of documents changes, that will trigger destroy sequence (and potentially thats what have been causing the crash above). |
Hi there, I am facing the same issue and it seems to be a bug in the upstream Back to the issue when using it in the provider, I was able to create a minimal scenario, based on my usage case, and focusing directly on the usage of the
package main
import (
"github.com/sergi/go-diff/diffmatchpatch"
"log"
"os"
)
func main() {
bytes, err := os.ReadFile("file1.yaml")
if err != nil {
log.Fatalf("Failed to read file: %v", err)
}
stateYaml := string(bytes)
bytes, err = os.ReadFile("file2.yaml")
if err != nil {
log.Fatalf("Failed to read file: %v", err)
}
liveStateYaml := string(bytes)
dmp := diffmatchpatch.New()
patches := dmp.PatchMake(stateYaml, liveStateYaml)
patchText := dmp.PatchToText(patches)
log.Printf("[DEBUG] DETECTED YAML INCLUSTER STATE DIFFERENCE. Patch diff: %s", patchText)
} It will produce the following error:
The content of the files1 and file2 were obtained from the |
that sucks, by the look of it, that library is no longer maintained (at least I do not see any activity), so might be worthwhile investigate an alternative. |
I've checked in the code. By the look of it, that library was used only for printing a diff in the tracing. Given that, it should be safe to remove it for now until a valid alternative is found. |
Thanks for swift response @alekc. |
Closing this ticket off. Expect a new version with a fix being released next week |
Version:
2.1.0
Terraform:
1.5.7
Given the following to apply Rancher manifests as part of importing a cluster:
When applied the first time there is no problem and works as expected. However, in subsequent
terraform plan
s the following error is shown:The text was updated successfully, but these errors were encountered: