You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting intermittent errors on upgrade. In this case, a DaemonSet with apiVersion: apps/v1 where I changed spec.template.spec.resources :
Helm:
Error: UPGRADE FAILED: failed to create patch: failed to get versionedObject: Object 'apiVersion' is missing in 'unstructured object has no version' && failed to create patch: unable to find api field in struct PodSpec for the json field "resources"
Tiller:
[tiller] 2018/06/27 13:29:42 creating updated release for k8s-efk-filebeat-fix
[storage] 2018/06/27 13:29:42 creating release "k8s-efk-filebeat-fix.v2"
[tiller] 2018/06/27 13:29:42 performing update for k8s-efk-filebeat-fix
[tiller] 2018/06/27 13:29:42 executing 1 pre-upgrade hooks for k8s-efk-filebeat-fix
[tiller] 2018/06/27 13:29:42 hooks complete for pre-upgrade k8s-efk-filebeat-fix
[kube] 2018/06/27 13:29:42 building resources from updated manifest
[kube] 2018/06/27 13:29:42 checking 23 resources for changes
[kube] 2018/06/27 13:29:42 error updating the resource "k8s-efk-filebeat-fix-ci-filebeat":
failed to create patch: failed to get versionedObject: Object 'apiVersion' is missing in 'unstructured object has no version'
[kube] 2018/06/27 13:29:42 error updating the resource "k8s-efk-filebeat-fix-ci-filebeat":
failed to create patch: unable to find api field in struct PodSpec for the json field "resources"
[tiller] 2018/06/27 13:29:43 warning: Upgrade "k8s-efk-filebeat-fix" failed: failed to create patch: failed to get versionedObject: Object 'apiVersion' is missing in 'unstructured object has no version' && failed to create patch: unable to find api field in struct PodSpec for the json field "resources"
[storage] 2018/06/27 13:29:43 updating release "k8s-efk-filebeat-fix.v1"
[storage] 2018/06/27 13:29:43 updating release "k8s-efk-filebeat-fix.v2"
This seems similar to #3382 , but this is not a CRD.
The text was updated successfully, but these errors were encountered:
Looks like this was a malformed Daemonset (resources was not indented properly). Is there a way to expose the Kubernetes validation that catches this?
error: error validating "/tmp/test.yaml": error validating data: ValidationError(DaemonSet.spec.template.spec): unknown field "resources" in io.k8s.api.core.v1.PodSpec; if you choose to ignore these errors, turn validation off with --validate=false
# some comment
{{- if .Values.global.rbacEnable -}}
apiVersion: v1
kind: ServiceAccount
...
Guess what happens?
# some comment apiVersion: v1
kind: ServiceAccount
...
Helm happily attempts to use the invalid object and fails: Error: failed to create patch: failed to get versionedObject: Object 'apiVersion' is missing in 'unstructured object has no version'
One way to validate the objects is with kubectl. I'd be happy to have an alternative:
TMP_DIR=/tmp/manifests
mkdir -p $TMP_DIR
helm template $HELM_OPTS $HELM_CHART_PATH \
| csplit -f $TMP_DIR/ --suppress-matched -q -z - '/^---$/' '{*}'
for f in $TMP_DIR/*; do
kubectl apply --dry-run -f $f || exit 1
done
Output of
helm version
:Output of
kubectl version
:Cloud Provider/Platform: AWS
I'm getting intermittent errors on upgrade. In this case, a DaemonSet with
apiVersion: apps/v1
where I changedspec.template.spec.resources
:Helm:
Tiller:
This seems similar to #3382 , but this is not a CRD.
The text was updated successfully, but these errors were encountered: