Open johscheuer opened 5 years ago
This is the resulting build:
apiVersion: build.knative.dev/v1alpha1
kind: Build
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"build.knative.dev/v1alpha1","kind":"Build","metadata":{"annotations":{},"name":"example-build","namespace":"default"},"spec":{"steps":[{"args":["echo","hello-example","one"],"image":"ubuntu"}]}}
creationTimestamp: "2019-05-08T18:34:07Z"
generation: 1
name: example-build
namespace: default
resourceVersion: "163654"
selfLink: /apis/build.knative.dev/v1alpha1/namespaces/default/builds/example-build
uid: dcfc8c4c-71bf-11e9-b521-42010aa4007f
spec:
Status: ""
serviceAccountName: default
steps:
- args:
- echo
- hello-example
- one
image: ubuntu
name: ""
resources: {}
timeout: 10m0s
status:
builder: Cluster
cluster:
namespace: default
podName: example-build-pod-200876
conditions:
- lastTransitionTime: "2019-05-08T18:34:10Z"
status: "True"
type: Succeeded
startTime: "2019-05-08T18:34:07Z"
stepStates:
- terminated:
containerID: containerd://62e441b890dc7f26144b2a2efa5f6bff867bf665342dc0a1a11c7b78f8d0ae80
exitCode: 0
finishedAt: "2019-05-08T18:34:09Z"
reason: Completed
startedAt: "2019-05-08T18:34:09Z"
stepsCompleted:
- build-step-unnamed-0
I found this in the docs https://knative.dev/docs/build/builds/#steps but I don't know if this is outdated or an outlook :D
Expected Behavior
I found in the knative docs the following build example:
The example defines the
steps
multiple times (actually only two times :D), the expected behavior would be that the build is rejected because the Spec is invalid.Actual Behavior
Only one of the two steps will be executed (the step which is defined below, at least in my 3 test runs) and the other one will be ignored. The spec actually seems to be correct: https://github.com/knative/build/blob/v0.5.0/pkg/apis/build/v1alpha1/build_types.go#L69
Steps to Reproduce the Problem
kubectl apply -f ..
Additional Info
I will try to dig into the issue and hopefully I will be able to fix this (mentoring or some hints are welcome :) )