RedHat Operator Bundle 인증 프로세스

이 문서는 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 작업은 gl-distribution-oc 리포지토리에 별도 SSH 키가 필요하므로 (1)에서의 키를 사용하는 샘플 래퍼 스크립트(operator_certification.sh)는 다른 로드된 개인 키가 먼저 제안되면 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.

리포지토리 설정

리포지토리 포크

인증된 오퍼레이터 및 마켓플레이스 오퍼레이터에 대한 포크가 이미 생성되었습니다.

참고: 아래의 operator_certification.sh 래퍼 스크립트 사용은 선택 사항입니다.

  1. 로컬로 포크(clone)하기:

    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

변경 사항 복사 및 푸시하여 포크한 리포지토리에 반영

이 단계에서 번들을 새 위치로 복사해야 합니다(fork repository의 값을 참조하세요):

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

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