-
Notifications
You must be signed in to change notification settings - Fork 20
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
trailing zero is removed from channel in subscription #295
Comments
@Ladanow # Source: clustergroup/templates/core/subscriptions.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: {{ $subs.name }}
namespace: {{ . }}
spec:
name: {{ $subs.name }}
source: {{ default "redhat-operators" $subs.source }}
sourceNamespace: {{ default "openshift-marketplace" $subs.sourceNamespace }}
{{- if $subs.channel }}
channel: {{ $subs.channel }}
{{- end }} Proposed fix: @mbaldessariOne solution is to add the # Source: clustergroup/templates/core/subscriptions.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: {{ $subs.name }}
namespace: {{ . }}
spec:
name: {{ $subs.name }}
source: {{ default "redhat-operators" $subs.source }}
sourceNamespace: {{ default "openshift-marketplace" $subs.sourceNamespace }}
{{- if $subs.channel }}
channel: {{ $subs.channel | quote }}
{{- end }} So if you define the subscription in the values file like so: example:
name: example-sub
namespace: example-sub
channel: 4.10 The framework will generate the following: ---
# Source: pattern-clustergroup/templates/core/subscriptions.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: example-sub
namespace: example-sub
spec:
name: example-sub
source: redhat-operators
sourceNamespace: openshift-marketplace
channel: "4.10"
installPlanApproval: Automatic |
I think it is okay to add the
The above gives me the following:
channelquoted is 4.1 and not 4.10. So I suspect the only fix here is to quote it beforehand in the values files? |
@mbaldessari yeah somehow I missed something in my test. I think adding the quote filter does not help here. There are two options:
In our case for string we can do the following: example:
name: example-sub
namespace: example-sub
channel: !!str 4.10
example:
name: example-sub
namespace: example-sub
channel: '4.10' or example:
name: example-sub
namespace: example-sub
channel: "4.10" Result:Either case above will render the following: # Source: pattern-clustergroup/templates/core/subscriptions.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: example-sub
namespace: example-sub
spec:
name: example-sub
source: redhat-operators
sourceNamespace: openshift-marketplace
channel: "4.10"
installPlanApproval: Automatic @Ladanow This is something that we cannot really address in the Validated Pattern framework so you will have to address it in the values-*.yaml file. |
Hi
When we have a channel like 4.10, it is translated into Argo as 4.1
a workaround was set to use "4.10" and it worked.
The text was updated successfully, but these errors were encountered: