Bug 2069622 - No validation for policy template's name
Summary: No validation for policy template's name
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Advanced Cluster Management for Kubernetes
Classification: Red Hat
Component: Console
Version: rhacm-2.5
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: rhacm-2.5
Assignee: Kevin Cormier
QA Contact: Xiang Yin
Christopher Dawson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-03-29 09:36 UTC by yahliu
Modified: 2023-06-07 23:25 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-06-09 02:10:11 UTC
Target Upstream Version:
Embargoed:
bot-tracker-sync: rhacm-2.5+


Attachments (Terms of Use)
invalid-template (40.65 KB, image/png)
2022-03-29 09:36 UTC, yahliu
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github stolostron backlog issues 21231 0 None None None 2022-03-29 13:08:47 UTC
Red Hat Product Errata RHSA-2022:4956 0 None None None 2022-06-09 02:10:19 UTC

Description yahliu 2022-03-29 09:36:49 UTC
Created attachment 1868933 [details]
invalid-template

Description of problem:
When typing the name policy-scc-[ID] in the creation policy wizard, the policy can be created successfully, but no status for this policy.

Version-Release number of selected component (if applicable):
0323 DS build

How reproducible:


Steps to Reproduce:
1. Create policy using policy wizard
2. check this policy


Actual results:
The policy can be created but no status 

Expected results:
Should break the policy creating if set invalid policy template name 

Additional info:

Comment 1 bot-tracker-sync 2022-04-05 03:50:31 UTC
G2Bsync 1088171574 comment 
 RobDolares Tue, 05 Apr 2022 01:11:07 UTC 
 `G2BSync` Fix has been merged - Please verify and close.

Comment 3 yahliu 2022-04-11 09:44:55 UTC
Retested failed 2.5.0-DOWNSTREAM-2022-04-08-01-51-11. see 0408-retest attachment file.

```
2022-04-11T09:39:40.097Z	error	policy-template-sync	controller/controller.go:114	Failed to create the policy template	{"Request.Namespace": "local-cluster", "Request.Name": "default.retest-1", "PolicyTemplateName": "policy-namespace-[ID]", "error": "ConfigurationPolicy.policy.open-cluster-management.io \"policy-namespace-[ID]\" is invalid: metadata.name: Invalid value: \"policy-namespace-[ID]\": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')"}
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile
	/remote-source/deps/gomod/pkg/mod/sigs.k8s.io/controller-runtime.1/pkg/internal/controller/controller.go:114
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
	/remote-source/deps/gomod/pkg/mod/sigs.k8s.io/controller-runtime.1/pkg/internal/controller/controller.go:311
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
	/remote-source/deps/gomod/pkg/mod/sigs.k8s.io/controller-runtime.1/pkg/internal/controller/controller.go:266
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
	/remote-source/deps/gomod/pkg/mod/sigs.k8s.io/controller-runtime.1/pkg/internal/controller/controller.go:227
```

Comment 4 bot-tracker-sync 2022-04-13 17:12:54 UTC
G2Bsync 1098244901 comment 
 RobDolares Wed, 13 Apr 2022 16:19:46 UTC 
 `G2Bsync` Additional validation added to wizard - please verify and close

Verified with snapshot: `2.5.0-SNAPSHOT-2022-04-12-21-04-43`:

<kbd>![Screen Shot 2022-04-13 at 12 04 30 PM](https://user-images.githubusercontent.com/10394596/163225365-f25f6ecd-73e9-4aa2-b183-dae4743606a9.png)</kbd>
<kbd>![Screen Shot 2022-04-13 at 12 03 31 PM](https://user-images.githubusercontent.com/10394596/163225413-9b28d844-125e-48a2-be22-44284e5b611a.png)</kbd>

Comment 5 yahliu 2022-04-20 07:29:42 UTC
Verified on 2.5.0-DOWNSTREAM-2022-04-18-17-36-04.

Comment 9 errata-xmlrpc 2022-06-09 02:10:11 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.5 security updates, images, 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:4956

Comment 10 Eboni Booker 2023-02-11 10:34:16 UTC Comment hidden (spam)

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