Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update tests to remove httpRoutes since services can now be deployed …
…as part of container rendering. (#6241) # Description We now have the ability to deploy k8s services as part of container rendering (ref #6375) This PR updates all the radius repo tests and samples - to remove the httproute constructs from bicep - update service names to match the service generation logic (service name = name of the container providing a service, which is inferred from the presence of port construct. "connections" have url as desitination.) ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). <!-- Please update the following to link the associated issue. This is required for some kinds of changes (see above). --> Fixes: #6099 ## Auto-generated summary <!-- GitHub Copilot for docs will auto-generate a summary of the PR --> <!-- copilot:all --> ### <samp>🤖 Generated by Copilot at e22a126</samp> ### Summary 🌐🛠️🗑️ <!-- 1. 🌐 - This emoji represents the DNS service generation feature, which allows users to create services with different port and target port values for containers. It also implies networking and communication between containers and other resources. 2. 🛠️ - This emoji represents the simplification and refactoring of the container renderer code, which improves the readability and maintainability of the code. It also implies fixing a typo and using a more appropriate data structure for the container ports. 3. 🗑️ - This emoji represents the removal of unnecessary and unused resources and fields from the test cases, which reduces the complexity and clutter of the test code. It also implies cleaning up and simplifying the test scenarios. --> This pull request simplifies the service generation logic for datastores and containers in the radius project. It removes the dependency on httpRoutes resources for datastores, and allows specifying different port and target port values for containers. It updates the renderers, test cases, and test data files accordingly. > _This pull request makes some changes_ > _To how container rendering ranges_ > _It removes httpRoutes_ > _And simplifies routes_ > _For datastores and their exchanges_ ### Walkthrough * Refactor containerPorts struct to use corev1.ServicePort slice and assign port field if missing ([link](https://github.com/radius-project/radius/pull/6241/files?diff=unified&w=0#diff-3da981bf20df07918a646eafcd867d6c95abac1f3aef1ed1b50a29f3f4cc8636L242-R267), [link](https://github.com/radius-project/radius/pull/6241/files?diff=unified&w=0#diff-3da981bf20df07918a646eafcd867d6c95abac1f3aef1ed1b50a29f3f4cc8636L274-R280), [link](https://github.com/radius-project/radius/pull/6241/files?diff=unified&w=0#diff-3da981bf20df07918a646eafcd867d6c95abac1f3aef1ed1b50a29f3f4cc8636L287-R288)) * Update test case for DNS service generation in `render_test.go` to use different container and service port numbers and add port field to container port definition ([link](https://github.com/radius-project/radius/pull/6241/files?diff=unified&w=0#diff-6f1219f263ab06a1493ac76960e2ab8cbe647e83e926bff7d13988f393334f94L1541-R1542), [link](https://github.com/radius-project/radius/pull/6241/files?diff=unified&w=0#diff-6f1219f263ab06a1493ac76960e2ab8cbe647e83e926bff7d13988f393334f94R1553), [link](https://github.com/radius-project/radius/pull/6241/files?diff=unified&w=0#diff-6f1219f263ab06a1493ac76960e2ab8cbe647e83e926bff7d13988f393334f94L1568-R1571)) * Fix typo in error message for invalid ports definition in `render.go` ([link](https://github.com/radius-project/radius/pull/6241/files?diff=unified&w=0#diff-3da981bf20df07918a646eafcd867d6c95abac1f3aef1ed1b50a29f3f4cc8636L186-R197)) * Remove httpRoutes resource definition and validation for MongoDB, Redis, and SQL test cases in `mongodb_test.go`, `redis_test.go`, and `sql_test.go` ([link](https://github.com/radius-project/radius/pull/6241/files?diff=unified&w=0#diff-3537a95d4323706fe81435869ceaee11338952061d8f3c4d4c0dd526d761b440L55-L59), [link](https://github.com/radius-project/radius/pull/6241/files?diff=unified&w=0#diff-3537a95d4323706fe81435869ceaee11338952061d8f3c4d4c0dd526d761b440L71), [link](https://github.com/radius-project/radius/pull/6241/files?diff=unified&w=0#diff-9d52e2b8eb6c0350242880d948ab606e69c8f49b293bc6ad92597aaeaafd26b6L53-L57), [link](https://github.com/radius-project/radius/pull/6241/files?diff=unified&w=0#diff-9d52e2b8eb6c0350242880d948ab606e69c8f49b293bc6ad92597aaeaafd26b6L69), [link](https://github.com/radius-project/radius/pull/6241/files?diff=unified&w=0#diff-61544cabd23b93b06160db8c149184ecef9601bfc914d7c095e623243cce34ecL58-L62), [link](https://github.com/radius-project/radius/pull/6241/files?diff=unified&w=0#diff-61544cabd23b93b06160db8c149184ecef9601bfc914d7c095e623243cce34ecL74)) * Remove provides field from container port definition for MongoDB and SQL test cases in `datastoresrp-rs-mongodb-manual.bicep` and `datastoresrp-resources-sqldb-manual.bicep` ([link](https://github.com/radius-project/radius/pull/6241/files?diff=unified&w=0#diff-43654e758afeecffd627e6a77947c820172d7650475573e5c241138c54a8a740L55), [link](https://github.com/radius-project/radius/pull/6241/files?diff=unified&w=0#diff-bc362702cbffa6fe723a2b733164d41b24270dd76dbe9e775ad40fa2ee04202fL101)) * Add port field to container port definition for Redis test case in `datastoresrp-resources-redis-manual.bicep` ([link](https://github.com/radius-project/radius/pull/6241/files?diff=unified&w=0#diff-ec82efbd13c3858a4502bc3c0cab33f23a8edddd7f8e71eccc1d7593c952cf8cL48-R48)) * Update host, port, and connectionString fields for MongoDB, Redis, and SQL test cases in `datastoresrp-rs-mongodb-manual.bicep`, `datastoresrp-resources-redis-manual.bicep`, and `datastoresrp-resources-sqldb-manual.bicep` to use container name and port instead of httpRoutes hostname and port ([link](https://github.com/radius-project/radius/pull/6241/files?diff=unified&w=0#diff-ec82efbd13c3858a4502bc3c0cab33f23a8edddd7f8e71eccc1d7593c952cf8cL71-R68), [link](https://github.com/radius-project/radius/pull/6241/files?diff=unified&w=0#diff-bc362702cbffa6fe723a2b733164d41b24270dd76dbe9e775ad40fa2ee04202fL66-R69), [link](https://github.com/radius-project/radius/pull/6241/files?diff=unified&w=0#diff-43654e758afeecffd627e6a77947c820172d7650475573e5c241138c54a8a740L84-R75)) * Remove httpRoutes resource definition for MongoDB, Redis, and SQL test cases in `datastoresrp-rs-mongodb-manual.bicep`, `datastoresrp-resources-redis-manual.bicep`, and `datastoresrp-resources-sqldb-manual.bicep` ([link](https://github.com/radius-project/radius/pull/6241/files?diff=unified&w=0#diff-ec82efbd13c3858a4502bc3c0cab33f23a8edddd7f8e71eccc1d7593c952cf8cL56-R57), [link](https://github.com/radius-project/radius/pull/6241/files?diff=unified&w=0#diff-bc362702cbffa6fe723a2b733164d41b24270dd76dbe9e775ad40fa2ee04202fL77-L85), [link](https://github.com/radius-project/radius/pull/6241/files?diff=unified&w=0#diff-43654e758afeecffd627e6a77947c820172d7650475573e5c241138c54a8a740L63-L70))
- Loading branch information