Skip to content

MGMT-17478: Use ICC config secret for converged flow info when available - #6533

Merged
openshift-merge-bot[bot] merged 9 commits into
openshift:masterfrom
adriengentil:icc-agent-secret
Jul 12, 2024
Merged

openshift-merge-bot[bot] merged 9 commits into
openshift:masterfrom
adriengentil:icc-agent-secret

Conversation

@adriengentil

@adriengentil adriengentil commented Jul 4, 2024 •

Copy link
Copy Markdown
Contributor

When available, read the ICC secret set by BMO in order to retrieve the
agent image, the agent URL(s), and the inspector URL(s).

This this change, we wil try to:
1/ Get the agent image from the user override
2/ if 1/ is not found, get the image from the ICC configuration
3/ if 2/ is not found, get the image from the HUB cluster
4/ if 3/ is not found, return the default image

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 4, 2024
@openshift-ci-robot

openshift-ci-robot commented Jul 4, 2024 •

Copy link
Copy Markdown

@adriengentil: This pull request references MGMT-17478 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.17.0" version, but no target version was set.

Details

In response to this:

When available, read the ICC secret set by BMO in order to retrieve the
agent image, the agent URL(s), and the inspector URL(s).

This this change, we wil try to:
1/ Get the agent image from the user override
2/ if 1/ is not found, get the image from the ICC configuration
3/ if 2/ is not found, get the image from the HUB cluster
4/ if 3/ is not found, return the default image

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 4, 2024
@openshift-ci

openshift-ci Bot commented Jul 4, 2024

Copy link
Copy Markdown
Contributor

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

@openshift-ci openshift-ci Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 4, 2024
@adriengentil

Copy link
Copy Markdown
Contributor Author

/test ?

@openshift-ci

openshift-ci Bot commented Jul 4, 2024

Copy link
Copy Markdown
Contributor

@adriengentil: The following commands are available to trigger required jobs:

  • /test e2e-agent-compact-ipv4
  • /test edge-assisted-operator-catalog-publish-verify
  • /test edge-ci-index
  • /test edge-e2e-ai-operator-ztp
  • /test edge-e2e-ai-operator-ztp-sno-day2-workers
  • /test edge-e2e-ai-operator-ztp-sno-day2-workers-late-binding
  • /test edge-e2e-metal-assisted
  • /test edge-e2e-metal-assisted-4-11
  • /test edge-e2e-metal-assisted-4-12
  • /test edge-e2e-metal-assisted-cnv
  • /test edge-e2e-metal-assisted-lvm
  • /test edge-e2e-metal-assisted-odf
  • /test edge-images
  • /test edge-lint
  • /test edge-subsystem-aws
  • /test edge-subsystem-kubeapi-aws
  • /test edge-unit-test
  • /test edge-verify-generated-code
  • /test images
  • /test mce-images

The following commands are available to trigger optional jobs:

  • /test e2e-agent-ha-dualstack
  • /test e2e-agent-sno-ipv6
  • /test edge-e2e-ai-operator-disconnected-capi
  • /test edge-e2e-ai-operator-ztp-3masters
  • /test edge-e2e-ai-operator-ztp-capi
  • /test edge-e2e-ai-operator-ztp-compact-day2-masters
  • /test edge-e2e-ai-operator-ztp-compact-day2-workers
  • /test edge-e2e-ai-operator-ztp-disconnected
  • /test edge-e2e-ai-operator-ztp-hypershift-zero-nodes
  • /test edge-e2e-ai-operator-ztp-multiarch-3masters-ocp
  • /test edge-e2e-ai-operator-ztp-multiarch-sno-ocp
  • /test edge-e2e-ai-operator-ztp-node-labels
  • /test edge-e2e-ai-operator-ztp-sno-day2-masters
  • /test edge-e2e-ai-operator-ztp-sno-day2-workers-ignitionoverride
  • /test edge-e2e-metal-assisted-4-13
  • /test edge-e2e-metal-assisted-4-14
  • /test edge-e2e-metal-assisted-4-15
  • /test edge-e2e-metal-assisted-bond
  • /test edge-e2e-metal-assisted-bond-4-14
  • /test edge-e2e-metal-assisted-day2
  • /test edge-e2e-metal-assisted-day2-arm-workers
  • /test edge-e2e-metal-assisted-day2-single-node
  • /test edge-e2e-metal-assisted-external
  • /test edge-e2e-metal-assisted-external-4-14
  • /test edge-e2e-metal-assisted-ipv4v6
  • /test edge-e2e-metal-assisted-ipv6
  • /test edge-e2e-metal-assisted-kube-api-late-binding-single-node
  • /test edge-e2e-metal-assisted-kube-api-late-unbinding-ipv4-single-node
  • /test edge-e2e-metal-assisted-kube-api-net-suite
  • /test edge-e2e-metal-assisted-mce-4-11
  • /test edge-e2e-metal-assisted-mce-4-12
  • /test edge-e2e-metal-assisted-mce-4-13
  • /test edge-e2e-metal-assisted-mce-4-14
  • /test edge-e2e-metal-assisted-mce-4-15
  • /test edge-e2e-metal-assisted-mce-sno
  • /test edge-e2e-metal-assisted-metallb
  • /test edge-e2e-metal-assisted-none
  • /test edge-e2e-metal-assisted-onprem
  • /test edge-e2e-metal-assisted-single-node
  • /test edge-e2e-metal-assisted-static-ip-suite
  • /test edge-e2e-metal-assisted-static-ip-suite-4-14
  • /test edge-e2e-metal-assisted-tang
  • /test edge-e2e-metal-assisted-tpmv2
  • /test edge-e2e-metal-assisted-upgrade-agent
  • /test edge-e2e-nutanix-assisted
  • /test edge-e2e-nutanix-assisted-2workers
  • /test edge-e2e-nutanix-assisted-4-14
  • /test edge-e2e-oci-assisted
  • /test edge-e2e-oci-assisted-4-14
  • /test edge-e2e-oci-assisted-iscsi
  • /test edge-e2e-vsphere-assisted
  • /test edge-e2e-vsphere-assisted-4-12
  • /test edge-e2e-vsphere-assisted-4-13
  • /test edge-e2e-vsphere-assisted-4-14
  • /test edge-e2e-vsphere-assisted-umn
  • /test okd-scos-images
  • /test push-pr-image

Use /test all to run the following jobs that were automatically triggered:

  • pull-ci-openshift-assisted-service-master-e2e-agent-compact-ipv4
  • pull-ci-openshift-assisted-service-master-edge-ci-index
  • pull-ci-openshift-assisted-service-master-edge-e2e-ai-operator-disconnected-capi
  • pull-ci-openshift-assisted-service-master-edge-e2e-ai-operator-ztp
  • pull-ci-openshift-assisted-service-master-edge-e2e-ai-operator-ztp-capi
  • pull-ci-openshift-assisted-service-master-edge-e2e-metal-assisted
  • pull-ci-openshift-assisted-service-master-edge-images
  • pull-ci-openshift-assisted-service-master-edge-lint
  • pull-ci-openshift-assisted-service-master-edge-subsystem-aws
  • pull-ci-openshift-assisted-service-master-edge-subsystem-kubeapi-aws
  • pull-ci-openshift-assisted-service-master-edge-unit-test
  • pull-ci-openshift-assisted-service-master-edge-verify-generated-code
  • pull-ci-openshift-assisted-service-master-images
  • pull-ci-openshift-assisted-service-master-mce-images
Details

In response to this:

/test ?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci-robot

openshift-ci-robot commented Jul 4, 2024 •

Copy link
Copy Markdown

@adriengentil: This pull request references MGMT-17478 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.17.0" version, but no target version was set.

Details

In response to this:

When available, read the ICC secret set by BMO in order to retrieve the
agent image, the agent URL(s), and the inspector URL(s).

This this change, we wil try to:
1/ Get the agent image from the user override
2/ if 1/ is not found, get the image from the ICC configuration
3/ if 2/ is not found, get the image from the HUB cluster
4/ if 3/ is not found, return the default image

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@adriengentil

Copy link
Copy Markdown
Contributor Author

/test edge-lint edge-unit-test edge-e2e-ai-operator-ztp

@adriengentil

Copy link
Copy Markdown
Contributor Author

@carbonin can you have a first look? 🙏
I use the agent/inspector URL from the ICC config only if we use the agent image from the ICC config, I was thinking that the format of the URLs may be tied to some version of the agent image (for example, we can have a list of an IPv4 and an IPv6 in the URL field). Does it makes sense... or not?

@codecov

codecov Bot commented Jul 4, 2024 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 89.28571% with 12 lines in your changes missing coverage. Please review.

Project coverage is 68.51%. Comparing base (d2bba26) to head (f44ad3f).
Report is 3 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6533      +/-   ##
==========================================
+ Coverage   68.42%   68.51%   +0.08%     
==========================================
  Files         247      247              
  Lines       36425    36599     +174     
==========================================
+ Hits        24924    25075     +151     
- Misses       9293     9310      +17     
- Partials     2208     2214       +6     
Files Coverage Δ
internal/controller/controllers/bmo_utils.go 72.00% <100.00%> (+10.18%) ⬆️
internal/oc/release.go 71.48% <100.00%> (+0.98%) ⬆️
...ler/controllers/preprovisioningimage_controller.go 81.57% <86.66%> (+0.57%) ⬆️

... and 6 files with indirect coverage changes

@adriengentil

Copy link
Copy Markdown
Contributor Author

/test edge-lint edge-unit-test edge-e2e-ai-operator-ztp

Comment thread internal/controller/controllers/bmo_utils.go Outdated
Comment thread internal/controller/controllers/preprovisioningimage_controller.go Outdated
Comment thread internal/controller/controllers/preprovisioningimage_controller.go Outdated
Comment thread internal/controller/controllers/preprovisioningimage_controller.go Outdated
When available, read the ICC secret set by BMO in order to retrieve the
agent image, the agent URL(s), and the inspector URL(s).

This this change, we wil try to:
1/ Get the agent image from the user override
2/ if 1/ is not found, get the image from the ICC configuration
3/ if 2/ is not found, get the image from the HUB cluster
4/ if 3/ is not found, return the default image
@adriengentil

Copy link
Copy Markdown
Contributor Author

/test edge-lint edge-unit-test

Comment thread internal/controller/controllers/preprovisioningimage_controller.go Outdated
}
}

func (r *PreprovisioningImageReconciler) getIronicConfig(ctx context.Context, log logrus.FieldLogger, infraEnv *aiv1beta1.InfraEnv, infraEnvInternal *common.InfraEnv) (*ICCConfig, error) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No change needed, I'm just really happy with how much easier this is to read now. 🎉

@adriengentil
adriengentil marked this pull request as ready for review July 10, 2024 16:38
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 10, 2024
@openshift-ci
openshift-ci Bot requested review from javipolo and omertuc July 10, 2024 16:39
Comment thread internal/controller/controllers/preprovisioningimage_controller.go Outdated
return ironicIPs, inspectorIPs, nil
}

func (r *bmoUtils) GetICCConfig(ctx context.Context) (*ICCConfig, error) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This doesn't need to be exported if we're only using it from this package.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I changed it, not sure if having a private method in BMOUtils interface is very idiomatic, but it looks like it's mainly here to get a mock out of it. Let me know if we should do differently 🤔

@adriengentil

Copy link
Copy Markdown
Contributor Author

/retest
equinix issues

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 11, 2024
@openshift-ci

openshift-ci Bot commented Jul 11, 2024

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adriengentil, carbonin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [adriengentil,carbonin]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@adriengentil

Copy link
Copy Markdown
Contributor Author

/retest

@openshift-ci-robot

Copy link
Copy Markdown

/retest-required

Remaining retests: 0 against base HEAD 1183f3a and 2 for PR HEAD f44ad3f in total

@adriengentil

Copy link
Copy Markdown
Contributor Author

/retest

@adriengentil

Copy link
Copy Markdown
Contributor Author

/retest
prow is flacky

@openshift-ci

openshift-ci Bot commented Jul 12, 2024

Copy link
Copy Markdown
Contributor

@adriengentil: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot
openshift-merge-bot Bot merged commit 88b5e51 into openshift:master Jul 12, 2024

ironicInspectorBaseURL, ok := secret.Data[ironicInspectorBaseURLKey]
if !ok {
return nil, fmt.Errorf(configKeyNotFoundError, ironicInspectorBaseURLKey, secret.Name, secret.Namespace)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Late to this party, sorry. This is not quite correct: the inspector URL can and actually will be missing.

@adriengentil adriengentil Jul 23, 2024 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In that case, how we get the inspector URL? From the preprovisioning info? Or derived from the ironicBaseURL ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok, if understand well, we can leave the inspector URL empty, and it will be auto-magically filled using the ICC lib openshift/image-customization-controller@26ce5d6

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is correct.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

😕 but we don't use any of the icc stuff, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we use it here:

ib, err := iccignition.New([]byte{}, []byte{}, ironicBaseURL, ironicInspectorURL, ironicAgentImage, "", "", "", httpProxy, httpsProxy, noProxy, "", ironicInspectorVlanInterfaces)

carbonin pushed a commit to carbonin/assisted-service that referenced this pull request Aug 2, 2024
…ble (openshift#6533)

* MGMT-17478: Use ICC config secret for converged flow info when available

When available, read the ICC secret set by BMO in order to retrieve the
agent image, the agent URL(s), and the inspector URL(s).

This this change, we wil try to:
1/ Get the agent image from the user override
2/ if 1/ is not found, get the image from the ICC configuration
3/ if 2/ is not found, get the image from the HUB cluster
4/ if 3/ is not found, return the default image

* Add context to GetICCConfig method

* remove space

* refactor tiered logic

* Create GetImageArchitecture mehod

* fix lint

* refactor logs and getIronicAgentImageByRelease

* add infraenv in logger earlier

* make getICCConfig private
openshift-merge-bot Bot pushed a commit that referenced this pull request Aug 2, 2024
* MGMT-17478: Use ICC config secret for converged flow info when available (#6533)

* MGMT-17478: Use ICC config secret for converged flow info when available

When available, read the ICC secret set by BMO in order to retrieve the
agent image, the agent URL(s), and the inspector URL(s).

This this change, we wil try to:
1/ Get the agent image from the user override
2/ if 1/ is not found, get the image from the ICC configuration
3/ if 2/ is not found, get the image from the HUB cluster
4/ if 3/ is not found, return the default image

* Add context to GetICCConfig method

* remove space

* refactor tiered logic

* Create GetImageArchitecture mehod

* fix lint

* refactor logs and getIronicAgentImageByRelease

* add infraenv in logger earlier

* make getICCConfig private

* MGMT-18505: Fix installation from a 4.17 hub with converged flow (#6639)

* This allows ironic inspector URL to be missing in ICC config secret.

In 4.17 this is expected to be missing as the inspector service as been
removed.

If this URL is provided the agent will attempt to contact the inspector
service when it shouldn't causing the install to fail.

In earlier versions the secret will not be present so the controller
will continue to provide the inspector service URL as before.

Resolves https://issues.redhat.com/browse/OCPBUGS-37472

* Update image-customization-controller to release-4.16 branch

This includes a patch which removes the default for the inspector URL.
This is required because when deploying from a 4.17 hub the inspector
URL will not be present in the information on the cluster and we don't
want that URL to be set in the ignition.

---------

Co-authored-by: Adrien Gentil <agentil@redhat.com>
danmanor added a commit to danmanor/assisted-service that referenced this pull request Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants