Skip to content

Comments

CORS-2933: IBMCloud: Basic service endpoint override#7632

Merged
openshift-merge-bot[bot] merged 2 commits intoopenshift:masterfrom
cjschaef:splat-1097
Nov 27, 2023
Merged

CORS-2933: IBMCloud: Basic service endpoint override#7632
openshift-merge-bot[bot] merged 2 commits intoopenshift:masterfrom
cjschaef:splat-1097

Conversation

@cjschaef
Copy link
Member

Adding basic support to allow overrides of IBM Cloud service endpoints. This is a hard requirement for disconnected cluster support, to allow use of non-default endpoints for IBM Cloud services.

@cjschaef cjschaef force-pushed the splat-1097 branch 4 times, most recently from e26a23b to 03a6738 Compare October 26, 2023 20:20
Copy link
Contributor

@rvanderp3 rvanderp3 left a comment

Choose a reason for hiding this comment

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

overall LGTM

}
}

// TODO(cjschaef): See about performing additional endpoint validation (all vs. subsets, regional endpoint validation, etc.)
Copy link
Contributor

Choose a reason for hiding this comment

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

what is the status of this TODO?

Copy link
Member Author

@cjschaef cjschaef Oct 30, 2023

Choose a reason for hiding this comment

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

I was expecting to follow up on this later, as I wait for details from other development teams on possible configurations, environments, etc. that would determine if we wish to perform additional validation, or leave the endpoint override possibilities broader, as the are currently.

I can get a Jira open to track that work, and link it here, if that makes sense.

Copy link
Member Author

Choose a reason for hiding this comment

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

I removed the TODO, as we will be leaving the configuration options more broad, due to the variety of environments/restrictions we can cover.

config.Provider.VPCEndpointOverride = suffixRegex.ReplaceAllString(endpoint.URL, "${1}")
case ibmcloud.IBMCloudServiceResourceManager:
config.Provider.RMEndpointOverride = endpoint.URL
}
Copy link
Contributor

Choose a reason for hiding this comment

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

would there be any value in logging when this switch falls through?

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe. Other endpoints the CCM doesn't use (COS, DNS Services, etc.), would fall through, so we'd ignore them in terms of building the CCM config.
But perhaps logging the "ignored" overrides could be helpful if the user has incorrectly configured those required for the CCM, but I'd expect the validation steps should filter those issues out
https://github.com/openshift/installer/pull/7632/files#diff-e6306df593d77282680d1864f5e1504e044abdbe681195fbcbeaab0cc3c45cc2R437

I'll add a default log call I think though.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a log call


// Following the format provided by the IBM Cloud Terraform Provider documentation:
// https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/guides/custom-service-endpoints#file-structure-for-endpoints-file
endpointContents := make(map[string]map[string]map[string]string)
Copy link
Contributor

Choose a reason for hiding this comment

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

this seems like a fairly complex way of representing this data structure. would it be possible to create a type representing it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, I'll see about doing that instead, to get the JSON format correct.

Copy link
Member Author

Choose a reason for hiding this comment

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

I made the design a bit better I hope.

httpsScheme := "https"

// Regexp for a trailing API version in URL path ('/v1', '/v22/', etc.)
versionPath := regexp.MustCompile(`(/v\d+[/]{0,1})$`)
Copy link
Contributor

Choose a reason for hiding this comment

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

would it make sense to compile this regex once as in line 93?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh yeah, I can move that.

Copy link
Member Author

Choose a reason for hiding this comment

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

Moved

@cjschaef
Copy link
Member Author

cjschaef commented Nov 6, 2023

Init container clonerefs not ready: (state: running) Init container initupload not ready: (state: waiting, reason: "PodInitializing", message: "") Init container place-entrypoint not ready: (state: waiting, reason: "PodInitializing", message: "")

/retest

@cjschaef cjschaef force-pushed the splat-1097 branch 2 times, most recently from a85470d to 334255e Compare November 6, 2023 22:51
@cjschaef
Copy link
Member Author

cjschaef commented Nov 7, 2023

/retitle CORS-2934: IBMCloud: Basic service endpoint override

@openshift-ci openshift-ci bot changed the title IBMCloud: Basic service endpoint override CORS-2934: IBMCloud: Basic service endpoint override Nov 7, 2023
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Nov 7, 2023

@cjschaef: This pull request references CORS-2934 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 story to target the "4.15.0" version, but no target version was set.

Details

In response to this:

Adding basic support to allow overrides of IBM Cloud service endpoints. This is a hard requirement for disconnected cluster support, to allow use of non-default endpoints for IBM Cloud services.

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/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Nov 7, 2023
@cjschaef cjschaef force-pushed the splat-1097 branch 3 times, most recently from 4e2f04f to 24036a9 Compare November 7, 2023 20:32
@rvanderp3
Copy link
Contributor

/retest-required

@cjschaef
Copy link
Member Author

cjschaef commented Nov 7, 2023

/retest

1 similar comment
@cjschaef
Copy link
Member Author

cjschaef commented Nov 8, 2023

/retest

@cjschaef
Copy link
Member Author

/retest-required

@cjschaef
Copy link
Member Author

cjschaef commented Nov 13, 2023

I am updating to pull in the changes from api, for service names.
openshift/api@2155ee0

Done and fixed bootstrap destroy issue, requiring endpoint override solution.

@cjschaef cjschaef force-pushed the splat-1097 branch 3 times, most recently from d4c8a5b to 1e746f9 Compare November 14, 2023 22:00
@cjschaef
Copy link
Member Author

/retest

2 similar comments
@cjschaef
Copy link
Member Author

/retest

@cjschaef
Copy link
Member Author

/retest

@r4f4
Copy link
Contributor

r4f4 commented Nov 22, 2023

/hold cancel
openstack-manifests fix has merged.

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 22, 2023
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 22, 2023
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 22, 2023
@cjschaef
Copy link
Member Author

I've rebased and pulled in a new openshift/api release for the IBMCloudServiceName enum needed.

Copy link
Contributor

@r4f4 r4f4 left a comment

Choose a reason for hiding this comment

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

We usually prefer that vendoring changes are in their own commit. It also helps with code reviews, since we can skip them when looking at the commits until all the other parts have been reviewed.

I really wish this whole feature was not in a single commit but broken down into multiple logical units. For examples, 1 commit for terraform configs changes, 1 commit for adding a new field to install-config, 1 commit for replacing existing errors.Wrap by fmt.Errorf, etc. It would make reviewing much easier.

Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice to add a comment explaining why it's ok to silence the linter

Suggested change
_, err = http.Head(endpoint) //nolint:gosec
_, err = http.Head(endpoint) //nolint:gosec // reason goes here

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, I'll add.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this change related to this PR?

Copy link
Member Author

@cjschaef cjschaef Nov 25, 2023

Choose a reason for hiding this comment

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

No, I was cleaning up the reference as I found null isn't desired for string.
I will drop and fix later.

@cjschaef
Copy link
Member Author

I can attempt to break the PR up into multiple PR's if that helps then.

I would open separate PR's then from this PR, as not to change this one until I know those are valid/expected.

@r4f4
Copy link
Contributor

r4f4 commented Nov 25, 2023

I can attempt to break the PR up into multiple PR's if that helps then.

I would open separate PR's then from this PR, as not to change this one until I know those are valid/expected.

That would be nice but if you're aiming to get this merged before FF, just breaking this PR down into commits is enough. Unless you think some part of this work can be merged independently, in which case a separate PR might help to push those along.

@cjschaef
Copy link
Member Author

Okay, I went with that, and updated this PR with those changes (3 commits, without the other cleanup changes).

I've opened a separate draft PR for those cleanup related changes.
#7766

@patrickdillon
Copy link
Contributor

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 26, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: patrickdillon

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:

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 26, 2023
@patrickdillon
Copy link
Contributor

This LGTM
looks like there is a small linter error

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 27, 2023
@cjschaef
Copy link
Member Author

cjschaef commented Nov 27, 2023

I'll see about rebasing and rebuilding the go mod conflicts.

Updated

I dropped the go mod changes, as the api release was updated to a newer release than I had, to get the IBMCloudServiceName enums.

Adding support to terraform to allow overrides of IBM Cloud
service endpoints. This is a hard requirement for disconnected
cluster support, to allow use of non-default endpoints for
IBM Cloud services.

Related: https://issues.redhat.com/browse/CORS-2933
Adding support to allow overrides of IBM Cloud service
endpoints in installconfig. This is a hard requirement for
disconnected cluster support, to allow use of non-default
endpoints for IBM Cloud services.

Related: https://issues.redhat.com/browse/CORS-2933
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 27, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 27, 2023

@cjschaef: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/okd-e2e-aws-ovn 03a6738 link false /test okd-e2e-aws-ovn
ci/prow/okd-scos-e2e-aws-ovn 03a6738 link false /test okd-scos-e2e-aws-ovn
ci/prow/e2e-openstack-nfv-intel 58deb39162704bd6fe868e5d0596d05f0ce41960 link false /test e2e-openstack-nfv-intel
ci/prow/e2e-openstack-proxy 58deb39162704bd6fe868e5d0596d05f0ce41960 link false /test e2e-openstack-proxy
ci/prow/e2e-gcp-secureboot 58deb39162704bd6fe868e5d0596d05f0ce41960 link false /test e2e-gcp-secureboot
ci/prow/e2e-gcp-ovn-xpn 58deb39162704bd6fe868e5d0596d05f0ce41960 link false /test e2e-gcp-ovn-xpn
ci/prow/e2e-azure-ovn-shared-vpc 58deb39162704bd6fe868e5d0596d05f0ce41960 link false /test e2e-azure-ovn-shared-vpc
ci/prow/e2e-gcp-ovn-shared-vpc 58deb39162704bd6fe868e5d0596d05f0ce41960 link false /test e2e-gcp-ovn-shared-vpc
ci/prow/e2e-azure-ovn 58deb39162704bd6fe868e5d0596d05f0ce41960 link true /test e2e-azure-ovn
ci/prow/e2e-ibmcloud-ovn 8909227 link false /test e2e-ibmcloud-ovn
ci/prow/e2e-gcp-ovn 58deb39162704bd6fe868e5d0596d05f0ce41960 link true /test e2e-gcp-ovn

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/test-infra repository. I understand the commands that are listed here.

Copy link
Contributor

@r4f4 r4f4 left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 27, 2023
@openshift-merge-bot openshift-merge-bot bot merged commit 29ce6ef into openshift:master Nov 27, 2023
@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

This PR has been included in build ose-installer-altinfra-container-v4.15.0-202311271609.p0.g29ce6ef.assembly.stream for distgit ose-installer-altinfra.
All builds following this will include this PR.

@cjschaef cjschaef deleted the splat-1097 branch November 28, 2023 19:46
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants