Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(RELEASE-1243): make create advisory task idempotent #817

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

happybhati
Copy link
Contributor

@happybhati happybhati commented Feb 11, 2025

Describe your changes

Relevant Jira

Checklist before requesting a review

  • I have marked as draft or added do not merge label if there's a dependency PR
    • If you want reviews on your draft PR, you can add reviewers or add the release-service-maintainers handle if you are unsure who to tag
  • My commit message includes Signed-off-by: My name <email>
  • I have bumped the task/pipeline version string and updated changelog in the relevant README
  • I read CONTRIBUTING.MD and commit formatting

Copy link

openshift-ci bot commented Feb 11, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@happybhati happybhati force-pushed the release-1243 branch 26 times, most recently from ad3378b to 46960e2 Compare February 14, 2025 19:49
@happybhati happybhati marked this pull request as ready for review February 14, 2025 19:50
@happybhati happybhati requested a review from a team as a code owner February 14, 2025 19:50
@happybhati
Copy link
Contributor Author

/retest

2 similar comments
@happybhati
Copy link
Contributor Author

/retest

@happybhati
Copy link
Contributor Author

/retest

Copy link
Collaborator

@johnbieren johnbieren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks close, but I think it is missing something. Take this scenario for example:
already published advisory:

  content:
    images:
    - containerImage: foo@sha256:sha2
      tags:
      - 1.0.0

new advisory_json contains

  content:
    images:
    - containerImage: foo@sha256:sha2
      tags:
      - 1.0.0
    - containerImage: bar@sha256:sha
      tags:
      - 1.0.0

In this case,

    - containerImage: bar@sha256:sha
      tags:
      - 1.0.0

should be published in a new advisory. That is to say, the entry that already exists with containerImage and tags matching is dropped, but there is still new stuff so an advisory has to be filed, just with less

SHIP_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
YEAR=${SHIP_DATE%%-*} # derive the year from the ship date
# Define advisory directory
ADVISORY_BASE_DIR="advisories/data/advisories/$(params.origin)/${YEAR}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm I think even if it was released last year, we shouldn't again, so maybe drop $YEAR here?

Copy link
Contributor Author

@happybhati happybhati Feb 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, on a side note

I am just wondering if we want to add any limit on existing advisory checks? Like the last 10 or 20? because I'm just thinking if some product has 100s of advisories, it will go through each to find if it is duplicate or not, and this will repeat for each containerImage.

What do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a fair point. I think because you narrow it down to the params.origin, it won't be too bad, but it could still happen eventually. Maybe don't add a limit here beyond origin, but then create a followup jira to add a limit and we can discuss it as a team in refinement?

@happybhati
Copy link
Contributor Author

This looks close, but I think it is missing something. Take this scenario for example: already published advisory:

  content:
    images:
    - containerImage: foo@sha256:sha2
      tags:
      - 1.0.0

new advisory_json contains

  content:
    images:
    - containerImage: foo@sha256:sha2
      tags:
      - 1.0.0
    - containerImage: bar@sha256:sha
      tags:
      - 1.0.0

In this case,

    - containerImage: bar@sha256:sha
      tags:
      - 1.0.0

should be published in a new advisory. That is to say, the entry that already exists with containerImage and tags matching is dropped, but there is still new stuff so an advisory has to be filed, just with less

Thanks @johnbieren for explaining the use case. I am working on fixing and testing it, and I will ping you once it is ready for review.

@konflux-ci-qe-bot
Copy link

@happybhati: The following test has Failed, say /retest to rerun failed tests.

PipelineRun Name Status Rerun command Build Log Test Log
konflux-e2e-tests-catalog-54j8h Failed /retest View Pipeline Log View Test Logs

Inspecting Test Artifacts

To inspect your test artifacts, follow these steps:

  1. Install ORAS (see the ORAS installation guide).
  2. Download artifacts with the following commands:
mkdir -p oras-artifacts
cd oras-artifacts
oras pull quay.io/konflux-test-storage/konflux-team/release-service-catalog:konflux-e2e-tests-catalog-54j8h

Test results analysis

🚨 Failed to provision a cluster, see the log for more details:

Click to view logs
INFO: Log in to your Red Hat account...
INFO: Configure AWS Credentials...
WARN: The current version (1.2.47) is not up to date with latest rosa cli released version (1.2.50).
WARN: It is recommended that you update to the latest version.
INFO: Logged in as 'konflux-ci-418295695583' on 'https://api.openshift.com'
INFO: Create ROSA with HCP cluster...
WARN: The current version (1.2.47) is not up to date with latest rosa cli released version (1.2.50).
WARN: It is recommended that you update to the latest version.
INFO: Creating cluster 'kx-0abd115d2b'
INFO: To view a list of clusters and their status, run 'rosa list clusters'
INFO: Cluster 'kx-0abd115d2b' has been created.
INFO: Once the cluster is installed you will need to add an Identity Provider before you can login into the cluster. See 'rosa create idp --help' for more information.

Name: kx-0abd115d2b
Domain Prefix: kx-0abd115d2b
Display Name: kx-0abd115d2b
ID: 2h1grgnv4ogedc42157agbp8dtmjlg41
External ID: b7f8726c-6bfd-4345-8118-8357fc90124f
Control Plane: ROSA Service Hosted
OpenShift Version: 4.15.44
Channel Group: stable
DNS: Not ready
AWS Account: 418295695583
AWS Billing Account: 418295695583
API URL:
Console URL:
Region: us-east-1
Availability:

  • Control Plane: MultiAZ
  • Data Plane: SingleAZ

Nodes:

  • Compute (desired): 3
  • Compute (current): 0
    Network:
  • Type: OVNKubernetes
  • Service CIDR: 172.30.0.0/16
  • Machine CIDR: 10.0.0.0/16
  • Pod CIDR: 10.128.0.0/14
  • Host Prefix: /23
  • Subnets: subnet-05b9daa0609597f68, subnet-04cf6376374bf9e09
    EC2 Metadata Http Tokens: optional
    Role (STS) ARN: arn:aws:iam::418295695583:role/ManagedOpenShift-HCP-ROSA-Installer-Role
    Support Role ARN: arn:aws:iam::418295695583:role/ManagedOpenShift-HCP-ROSA-Support-Role
    Instance IAM Roles:
  • Worker: arn:aws:iam::418295695583:role/ManagedOpenShift-HCP-ROSA-Worker-Role
    Operator IAM Roles:
  • arn:aws:iam::418295695583:role/rosa-hcp-openshift-cloud-network-config-controller-cloud-credent
  • arn:aws:iam::418295695583:role/rosa-hcp-kube-system-kube-controller-manager
  • arn:aws:iam::418295695583:role/rosa-hcp-kube-system-capa-controller-manager
  • arn:aws:iam::418295695583:role/rosa-hcp-kube-system-control-plane-operator
  • arn:aws:iam::418295695583:role/rosa-hcp-kube-system-kms-provider
  • arn:aws:iam::418295695583:role/rosa-hcp-openshift-image-registry-installer-cloud-credentials
  • arn:aws:iam::418295695583:role/rosa-hcp-openshift-ingress-operator-cloud-credentials
  • arn:aws:iam::418295695583:role/rosa-hcp-openshift-cluster-csi-drivers-ebs-cloud-credentials
    Managed Policies: Yes
    State: waiting (Waiting for user action)
    Private: No
    Delete Protection: Disabled
    Created: Feb 19 2025 04:19:20 UTC
    User Workload Monitoring: Enabled
    Details Page: https://console.redhat.com/openshift/details/s/2tFD7Pylmc2Domg114K1H2lOhUM
    OIDC Endpoint URL: https://oidc.op1.openshiftapps.com/2du11g36ejmoo4624pofphlrgf4r9tf3 (Managed)
    Etcd Encryption: Disabled
    Audit Log Forwarding: Disabled
    External Authentication: Disabled
    Zero Egress: Disabled

INFO: Preparing to create operator roles.
INFO: Operator Roles already exists
INFO: Preparing to create OIDC Provider.
INFO: OIDC provider already exists
INFO: To determine when your cluster is Ready, run 'rosa describe cluster -c kx-0abd115d2b'.
INFO: To watch your cluster installation logs, run 'rosa logs install -c kx-0abd115d2b --watch'.
INFO: Track the progress of the cluster creation...
WARN: The current version (1.2.47) is not up to date with latest rosa cli released version (1.2.50).
WARN: It is recommended that you update to the latest version.
�[0;33mW:�[m Region flag will be removed from this command in future versions
INFO: Cluster 'kx-0abd115d2b' is in waiting state waiting for installation to begin. Logs will show up within 5 minutes
0001-01-01 00:00:00 +0000 UTC hostedclusters kx-0abd115d2b Version
2025-02-19 04:24:18 +0000 UTC hostedclusters kx-0abd115d2b ValidAWSIdentityProvider StatusUnknown
2025-02-19 04:24:28 +0000 UTC hostedclusters kx-0abd115d2b Condition not found in the CVO.
2025-02-19 04:24:28 +0000 UTC hostedclusters kx-0abd115d2b Condition not found in the CVO.
2025-02-19 04:24:28 +0000 UTC hostedclusters kx-0abd115d2b The hosted control plane is not found
2025-02-19 04:24:28 +0000 UTC hostedclusters kx-0abd115d2b The hosted control plane is not found
2025-02-19 04:24:28 +0000 UTC hostedclusters kx-0abd115d2b The hosted control plane is not found
2025-02-19 04:24:28 +0000 UTC hostedclusters kx-0abd115d2b The hosted control plane is not found
2025-02-19 04:24:28 +0000 UTC hostedclusters kx-0abd115d2b The hosted control plane is not found
2025-02-19 04:24:28 +0000 UTC hostedclusters kx-0abd115d2b Condition not found in the CVO.
2025-02-19 04:24:28 +0000 UTC hostedclusters kx-0abd115d2b Waiting for hosted control plane to be healthy
2025-02-19 04:24:28 +0000 UTC hostedclusters kx-0abd115d2b Condition not found in the CVO.
2025-02-19 04:24:28 +0000 UTC hostedclusters kx-0abd115d2b Condition not found in the CVO.
2025-02-19 04:24:28 +0000 UTC hostedclusters kx-0abd115d2b The hosted control plane is not found
2025-02-19 04:24:28 +0000 UTC hostedclusters kx-0abd115d2b Ignition server deployment not found
2025-02-19 04:24:28 +0000 UTC hostedclusters kx-0abd115d2b Configuration passes validation
2025-02-19 04:24:28 +0000 UTC hostedclusters kx-0abd115d2b HostedCluster is supported by operator configuration
2025-02-19 04:24:28 +0000 UTC hostedclusters kx-0abd115d2b Release image is valid
2025-02-19 04:24:28 +0000 UTC hostedclusters kx-0abd115d2b The hosted control plane is not found
2025-02-19 04:24:28 +0000 UTC hostedclusters kx-0abd115d2b HostedCluster is at expected version
2025-02-19 04:24:28 +0000 UTC hostedclusters kx-0abd115d2b Reconciliation active on resource
2025-02-19 04:24:29 +0000 UTC hostedclusters kx-0abd115d2b failed to get referenced secret ocm-production-2h1grgnv4ogedc42157agbp8dtmjlg41/cluster-api-cert: Secret "cluster-api-cert" not found
2025-02-19 04:24:29 +0000 UTC hostedclusters kx-0abd115d2b Required platform credentials are found
2025-02-19 04:25:55 +0000 UTC hostedclusters kx-0abd115d2b OIDC configuration is valid
2025-02-19 04:25:55 +0000 UTC hostedclusters kx-0abd115d2b Reconciliation completed successfully
2025-02-19 04:25:56 +0000 UTC hostedclusters kx-0abd115d2b WebIdentityErr
2025-02-19 04:26:00 +0000 UTC hostedclusters kx-0abd115d2b All is well
2025-02-19 04:26:00 +0000 UTC hostedclusters kx-0abd115d2b lookup api.kx-0abd115d2b.xera.p3.openshiftapps.com on 172.30.0.10:53: no such host
2025-02-19 04:26:00 +0000 UTC hostedclusters kx-0abd115d2b capi-provider deployment has 1 unavailable replicas
2025-02-19 04:26:00 +0000 UTC hostedclusters kx-0abd115d2b Configuration passes validation
2025-02-19 04:26:00 +0000 UTC hostedclusters kx-0abd115d2b AWS KMS is not configured
2025-02-19 04:26:00 +0000 UTC hostedclusters kx-0abd115d2b EtcdAvailable StatefulSetNotFound
2025-02-19 04:26:00 +0000 UTC hostedclusters kx-0abd115d2b Kube APIServer deployment not found
2025-02-19 04:26:15 +0000 UTC hostedclusters kx-0abd115d2b All is well
2025-02-19 04:27:02 +0000 UTC hostedclusters kx-0abd115d2b EtcdAvailable QuorumAvailable
2025-02-19 04:28:16 +0000 UTC hostedclusters kx-0abd115d2b Kube APIServer deployment is available
2025-02-19 04:28:17 +0000 UTC hostedclusters kx-0abd115d2b All is well
2025-02-19 04:28:48 +0000 UTC hostedclusters kx-0abd115d2b oauth-openshift deployment has 2 unavailable replicas
0001-01-01 00:00:00 +0000 UTC hostedclusters kx-0abd115d2b Version
2025-02-19 04:24:28 +0000 UTC hostedclusters kx-0abd115d2b Configuration passes validation
2025-02-19 04:24:28 +0000 UTC hostedclusters kx-0abd115d2b HostedCluster is at expected version
2025-02-19 04:24:28 +0000 UTC hostedclusters kx-0abd115d2b Reconciliation active on resource
2025-02-19 04:24:28 +0000 UTC hostedclusters kx-0abd115d2b Release image is valid
2025-02-19 04:24:28 +0000 UTC hostedclusters kx-0abd115d2b HostedCluster is supported by operator configuration
2025-02-19 04:24:29 +0000 UTC hostedclusters kx-0abd115d2b Required platform credentials are found
2025-02-19 04:25:55 +0000 UTC hostedclusters kx-0abd115d2b Reconciliation completed successfully
2025-02-19 04:25:55 +0000 UTC hostedclusters kx-0abd115d2b OIDC configuration is valid
2025-02-19 04:26:00 +0000 UTC hostedclusters kx-0abd115d2b Configuration passes validation
2025-02-19 04:26:00 +0000 UTC hostedclusters kx-0abd115d2b AWS KMS is not configured
2025-02-19 04:26:00 +0000 UTC hostedclusters kx-0abd115d2b All is well
2025-02-19 04:26:00 +0000 UTC hostedclusters kx-0abd115d2b lookup api.kx-0abd115d2b.xera.p3.openshiftapps.com on 172.30.0.10:53: no such host
2025-02-19 04:26:15 +0000 UTC hostedclusters kx-0abd115d2b All is well
2025-02-19 04:27:02 +0000 UTC hostedclusters kx-0abd115d2b EtcdAvailable QuorumAvailable
2025-02-19 04:28:16 +0000 UTC hostedclusters kx-0abd115d2b Kube APIServer deployment is available
2025-02-19 04:28:17 +0000 UTC hostedclusters kx-0abd115d2b All is well
2025-02-19 04:28:48 +0000 UTC hostedclusters kx-0abd115d2b [hosted-cluster-config-operator deployment has 1 unavailable replicas, ignition-server deployment has 3 unavailable replicas, kube-controller-manager deployment has 1 unavailable replicas, oauth-openshift deployment has 1 unavailable replicas, router deployment has 1 unavailable replicas]
2025-02-19 04:29:11 +0000 UTC hostedclusters kx-0abd115d2b The hosted control plane is available
INFO: Cluster 'kx-0abd115d2b' is now ready
INFO: ROSA with HCP cluster is ready, create a cluster admin account for accessing the cluster
WARN: The current version (1.2.47) is not up to date with latest rosa cli released version (1.2.50).
WARN: It is recommended that you update to the latest version.
INFO: Storing login command...
INFO: Check if it's able to login to OCP cluster...
Retried 1 times...
Retried 2 times...
Retried 3 times...
Retried 4 times...
INFO: Check if apiserver is ready...
[INFO] Checking cluster operators' status...
[INFO] Attempt 1/10
NAME VERSION AVAILABLE PROGRESSING DEGRADED SINCE MESSAGE
console
csi-snapshot-controller 4.15.44 True False False 6m17s
dns 4.15.44 False False True 6m18s DNS "default" is unavailable.
image-registry False True True 5m46s Available: The deployment does not have available replicas...
ingress False True True 5m37s The "default" ingress controller reports Available=False: IngressControllerUnavailable: One or more status conditions indicate unavailable: DeploymentAvailable=False (DeploymentUnavailable: The deployment has Available status condition set to False (reason: MinimumReplicasUnavailable) with message: Deployment does not have minimum availability.)
insights
kube-apiserver 4.15.44 True False False 6m7s
kube-controller-manager 4.15.44 True False False 6m7s
kube-scheduler 4.15.44 True False False 6m7s
kube-storage-version-migrator
monitoring
network 4.15.44 True True False 5m52s DaemonSet "/openshift-multus/network-metrics-daemon" is waiting for other operators to become ready...
node-tuning False True False 5m42s DaemonSet "tuned" has no available Pod(s)
openshift-apiserver 4.15.44 True False False 6m7s
openshift-controller-manager 4.15.44 True False False 6m7s
openshift-samples
operator-lifecycle-manager 4.15.44 True False False 6m9s
operator-lifecycle-manager-catalog 4.15.44 True False False 6m
operator-lifecycle-manager-packageserver 4.15.44 True False False 6m7s
service-ca
storage 4.15.44 False False False 6m7s AWSEBSCSIDriverOperatorCRAvailable: AWSEBSDriverNodeServiceControllerAvailable: Waiting for the DaemonSet to deploy the CSI Node Service
[INFO] Cluster operators are accessible.
[INFO] Waiting for cluster operators to be in 'Progressing=false' state...


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants