Does anyone know why putting these resources into a single file does not work, but having them in separate files work perfectly fine?
oc apply -f big_file.yaml on this does not work:
- name: placeholder
- name: http-get-trigger
- ref: http-get-translater
- apiVersion: tekton.dev/v1beta1
oc apply -f folder_with_resources_in_separate_files/ works.
I’ve tried changing the order of the resources within the file to see if it’s like a dependency issue, but could not get things working. Any ideas?
Thank you for your time
Put this line between logical documents in a single file:
Thanks for the tip. I gave it a try and it didn’t work.
I’m stumped why the separator
--- would make a difference in the way the YAML files or processed…just out of curiosity.
Please let me know if there are other things I can try.
I must be missing something fundamental because I can’t reason out why separate files would matter and why
--- would matter when defining the resources.
Thank you again for your time
Sorry, I goof’d. It did work!
But why? and how come?
why does defining resources in separate files or separated documents matter to kubernetes/openshift?
hmmm …is each file intended to describe just one resource/object?
is it wrong to think of each file as a list of resources/objects?
I thought I’ve had YAML files that list multiple resources/objects, but maybe my memory is wrong…
is this a Kubernetes convention or a YAML convention?
ah…I think I understand now.
the latter keys in the YAML file overwrite the earlier keys
Kubernetes could have supported multiple resources in a single document if the root of the document starts off as a list
so I guess this is one of those by design things?
sorry for the barrage of messages and newbie mistake
thank you for pointing me in the right direction and pointing out a basic detail I had skipped over for the longest time
USUALLY a single file is a single YAML document, meaning a single kube API resource.
--- syntax is the “document separator” in YAML, which allows one file to hold multiple documents.
Thank you for confirming
I’m curious when are the times that this is not the case?
<what specifically> is not the case?
I said “usually” because that’s how many people manage their files - 1 resource == 1 file. But YAML has this syntax and we do support it, so users are free to do it 1:1 or N:1 as they see fit.
okay, good to know. thanks again for your help