Bug 2043519 - "apps.open-cluster-management.io/git-branch" annotation should be mandatory
Summary: "apps.open-cluster-management.io/git-branch" annotation should be mandatory
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Advanced Cluster Management for Kubernetes
Classification: Red Hat
Component: App Lifecycle
Version: rhacm-2.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: rhacm-2.4.2
Assignee: Xiangjing Li
QA Contact: Rafat Islam
bswope@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-21 12:52 UTC by Eduardo Minguez
Modified: 2022-03-03 07:03 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-03-03 07:02:18 UTC
Target Upstream Version:
Embargoed:
rislam: qe_test_coverage+
bot-tracker-sync: rhacm-2.4.z+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github stolostron backlog issues 19363 0 None None None 2022-01-21 16:19:00 UTC
Red Hat Product Errata RHSA-2022:0735 0 None None None 2022-03-03 07:03:47 UTC

Description Eduardo Minguez 2022-01-21 12:52:22 UTC
Description of the problem:
When creating an application -> subscription using the UI, the git branch field is not mandatory. But it doesn't work if you don't specify one

Release version:
2.4.1

Operator snapshot version:
2.4.1

OCP version:

Browser Info:
Firefox/Chrome/Whatever

Steps to reproduce:
1. Create an application -> subscription
2. Point it to a git repo
3.

Actual results:
The subscription fails with:

'failed to initialize Git connection, err: Failed to get Git clone options with the secondary channel:  err: no secondary channel to try'

Expected results:
To use the default branch

Additional info:
https://github.com/stolostron/multicloud-operators-subscription/blob/main/pkg/utils/gitrepo.go#L569-L578 doesn't seem to set a default branch.

Comment 1 Eduardo Minguez 2022-01-21 13:29:59 UTC
I guess it would be better if instead of an annotation it is a spec on the object itself so it can be enforced.

Comment 2 Roke Jung 2022-01-21 16:43:03 UTC
The backend defaults to master branch if no branch is specified by the user. https://github.com/stolostron/multicloud-operators-subscription/blob/38971b8046fd763ba9b14fe7117deab3c6a44adb/pkg/utils/gitrepo.go#L581

This is also documented in 1.4.1.4.1. Subscribing to a specific branch section of https://access.redhat.com/documentation/en-us/red_hat_advanced_cluster_management_for_kubernetes/2.4/html/applications/managing-applications#subscribing-git-resources.

We could make UI display this default master branch.

Comment 3 Eduardo Minguez 2022-01-21 17:00:19 UTC
(In reply to Roke Jung from comment #2)
> The backend defaults to master branch if no branch is specified by the user.
> https://github.com/stolostron/multicloud-operators-subscription/blob/
> 38971b8046fd763ba9b14fe7117deab3c6a44adb/pkg/utils/gitrepo.go#L581
> 
> This is also documented in 1.4.1.4.1. Subscribing to a specific branch
> section of
> https://access.redhat.com/documentation/en-us/
> red_hat_advanced_cluster_management_for_kubernetes/2.4/html/applications/
> managing-applications#subscribing-git-resources.
> 
> We could make UI display this default master branch.

+1 and add a more detailed information about the branch used by default (see attachment for current version)

Comment 5 Roke Jung 2022-01-25 18:19:15 UTC
It will be fixed in 2.4.2 so that when Git branch is not provided, the default branch of the repo will be used regardless of the branch name.

Comment 6 Rafat Islam 2022-02-23 14:57:31 UTC
Shouldnt this be moved to ON QA or errate stage since the fix has been pushed to 2.4.2?

Comment 7 juhsu 2022-02-23 22:37:36 UTC
CICD mentioned the state can be MODIFIED or VERIFIED to pick up the ERRATA properly.

Comment 8 bot-tracker-sync 2022-02-23 23:17:15 UTC
G2Bsync 1048867667 comment 
 rafat-islam1 Wed, 23 Feb 2022 14:54:26 UTC 
 G2Bsync Verified in 2.4.2 RC3. I was able to deploy an app without mentioning the branch and only mentioning the path to the application yaml. The application was successfully deployed

Tested on : Azure with OCP 4.9 and ACM 2.4.2 RC3

Comment 14 errata-xmlrpc 2022-03-03 07:02:18 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Red Hat Advanced Cluster Management 2.4.2 security updates and bug fixes), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:0735


Note You need to log in before you can comment on or make changes to this bug.