Граф коммитов

612 Коммитов

Автор SHA1 Сообщение Дата
Tanmay Satam 113da3d748 Remove etag property from test expectations as it no longer shows up in responses 2024-11-18 14:25:30 -05:00
Tanmay Satam a298c9e710 Add missing argument for FPNewClientCertificateCredential 2024-11-18 14:25:13 -05:00
Nicolas Ontiveros 0e78969cec
Merge pull request #3957 from Azure/niontive/ARO-6297
Support MSI in canary
2024-11-18 09:36:03 -08:00
Ayato Tokubi ef15db22f7
SDK2: Replace old network SDK in ListResources Admin API (#3890)
* remove unused old routeTable client
* replace old virtual networks sdk to the new one
2024-11-18 05:18:19 +00:00
Nicolas Ontiveros 5d6dea5057 Add additional tenants 2024-11-15 09:11:35 -08:00
Kipp Morris 59f60b004e
MIWI API converter fixes (#3950)
* Add missing Identity fields to API converters

* Properly convert PlatformWorkloadIdentityProfile from internal -> admin

* Do not clobber existing read-only fields on admin PUT/PATCH

* Fix silly mistakes...

* Fix unit test case
2024-11-11 13:02:51 -08:00
Tanmay Satam d33d81b9c1
Support Update requirements for Workload Identity clusters (#3935)
* Do not clobber existing PlatformWorkloadIdentity readonly fields (clientid/objectid) on patch

* Ensure CSP-specific update steps only run for CSP clusters

* Ensure ClientId/ObjectIds are populated for all platform workload identities

* Ensure required federated identity credentials during cluster update

Note that additional work is still required to ensure this works as expected,
which will be handled in follow-up efforts.

* Add step to directly deploy platform workload identity credential secrets on-cluster during Update

* Refactor: extract mock platformWorkloadIdentityRolesByVersion setup to shared function

* Do not clobber existing ManagedServiceIdentity fields (IssuerURI) on patch

* Apply upgradeable-to annotation to cloudcredential resource via Patch

This avoids issues with e.g. having the wrong version of the resource struct
definition vendored into the RP.

* Fix az aro update request body handling

- Only pass in new/updated identities (RP will add these to the existing identity map during a patch operation)
- Only set the upgradeableTo property if it is explicitly set
2024-11-08 07:31:52 -08:00
Kipp Morris a60d631f4f
MIWI Cosmos DB key uniqueness fix (#3944)
* Fix Cosmos DB unique key issue for MIWI clusters and update existing unit tests to continue to pass

* Add test case that validates changes
2024-11-07 09:19:34 -08:00
Tanmay Satam 98580734e5
Fix AdminAPI representation of PreconfiguredNSG status (#3933)
* Fix spelling of preconfiguredNSG JSON tag

* Copy PreconfiguredNSG property during internal->admin conversion

* Fix nil pointer dereference when converting workload identity cluster doc to adminapi representation

* Update admin openshiftcluster_putorpatch tests to expect property for PreconfiguredNSG
2024-11-01 09:00:00 -04:00
Caden Marchese faf377c984
Incorporate CI and ARM feedback from azure-rest-api-specs to v2024-08-12-preview API (#3727)
* api changes

fix tag package-2023-11
this was wrong in the readme

remove UserAssignedIdentities
top level fields must not have additionalproperties

update the default tag to latest

define a new IdentityType with x-ms-enum

modelAsString on identityType x-ms-enum should be false

rename IdentityType to ResourceIdentityType to match v3/types.json

make client

add descriptions to all new API fields

make client

fix unit test that was failing as a result of removing the UserAssignedIdentity type from the API

Adjust a doc comment according to feedback

make client

* add platformworkloadidentityroleset to API definition and examples

Update client generation to account for swagger subfolder

make client

fix pwip and validatestatic unit tests

fix relative path to common-types

migrate from common-types/v3 to common-types/v6
it was requested that we use the latest version of
common types. This involves some changes to our examples
to match the UUID expected.

move from Identity to ManagedServiceIdentity type
defined in common-types/v6

use modelerfour.lenient-model-deduplication=true
avoids python client generation issues

convert PlatformWorkloadIdentity to map

ARO-4382 fix unit test cases

make generate swagger

fix unit tests

revert naming openShiftCluster.ManagedServiceIdentity to Identity

fix prod code and unit tests post-rebase, reference common-types
directly for the identity property

* more swagger CI fixes
* fix examples to contain identity and type
* remove PlatformWorkloadIdentityRoleSetUpdate

oct 16th changes

oct 17th changes

fix issues post-rebase

* update readme to contain suppression for avoidAdditionalProperties

* fix ModelValidation error by converting example IDs to resourceIDs

* Update python/go clients

* Update az aro extension to enumerate platform_workload_identities as a dict instead of a list

* Fix python linter issues

* configure suppression for PatchBodyParametersSchema

appease the linter, fix subscriptionID type in util/azureclient

appease the linter again

correct log statement, use better naming

* regenerate examples
* changes operatorName and roleDefinitionName in PWIRS_List.json

---------

Co-authored-by: Tanmay Satam <tsatam@redhat.com>
2024-10-29 14:08:36 -07:00
Amber Brown 5a4e719d87
[ARO-1885] Implement OperatorFlagsMergeStrategy (#3911)
JIRA: https://issues.redhat.com/browse/ARO-1885

Co-authored-by: Srinivas Atmakuri <sreenivas.atmakuri@live.com>
2024-10-28 12:43:13 +11:00
Kipp Morris 1a51bf4f8b
Regenerate certain mocks using source mode instead of reflect mode to (#3886)
fix issues with `make generate` on MacOS
2024-10-04 10:29:41 -07:00
kimorris27 7448b3db41 `make validate-go` to format stuff and make CI happy 2024-09-26 09:00:11 -05:00
kimorris27 086f532624 Replace all references to the golang mock repo with references to the
Uber fork, then `go mod tidy` and `go mod vendor`

Note the change to `deps.go`
2024-09-26 09:00:11 -05:00
Kipp Morris e3cec21b73
Lay groundwork for cluster MSI usage (#3757)
* Add a parameter for enabling Entra ID RBAC on key vaults
* Add an RP-level feature flag for determining whether to use the mock MSI RP
* Tweak the mock identity URL to play nicely with the mock MSI RP
* Add Azure SDK client wrappers for new clients (federated identity credentials control plane and key vault data plane)
* Vendor in new Azure SDK clients and update msi-dataplane

* Lay groundwork for use of cluster MSI...
- Initialize the MSI dataplane client, using the mock MSI RP/stub if
  appropriate
- Initialize key vault store client (for MSI certificates; functionality
  is implemented in MSI dataplane module)
- Create a cluster MSI certificate and store it in the key vault during
  cluster bootstrap
- Instantiate an Azure SDK FederatedIdentityCredential client using the
  cluster MSI certificate
- Delete the cluster MSI certificate as needed during cluster deletion

* Don't fail during cluster deletion if the cluster MSI certificate is
already gone from the key vault (or was potentially never created)

* Establish an RP-Config variable for the MSI RP endpoint

- Update doc comment for ensureClusterMsiCertificate
- Simplify conditional logic in MSI cert deletion

* Use pointer conversion functions that aren't deprecated

* Respond to PR comments (and fix some other things along the way)

- Move `clusterMsiResourceId` function to `OpenShiftCluster` type
- When persisting the MSI cert to KV, use the `NotAfter` returned by the MSI RP (for the stub, just use an arbitrary value)
- Move `getClientOptions` functionality to `AROEnvironment` type
- Move logic for determining cluster MSI key vault name to `pkg/env`
- Pull cloud name mapping stuff out to `AROEnvironment` type
- Update msi-dataplane module to include new changes and use `UserAssignedIdentities` type to get Azure credential in `pkg/cluster/clustermsi.go`
- Fix typo in https URL in comment in `pkg/cluster/delete.go`
- Implement suggestion to use `errors.As` instead of a type assertion in `pkg/cluster/delete.go`

* Update documentation with info about new feature flag

- Move new cluster MSI steps forward in bootstrap step order
- Move MSI dataplane client options stuff to pkg/env
- Explicitly check for a single cluster MSI in `ClusterMsiResourceId`
- Other small tweaks

* Vendor in msi-dataplane update that prevents a potential nil pointer dereference

* Add missing method to internal key vault client

* Make error messages more specific in ClusterMsiResourceId

* Add missing env vars to run-rp make target and uncomment dynamic validation bootstrap step

- In newly added Azure clients, return struct types instead of interface
  types
- Move cluster MSI certificate deletion to be after Azure resource
  deletion for safety just in case cx continues to use cluster that is
  in Failed/Deleting provisioning state

* Add new env vars for MIWI to env.example for clarity/completeness

* Turn check for nonzero number of user assigned identities into a utility function

* Use existing constant for key vault dns suffix
2024-09-24 08:14:56 -04:00
Amber Brown c554e98391
Drop some unneccessary dependencies by moving to `bingo` for tooling (#3719)
* Move to using bingo for tools
* go mod vendor
2024-09-05 15:29:19 +10:00
Brendan Bergen 4323fa741d
Fix slow tests in /pkg/frontend (#3810)
* Clarifying etcd cert renew test

- Updated the test to make it clear it is passing because timeout is being reached
- Updated the timeout from 10s -> 0s to pass faster

* Fix slow changefeed tests
2024-09-04 11:30:31 -06:00
Tanmay Satam 8808352497
Allow prerelease OCP versions and version strings with metadata during cluster installation (#3782)
* Add unit tests for existing frontend version validation

* Use semver package to validate versions in frontend instead of regex

This allows the ability to provide prerelease versions or version strings
containing metadata.

* Ensure disableUpdates does not propagate metadata in version string to clusterversion resource
2024-08-21 15:30:48 -04:00
Kipp Morris 1cee7a1958
Ensure identity headers are persisted in requests to create MIWI clusters (#3746)
* Update `TestPutOrPatchOpenShiftCluster` to use the latest API version

* Add test case to help ensure identity headers are persisted

* Fix nil pointer dereference in converter

* Fix issue with identity headers not being persisted

* Finish updating variable name in all necessary places
2024-07-31 15:08:42 -05:00
Nicolas Ontiveros 78feafb7f3
Add middleware for mock MSI headers (#3714)
* Add middleware

* Add frontend

* Add unit test

* Add license and update go mod

* vendor

* Fix linting

* lint

* Remove unneeded comments
2024-07-29 13:41:22 -05:00
Sanjana Lawande b80a91af0d apply suggestions from code review 2024-07-26 09:44:14 -07:00
Sanjana Lawande bdcd8c1ebd apply suggestions from code review 2024-07-24 15:43:10 -07:00
Sanjana Lawande 2d97fea485 move iswimi function to openshiftcluster.go 2024-07-24 11:54:39 -07:00
Sanjana Lawande 53691de809
shared utility function to check if a cluster is workload identity (#3683)
* shared utility function to check if a cluster is workload identity

* adding license statement

* apply suggestions from code review

* apply suggestions from code review

* remove TODO comment

* apply code review suggestions

---------

Co-authored-by: Sanjana Lawande <slawande@slawande-thinkpadt14sgen2i.remote.csb>
2024-07-23 12:53:33 -07:00
Aldo Fuster Turpin b1a38a621a log outbound correlation data 2024-07-19 12:29:15 +02:00
bennerv 48e8abf093 Fix missing database refactor on preflight validation in frontend 2024-07-18 09:40:27 -04:00
BCarvalheira e7b3fe66d8 Preflight update and tests 2024-07-18 05:23:43 -07:00
Amber Brown f1fbd0feb2
Try and get the NewMonitor/Frontend/etc mess under control (#3690)
* make a db wrapper

* add the other fields

* mechanical changes

* instantiate

* remove clustermanager code

* implement in portal too
2024-07-18 08:25:32 +10:00
Amber Brown 94cd8d7f27
[ARO-9169] Remove disused clustermanager frontend code (#3642) 2024-07-17 09:39:37 +10:00
Amber Brown 31af734103
[ARO-5368] Try and log the VM info + console log on failure (#3629)
Dumps the VM info + console logs on failure so that we don't need to run the Geneva Action or have the control plane still around to get it. Also refactors frontend and geneva action to make use of the same code path.
2024-07-15 16:32:23 +10:00
Maitiú Ó Ciaráin d1198c6f66
Merge pull request #3665 from Azure/mociarain/ARO-8608-refactor
Mociarain/aro 8608 refactor
2024-07-09 11:09:38 +02:00
Maitiú Ó Ciaráin 6b911872da
Merge pull request #3655 from Azure/ARO-8608
Add tenant ID to internal apis for CMSI usage
2024-07-04 10:51:42 +02:00
Maitiú Ó Ciaráin 446be7a32d Use consistent naming 2024-07-04 08:41:39 +02:00
Maitiú Ó Ciaráin 783ea2464f Collect arguments in a struct 2024-07-04 08:41:12 +02:00
Nicolas Ontiveros 786e0cf651 Fix unit tests 2024-07-02 07:57:39 -07:00
Nicolas Ontiveros 8fa599f554 Add todo for shared function 2024-07-01 07:53:04 -07:00
Nicolas Ontiveros ecbc28d7d0 Revert "Add function to test if miwi enabled"
This reverts commit 524b396b72.
2024-07-01 07:51:27 -07:00
Rajdeep Singh Chauhan 90fde763c3 ARO-4373 update mgmtstorage sdk to 2019-06-01 for disabling allowSharedKeyAccess 2024-06-30 20:38:28 -04:00
Rajdeep Singh Chauhan e884fd8105 ARO-4373 change BoundServiceAccountSigningKey SecureString to SecureBytes 2024-06-30 20:38:28 -04:00
Rajdeep Singh Chauhan 47c214a363 ARO-4373 add the BoundServiceAccountSigningKey to ClusterProfile 2024-06-30 20:38:28 -04:00
Nicolas Ontiveros 524b396b72 Add function to test if miwi enabled 2024-06-28 15:55:20 -07:00
Nicolas Ontiveros 56ed7ae2bb fix error naming 2024-06-28 14:27:58 -07:00
Nicolas Ontiveros a0a5d22a0a Further refactor the code 2024-06-28 11:31:36 -07:00
Nicolas Ontiveros d76314eb97 Add unit tests 2024-06-28 11:13:42 -07:00
Nicolas Ontiveros 401380f572 fix put/patch 2024-06-28 11:01:17 -07:00
Kipp Morris 31c72522fe
MIWI API endpoints (#3608)
* Add Cosmos DB container for PlatformWorkloadIdentityRoleSets

* Revert change to AKS k8s version - committed by mistake

* Fix bug in converter

When I first wrote the converter, I thought Go would treat the the slice
we `make` few lines above these changes as a slice full of zero-value
structs, but it actually treats it as an empty slice, which led to
out-of-bound issues when I first tried to use this converter to work on
the API endpoints.

* Add the PlatformWorkloadIdentityRoleSetConverter to the API register

* Implement the change feed for role sets in the easiest, most naive way

* Implement the external API endpoint for listing role sets

* Fix a small oversight from earlier on

* Add unit tests for the list endpoint

* Add unit tests for changefeed changes

* Uncomment the static validator

* Fix more slice out of bounds bugs in the converters...

* Add converter and static validator to the admin API register

* Add list and put endpoints

* Fix name of function to match convention

* Fix bug in static validator

I originally wrote the code the way I did so that we could aggregate
errors so that we could provide a better UX in cases where there are
multiple similar errors in the request content. I found while writing
unit tests that aggregating the errors in this way and not wrapping them
in a CloudError causes the RP to return an internal server error instead
of a 400 bad request.

Is there a way we can aggregate the errors and still wrap them in a
CloudError? I'm not sure of the formatting requirements for the text of
CloudErrors.

* Add unit tests for new API endpoints

* Fix typo

* Appease the linter

* Appease the linter

* Add TODO comment re: the number of parameters

* Update static validator to return multiple validation issues at the same time where applicable for better UX

* Add a simple utility function to make semver comparisons of OpenShift minor version more readable

* Log error before returning 500 to user

* Log errors before returning 500 to user

* Improve naming of unit test cases

* Add additional unit test cases
2024-06-06 10:15:44 -04:00
cadenmarchese 2567659273 remove unneccesary nil check 2024-05-30 13:28:08 -04:00
cadenmarchese aaccab3c28 add identityURL handling to the API 2024-05-23 15:36:27 -04:00
Rajdeep Chauhan c918d24fec
ARO-6623 add nil check before populating clientsecrets for different routes (#3567) 2024-05-13 11:29:46 -04:00
cadenmarchese e7f7b692e1 Convert ServicePrincipalProfile to pointer
* Adjust converters + tests
2024-05-02 09:08:02 -04:00