linuxkit/kubernetes

Cannot boot kube-master using boot.sh when metadata.json is empty

stefanhenseler opened this issue · 3 comments

Description
I experienced an issue when I tried to run a k8s master on my mac.

I use the following versions:

  • MacOS-X High Sierra 10.13
  • linuxkit version 0.0 / commit: 41a4c2df108bc739897e6a6f9234e6c794ab380f
  • moby version 0.0 / commit: 6ba3288963c52b0831e72f99851b565baf6498e4

Steps to reproduce the issue:

  1. Clone the repo
  2. cd to the repo root
  3. run: make all
  4. run: ./boot.sh

Describe the results you received:
I get the following exception:

linuxkit-kubernetes git/master  12s
❯ ./boot.sh
+ '[' -n '' ']'
+ mkdir -p kube-master-state
+ touch kube-master-state/metadata.json
+ '[' -n '' ']'
+ linuxkit run -networking default -cpus 2 -mem 1024 -state kube-master-state -disk size=4G -data kube-master-state/metadata.json --uefi kube-master-efi.iso
FATA[0000] Cannot write user data ISO: input buffer must be at least 1 byte in size

Describe the results you expected:
The k8s master should start.

Additional information you deem important (e.g. issue happens only occasionally):
I was able to resolve the issue by just adding an empty json object to the metadata.json file. I've committed the 'fix' to my fork: https://github.com/synax/linuxkit-kubernetes/commit/56ad664bb721cb918ee6047b5b09f879f1b44ab1

ijc commented

Thanks, I expect this is down to 04f7de2, seems like the file based method doesn't accept an empty file where the raw string based on did. I'll have a think about how best to address this.

ijc commented

I could see an argument for such a check in linuxkit, but actually the error is from the underlying is09660 package and I can't see any reason to refuse to create an empty file at that layer — unless the ISO9660 spec has something to say on the matter, I've not checked yet.

/cc @rn I'll check the spec and assuming it has no such restrictions relax that check, WDYT?

rn commented

The iso9660 package is a mess but the only one I could find to create a simple ISO. I'm fine with relaxing the check if it doesn't violate the spec.