Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 2053751

Summary: ztp-site-generate container is missing convenience entrypoint
Product: OpenShift Container Platform Reporter: Ian Miller <imiller>
Component: Telco EdgeAssignee: Jim Ramsay <jramsay>
Telco Edge sub component: ZTP QA Contact: yliu1
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: high CC: jramsay
Version: 4.10   
Target Milestone: ---   
Target Release: 4.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-10 16:44:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ian Miller 2022-02-11 22:33:22 UTC
Description of problem: The ztp-site-generate container should have /usr/bin/entrypoints available as a convenience for the user. This file is missing 

# find / -name "*entrypoin*"                                                                             
/tmp/ztp-temp/ztp/resource-generator/entrypoints  
/tmp/ztp-temp/ztp/resource-generator/entrypoints/entrypoints
/usr/lib/python3.9/site-packages/pip/_internal/utils/entrypoints.py
/usr/lib/python3.9/site-packages/pip/_internal/utils/__pycache__/entrypoints.cpython-39.opt-1.pyc
/usr/lib/python3.9/site-packages/pip/_internal/utils/__pycache__/entrypoints.cpython-39.pyc
find: ‘/proc/tty/driver’: Permission denied        


Version-Release number of selected component (if applicable): openshift4-ztp-site-generate:v4.10.0-27

How reproducible: Always


Steps to Reproduce:
1. See find command above

Actual results: see above


Expected results: /usr/bin/entrypoints exists


Additional info: There are sub-commands which go along with the entrypoint that also need to be available.

Comment 5 yliu1 2022-02-22 19:55:11 UTC
Verified with latest 4.10 image. 

[kni@ran-vcl01-installer ~]$ podman run -it registry.ran-vcl01.ptp.lab.eng.bos.redhat.com:5000/ztp/ztp-site-generator:4.10 cat /usr/bin/entrypoints
#!/bin/bash
cat <<EOF
ztp-site-generator container help
=================================

This container is the primary distribution mechanism for the Red Hat
Zero Touch Provisioning (ztp) solution.

The main container entrypoints are:

template and example distribution
---------------------------------

/home/ztp
  ├── argocd
  │   ├── deployment
  │   │   - Yaml files that configure the hub cluster and ArgoCD with our kustomize plugins
  │   └── example
  │       ├── policygentemplates
  │       │   - Example PolicyGenTemplate files for all supported DU configurations
  │       └── siteconfig
  │           - Example SiteConfig files for all supported cluster types
  ├── extra-manifest
  │   - The set of extra manifests that are applied at day-0 by SiteConfig
  └── source-crs
      - The set of CRs that are available to be configured via PolicyGenTemplate

You can export these templates and examples by running the following commands:

    $ podman run --rm ztp-site-generator:latest extract /home/ztp --tar | tar x -C ./out

extract
-------
EOF
extract --help

cat <<EOF

/extractKustomize.sh
-------------------

Used by the ArgoCD deployment patching logic, this entrypoint copies
the kustomize plugins for SiteConfig and PolicyGenTemplate and
aupporting resources into the proper kustomize directory structure.
EOF

[kni@ran-vcl01-installer ~]$ podman run --rm registry.ran-vcl01.ptp.lab.eng.bos.redhat.com:5000/ztp/ztp-site-generator:4.10  extract /home/ztp --tar | tar x -C ./out
[kni@ran-vcl01-installer ~]$ ls out/
argocd  extra-manifest  source-crs


[kni@ran-vcl01-installer ~]$ podman run -it registry.ran-vcl01.ptp.lab.eng.bos.redhat.com:5000/ztp/ztp-site-generator:4.10 ls -la /tmp/ztp-temp/
ls: cannot access '/tmp/ztp-temp/': No such file or directory

Comment 8 errata-xmlrpc 2022-03-10 16:44:04 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 (Moderate: OpenShift Container Platform 4.10.3 security update), 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:0056