On Wed, Mar 27, 2019 at 11:58 AM Andrew Feller <[email protected]>
wrote:

> Using a simple documented BuildConfig
> <https://docs.openshift.com/container-platform/3.11/dev_guide/builds/index.html>,
> we're seeing every newly created BuildConfig resource
> defaulting failedBuildsHistoryLimit and successfulBuildsHistoryLimit when
> documentation specifies BuildConfig not having default values and honoring
> preserving all builds.
>

i'm assuming you're basing your statement on the api doc:
https://github.com/openshift/api/blob/release-3.11/build/v1/types.go#L904

(if you saw it somewhere else, please let us know).

Unfortunately that doc is wrong...  when we moved from legacy resource
types to grouped resource types, we introduced a default retention of 5 for
each type(successful and failed).  If you created a buildconfig via the
legacy resource you got no limit, but if you create it via the grouped
resource (which is the default and what everyone should be doing now), you
got a default of 5 applied to your object.  If you look at the
buildconfig.yaml (oc get bc/foo -o yaml) you will see that value appear
because it's actually applied to your object during creation.

you can edit the bc and delete the field to switch to no retention, or you
can create your BCs with a very high retention.  I don't think you can
actually create a BC w/ no retention limit, though, given how the system
works.





>
> My knee jerk thought was to talk with my OCP administrators to see whether
> nodes were configured to default aspects of specific resource types,
> however we didn't see anything readily within master-config.yaml file on
> one of the masters.
>
> Any assistance is appreciated!
>
>
>> me@me-mbp ~ $ oc version
>
> oc v3.11.0+0cbc58b
>
> kubernetes v1.11.0+d4cacc0
>
> features: Basic-Auth
>
>
>> Server ...
>
> openshift v3.11.43
>
> kubernetes v1.11.0+d4cacc0
>
>
>
> me@me-mbp ~ $ oc new-project ruby-sample
>
>
>> me@me-mbp ~ $ cat << EOF | oc apply -f - -n ruby-sample
>> > kind: "BuildConfig"
>> > apiVersion: "v1"
>> > metadata:
>> >   name: "ruby-sample-build"
>> > spec:
>> >   runPolicy: "Serial"
>> >   triggers: []
>> >   source:
>> >     git:
>> >       uri: "https://github.com/openshift/ruby-hello-world";
>> >   strategy:
>> >     sourceStrategy:
>> >       from:
>> >         kind: "ImageStreamTag"
>> >         name: "ruby-20-centos7:latest"
>> > EOF
>> buildconfig.build.openshift.io/ruby-sample-build created
>
>
>> me@me-mbp ~ $ oc get -o yaml bc ruby-sample-build
>> apiVersion: build.openshift.io/v1
>> kind: BuildConfig
>> metadata:
>>   annotations:
>>     kubectl.kubernetes.io/last-applied-configuration: |
>>       {"apiVersion":"build.openshift.io/v1
>> ","kind":"BuildConfig","metadata":{"annotations":{},"name":"ruby-sample-build","namespace":"ruby-sample"},"spec":{"runPolicy":"Serial","source":{"git":{"uri":"
>> https://github.com/openshift/ruby-hello-world
>> "}},"strategy":{"sourceStrategy":{"from":{"kind":"ImageStreamTag","name":"ruby-20-centos7:latest"}}},"triggers":[]}}
>>   creationTimestamp: 2019-03-27T15:49:28Z
>>   name: ruby-sample-build
>>   namespace: ruby-sample
>>   resourceVersion: "268668901"
>>   selfLink: /apis/
>> build.openshift.io/v1/namespaces/ruby-sample/buildconfigs/ruby-sample-build
>>   uid: e7a55eaa-50a7-11e9-982c-001a4aa86606
>> spec:
>>   failedBuildsHistoryLimit: 5
>>   nodeSelector: null
>>   output: {}
>>   postCommit: {}
>>   resources: {}
>>   runPolicy: Serial
>>   source:
>>     git:
>>       uri: https://github.com/openshift/ruby-hello-world
>>     type: Git
>>   strategy:
>>     sourceStrategy:
>>       from:
>>         kind: ImageStreamTag
>>         name: ruby-20-centos7:latest
>>     type: Source
>>   successfulBuildsHistoryLimit: 5
>>   triggers: []
>> status:
>>   lastVersion: 0
>
>
>
> --
>
> [image: BandwidthMaroon.png]
>
> Andy Feller  •  Sr DevOps Engineer
>
> 900 Main Campus Drive, Suite 500, Raleigh, NC 27606
>
>
> e: [email protected]
> _______________________________________________
> users mailing list
> [email protected]
> http://lists.openshift.redhat.com/openshiftmm/listinfo/users
>


-- 
Ben Parees | OpenShift
_______________________________________________
users mailing list
[email protected]
http://lists.openshift.redhat.com/openshiftmm/listinfo/users

Reply via email to