-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change StrategyRef strategy kind default behaviour #657
Comments
Maybe it was done to have a reasonable default ( ask less, do more ).
But, given that folks might be more likely to use ClusterBuildStrategy (
general feeling ), we may go for a mandatory field in there?
…On Thu, Mar 11, 2021, 09:58 Matthias Diester ***@***.***> wrote:
While working on a PR, it was that @qu1queee <https://github.com/qu1queee>
and I were wondering why the BuildStrategyKind is a pointer
<https://github.com/shipwright-io/build/blob/f5ddd1e70eefe779f6be7b7fe826107fddf4baf1/pkg/apis/build/v1alpha1/buildstrategy.go#L44>,
because this eventually leads to nil checks and the implicit internal
contract that nil means namespace based build strategy.
*Idea:* Make the Kind mandatory as in making it not a pointer in the
spec. We would force end-users to explicitly decide whether it is a
ClusterBuildStrategy or a (namespace) BuildStrategy, which I think makes
sense to force that decision at this point. Side effect is fewer lines of
code when it comes to verify the field.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#657>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEFEAGJZTOGNZXL6V5I3CTTDDK7JANCNFSM4ZAN2YQA>
.
|
It seems reasonable to me to have a default, rather than making users specify every time. In Tekton, we assume a In Tekton we've recently sort of shied away from adding more cluster-scoped types, since they can make it hard to upgrade clusters -- all users get the new behavior all at once, which can cause problems. Over time we might get rid of I'd personally vote for the default to be the namespaced BuildStrategy, then fallback to the cluster-scoped one. This also makes it easier to remove the cluster-scoped version in the future, if we decide we want to. |
Yes, I also agree to have a default value. Right now, we don't have webhook, so it has to be done in the controller logic. Also FYI, this is the initial discussion about this pointer logic: (Just one year ago, |
Worth pointing out that we can have a default value and a non-nillable Tekton does this for timeouts today IIRC, with |
Yes, if we want to introduce the webhook, it is easier. But as discussed before, we didn't plan to use webhook at the beginning, so we set default in the controller logic. :) |
When a Build do not specify an strategy Kind, ensure we default to a namespaced scope one. This logic was already in placed, a previous commit removed and this commit added it again in a different function. Also, it should fix shipwright-io#657
When a Build do not specify an strategy Kind, ensure we default to a namespaced scope one. This logic was already in placed, a previous commit removed and this commit added it again in a different function. Also, it should fix shipwright-io#657
When a Build do not specify an strategy Kind, ensure we default to a namespaced scope one. This logic was already in placed, a previous commit removed and this commit added it again in a different function. Also, it should fix shipwright-io#657
When a Build do not specify an strategy Kind, ensure we default to a namespaced scope one. This logic was already in placed, a previous commit removed and this commit added it again in a different function. Also, it should fix shipwright-io#657
When a Build do not specify an strategy Kind, ensure we default to a namespaced scope one. This logic was already in placed, a previous commit removed and this commit added it again in a different function. Also, it should fix shipwright-io#657
When a Build do not specify an strategy Kind, ensure we default to a namespaced scope one. This logic was already in placed, a previous commit removed and this commit added it again in a different function. Also, it should fix shipwright-io#657
When a Build do not specify an strategy Kind, ensure we default to a namespaced scope one. This logic was already in placed, a previous commit removed and this commit added it again in a different function. Also, it should fix shipwright-io#657
When a Build do not specify an strategy Kind, ensure we default to a namespaced scope one. This logic was already in placed, a previous commit removed and this commit added it again in a different function. Also, it should fix shipwright-io#657
When a Build do not specify an strategy Kind, ensure we default to a namespaced scope one. This logic was already in placed, a previous commit removed and this commit added it again in a different function. Also, it should fix shipwright-io#657
When a Build do not specify an strategy Kind, ensure we default to a namespaced scope one. This logic was already in placed, a previous commit removed and this commit added it again in a different function. Also, it should fix shipwright-io#657
When a Build do not specify an strategy Kind, ensure we default to a namespaced scope one. This logic was already in placed, a previous commit removed and this commit added it again in a different function. Also, it should fix shipwright-io#657
When a Build do not specify an strategy Kind, ensure we default to a namespaced scope one. This logic was already in placed, a previous commit removed and this commit added it again in a different function. Also, it should fix shipwright-io#657
When a Build do not specify an strategy Kind, ensure we default to a namespaced scope one. This logic was already in placed, a previous commit removed and this commit added it again in a different function. Also, it should fix shipwright-io#657
When a Build do not specify an strategy Kind, ensure we default to a namespaced scope one. This logic was already in placed, a previous commit removed and this commit added it again in a different function. Also, it should fix shipwright-io#657
When a Build do not specify an strategy Kind, ensure we default to a namespaced scope one. This logic was already in placed, a previous commit removed and this commit added it again in a different function. Also, it should fix shipwright-io#657
This was tackle via #641, if the |
While working on a PR, it was that @qu1queee and I were wondering why the BuildStrategyKind is a pointer, because this eventually leads to
nil
checks and the implicit internal contract thatnil
means namespace based build strategy.Idea: Make the
Kind
mandatory as in making it not a pointer in the spec. We would force end-users to explicitly decide whether it is aClusterBuildStrategy
or a (namespace)BuildStrategy
, which I think makes sense to force that decision at this point. Side effect is fewer lines of code when it comes to verify the field.The text was updated successfully, but these errors were encountered: