RedHat 오퍼레이터 번들 인증 프로세스

이 문서는 RedHat Marketplace를 위한 OLM 번들 제출을 위한 인증 프로세스를 개요로 설명합니다. 이 문서는 Red Hat Software Certification Workflow Guide를 기반으로 합니다.

다음 프로세스는 scripts/tools/publish.sh에서 일부 자동화됩니다. 이 프로세스를 실행하려면 publish.sh ${VERSION} redhat-marketplace을 사용할 수 있습니다. 자세한 내용은 스크립트 문서를 참조하세요.

이 문서 전체에서는 공통 클러스터 인프라 및 공통 GitHub 계정 (gl-distribution-oc)을 사용합니다. 사용자 정의 클러스터/GitHub 계정을 사용해야 하는 경우에는 이에 맞게 조정하세요.

OpenShift 클러스터 프로비저닝

사전 요구 사항

  1. gl-distribution-oc GitHub 계정에 개인 SSH 키가 추가되어 있어야 합니다(${HOME}/.ssh/gldoc_github에 로컬 사본이 있는 경우 참조)
  2. Git 작업에 SSH 키가 별도로 필요한 경우, 샘플 래퍼 스크립트(operator_certification.sh)를 사용하여 (1)에서 키를 사용하는 것이 도움이 될 수 있습니다. 다른 로드된 개인 키가 먼저 제안되는 경우 GitHub에서 연결을 거부할 수 있기 때문입니다:

    #!/bin/sh
    OC_SSH_KEYFILE=${OC_SSH_KEYFILE:-"${HOME}/.ssh/gldoc_github"}
    export GIT_SSH_COMMAND="ssh -i ${OC_SSH_KEYFILE} -o IdentitiesOnly=yes"
    exec $@
    
  3. olm_bundle.sh 사전 요구 사항:
    1. task
    2. yq
    3. opm

환경 설정

클러스터는 배포 파이프라인을 사용하여 배포됩니다. 해당 클러스터의 파이프라인 deploy_cluster 작업에서 artifact를 얻으세요.

VERSION="0.11.0"

# CLUSTER_DIR: "deploy_cluster" 작업의 artifact가 위치한 디렉터리
CLUSTER_DIR=${HOME}/clusters/redhat-certification-ocp49

export TKN=${CLUSTER_DIR}/bin/tkn

# 프로비저닝된 클러스터의 "admin" 수준 kubeconfig 사용
export KUBECONFIG=${CLUSTER_DIR}/auth/kubeconfig

export GIT_USERNAME="gl-distribution-oc"

# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# 아래 이메일은 우리의 임시 해결책이므로 https://gitlab.com/gitlab-org/distribution/team-tasks/-/issues/1097 및
# https://gitlab.com/gitlab-org/distribution/team-tasks/-/issues/1082가 해결될 때까지 그대로 사용하십시오
export GIT_EMAIL="dmakovey+operator-certification@gitlab.com"
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

export GIT_FORK_REPO_URL="git@github.com:gl-distribution-oc/certified-operators.git"
export GIT_BRANCH="gitlab-operator-kubernetes-${VERSION}"

export OPERATOR_BUNDLE_PATH="operators/gitlab-operator-kubernetes/${VERSION}"

위의 셸 코드를 환경 파일(my.env 등)로 저장하고 필요한 곳에서 소스로드하는 것이 편리할 수 있습니다: source /path/to/my.env.

리포지터리 설정

리포지터리 포크

인증된 및 마켓플레이스 오퍼레이터의 포크는 이미 생성되어 있습니다:

note
아래의 operator_certification.sh 래퍼 스크립트 사용은 선택 사항입니다.
  1. 로컬로 포크 복제:

    pushd ${HOME}
    operator_certification.sh git clone git@github.com:gl-distribution-oc/certified-operators.git
    
  2. 포크의 main 브랜치를 최신 상태로 가져오기:

    git remote add upstream git@github.com:redhat-openshift-ecosystem/certified-operators.git
    git rebase -i upstream/main
    operator_certification.sh git push
    
  3. 릴리스용 새 브랜치 생성:

    git checkout -b gitlab-operator-kubernetes-${VERSION}
    CATALOG_REPO_CLONE=${HOME}/certified-operators
    
  4. gitlab-operator 로컬 디렉터리로 돌아가기:

    popd
    

번들 생성

OSDK_BASE_DIR=".build/cert" \
    DOCKER="podman" \
    OLM_PACKAGE_VERSION=${VERSION} \
    OPERATOR_TAG=${VERSION} \
    scripts/olm_bundle.sh build_manifests generate_bundle patch_bundle

제출용 번들 올바르게 주석 처리

BUNDLE_DIR=.build/cert/bundle \
    redhat/operator-certification/scripts/configure_bundle.sh adjust_annotations adjust_csv

변경 내용 복사 및 푸시

이 시점에서 번들을 새 위치로 복사해야 합니다 (forked repository에서 CATALOG_REPO_CLONE의 값을 검색하십시오):

cp -r .build/cert/bundle ${CATALOG_REPO_CLONE}/operators/gitlab-operator-kubernetes/${VERSION}
( cd ${CATALOG_REPO_CLONE} && git add operators/gitlab-operator-kubernetes/${VERSION} \
   && git commit -am "Add gitlab-operator-${VERSION}" \
   && operator_certification.sh git push origin gitlab-operator-kubernetes-${VERSION})

인증 파이프라인 실행

GitHub 사용자 이름 및 이메일은 이 단계에서 가져와야 하며 GIT_USERNAMEGIT_EMAIL에 사용해야 합니다.

OCP에서 적절한 프로젝트로 전환:

redhat/operator-certification/scripts/operator_certification_pipeline.sh \
  set_project

작업 공간 템플릿 생성:

redhat/operator-certification/scripts/operator_certification_pipeline.sh \
  create_workspace_template

그런 다음 파이프라인 실행:

redhat/operator-certification/scripts/operator_certification_pipeline.sh \
  run_certification_pipeline_automated

이렇게 하면 upstream PR이 생성되고 RedHat 포털에 제출이 열립니다.