Introduce SGCP NFS driver and supporting infrastructure#1063
Open
cgalibern wants to merge 30 commits into
Open
Introduce SGCP NFS driver and supporting infrastructure#1063cgalibern wants to merge 30 commits into
cgalibern wants to merge 30 commits into
Conversation
- Implemented the `resfssgcp_nfs` driver with manifest and capabilities registration. - Added keyword definitions for UUID, host, permission, exclusive, protocol, secret, and endpoint. - Embedded text descriptions for keywords to facilitate configuration and usage.
- Introduced `resfssgcp_nfs_cg` driver with capabilities and manifest registration. - Defined keywords: `uuid`, `az`, `secret`, `endpoint`, `timeout`, and `failover`. - Embedded text descriptions for keyword configurations.
…ord definitions - Introduced `resipsgcp_dnsalias` driver with capabilities and manifest registration. - Defined keywords: `uuid`, `name`, `target`, `zone_id`, `secret`, and `endpoint`. - Added embedded text descriptions for keyword configurations to support DNS alias management.
- Defined `AuthInfo` struct to encapsulate authentication details (Account ID, Client ID, Client Secret, Signature). - Implemented `GetAuthInfo` function to retrieve and decode auth details from a datastore path.
- Introduced `Outputter` struct to encapsulate output function logic. - Added `NewOutputter` constructor and `Output` method for output generation.
- Updated `unix.Major` and `unix.Minor` to explicitly cast `stat1.Rdev` and `stat2.Rdev` to `uint64`.
- Modified `ApplyProc` function to include a boolean return value for success indication alongside the error.
…on management - Introduced `Config` struct to centralize SGCP API configuration (files, DNS, auth, cache). - Added utility methods for configuration loading, cloning, and access (e.g., `GetConfig`, `LoadConfig`). - Implemented tests for configuration behavior and validation. - Included embedded configuration example in YAML format for reference and testing.
- Introduced `Api` struct to centralize HTTP client logic for SGCP. - Implemented `do` and `CheckStatusCode` methods for making authenticated requests and handling response codes. - Added comprehensive tests to validate the new API functionality.
- Introduced `TokenFactory` to handle token generation and caching for SGCP API authentication. - Implemented `Get` and `Clear` methods for token retrieval and cache invalidation. - Added tests to validate token generation, caching behavior, and edge cases.
- Introduced `FilesAPI` for handling SGCP file-related operations, including NFS client management. - Added methods and utilities for constructing URLs, executing HTTP requests, and managing scopes. - Implemented corresponding tests to validate API logic and HTTP interactions.
…y function - Added `DisabledFlag` field to the `Config` struct for managing SGCP service disablement via a file path. - Introduced `IsDisabled` function to check the presence of the disable flag using the configured path. - Updated configuration example to include the new `disabled_flag` field.
…lation - Introduced `GetAuthInfoFromDatastorePather` struct to encapsulate the `GetAuthInfo` logic as a method.
… and tests - Introduced `resfssgcp_nfs` package to provide SGCP NFS filesystem resource driver. - Implemented NFS client management with support for exclusive mode, API integration, and caching. - Added comprehensive test coverage, including configuration validation and resource lifecycle scenarios. - Updated `manifest.go` to include keywords for underlying filesystem resource.
… in configuration - Added validation for `secret` and `endpoint` fields, ensuring they are specified either in the task or configuration file. - Adjusted configuration logic to set default values or return appropriate error messages if missing.
…ndpoint` fields in manifest
- Moved test configuration logic to a new `testsgcphelper` package. - Replaced `LoadConfig` with a thread-safe `GetConfig` function. - Introduced `SetConfigForTest` for managing test configurations. - Updated test cases to use the refactored configuration logic.
… setup - Added validation for mandatory SGCP config file in `Configure` method. - Introduced `Setup` helper for managing test configuration state. - Enhanced test cases to validate error handling and configuration prerequisites.
…point` fields in manifest
… basic implementation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request introduces the SGCP NFS filesystem resource driver (
resfssgcp_nfs) along with several related updates:New SGCP NFS Driver (
resfssgcp_nfs):resfssgcp_nfspackage to support NFS filesystem resources.Start,Stop,Status).driverdbandmanifest.go.SGCP API Enhancements:
FilesAPIto handle file-related SGCP operations.TokenFactory.Refactoring and Utilities:
GetAuthInfoand added utilities for batch decoding of objects.KeywordCheckReadinresfshostinto enabled and disabled variants.Outputterstruct in ageing cache for output management.Other Drivers:
resfssgcp_nfs_cgandresipsgcp_dnsaliasdrivers, including manifest registrations and keyword definitions.