Compare commits

...

109 Commits

Author SHA1 Message Date
Alex
4143f50004 Release v0.20.4 (#2337)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-09-27 21:10:42 -07:00
Alex
d1511c5eb0 Limit concurrent downloads & uploads (#2313) 2022-09-23 10:35:55 -07:00
jinapurapu
c4c6d48abf Tooltips for Bucket Lifecycle, Delete bucket, Manage bucket (#2334) 2022-09-23 12:30:37 -05:00
Alex
43c5f9094a Tenant details navigation issues fix (#2336)
Fixes issues with Tenant details page navigation

- Back issue between tenant summary & tenants list page
- Not show the selected tab correctly on tenant details after clicking
back on browser's back button

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-09-23 12:30:18 -05:00
Javier Adriel
51ab9c59ae Update minio/pkg v1.4.0 (#2335) 2022-09-23 12:08:24 -05:00
Aditya Manthramurthy
fc95ab8658 Fix oauth state generation for OIDC login (#2333)
This is a regression from 118cf97e1d when
env var support for passing console configuration from MinIO was
removed.

This change ensures that all MinIO nodes in a cluster are able to verify
state tokens generated by other nodes in the cluster. Without this, it
is necessary to use sticky sessions in a loadbalancer to ensure that
OIDC authorization code login flow steps for a client happens on the
same minio node.

Fixes https://github.com/minio/minio/issues/15527
2022-09-23 10:30:45 -05:00
Daryl White
bebe860903 Updating documentation links to new URLs (#2325)
The new doc site has launched, and all docs have new URLs.
This PR updates the documentation URLs in the Console to point to the
new locations.
2022-09-22 22:37:32 -07:00
Kaan Kabalak
df4679ea55 Fix styling for Create New Path button in Buckets page (#2330)
Fixes #2329
2022-09-21 19:11:58 -05:00
Alex
2263eada70 Release v0.20.3 (#2328)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-09-20 23:54:10 -07:00
Lenin Alevski
368c9ee3d7 InputBoxWrapper automatically add hide/show behavior for password fields (#2327)
Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
2022-09-20 23:13:34 -05:00
jinapurapu
3513a01711 Add Bucket tooltip improvements (#2326) 2022-09-20 19:12:18 -07:00
Lenin Alevski
0af36a5757 Add: Allow to configure env variables during tenant creation (#2322)
Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
2022-09-20 18:58:31 -05:00
Daniel Valdivia
fdd5a94074 Fix NPE on Operator Login with SSO (#2324)
Signed-off-by: Daniel Valdivia
2022-09-20 18:57:48 -05:00
Javier Adriel
17ad2cfd14 Add dummy endpoints for kms integration (#2301)
Add dummy endpoints for kms integration

Implementation will come in another PR
2022-09-20 16:09:30 -07:00
Daniel Valdivia
67f509e2bb Release v0.20.2 (#2321)
Signed-off-by: Daniel Valdivia <hola@danielvaldivia.com>
2022-09-16 16:02:12 -07:00
Benjamin Marte
6102094c9e Adds a logout view which enables minio to logout when using OIDC (#2281)
* added logout view
* Fixed issues that arose after merging with master
* removed unused navigate and merged with master
* changes based on review feedback
Co-authored-by: Alex <33497058+bexsoft@users.noreply.github.com>
Co-authored-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-09-16 14:21:58 -07:00
Lenin Alevski
d84062b1b2 Fix: Labels for Node Selector in Pod Placement (#2320)
Enabling/disabling buttons correctly in pod placement > labels to be
consistent with all other screens in the application

Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
2022-09-16 13:24:45 -07:00
jinapurapu
a878440485 Added permissions guidance on ListBuckets and AddBuckets screens (#2319)
Added helpbox and tooltip guidance on ListBucketsand AddBuckets screens
Added bucketname to resource checking for bucket level config permissions
2022-09-16 13:22:20 -07:00
Kaan Kabalak
cd6e61e93b Don't show Bucket Name input error until field is touched (#2316) 2022-09-16 13:48:02 -05:00
jinapurapu
a77b56b522 Toggle Bucket Naming Rules display by clicking text (#2311) 2022-09-16 13:12:47 -05:00
Cesar Celis Hernandez
6ed5084691 To add missing file for coverage (#2318) 2022-09-15 19:36:00 -05:00
Daniel Valdivia
4ac6ecb558 Return 401 for Login Errors (#2312)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-09-15 15:33:53 -05:00
Alex
41671b4f25 Fixed crash in simple dashboard when one disk has failed (#2314)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-09-15 14:26:00 -05:00
jinapurapu
024ab1212b Add Minio tier type (#2302) 2022-09-15 14:00:39 -05:00
jinapurapu
77f62e11ef Tiers permission UI fix (#2310) 2022-09-15 11:36:30 -05:00
Cesar Celis Hernandez
0960835cd9 To migrate all testcafe (#2309) 2022-09-14 12:22:27 -07:00
Cesar Celis Hernandez
3746dd47f8 To migrate Permissions Tests Part 1 test (#2299)
migrate all-permissions-1
2022-09-12 20:59:33 -04:00
Cesar Celis Hernandez
ce255c5181 To migrate site replication test (#2276)
Migrate site replication test
2022-09-12 20:01:24 -04:00
Alex
7728cc734a Inherits error props to tooltip wrapper child buttons (#2307) 2022-09-11 23:29:30 -07:00
Lenin Alevski
cc581c6a9e fix: login function was returning fixed error (#2308) 2022-09-11 23:28:07 -07:00
Alex
f7b142e74a Replacing all buttons from console with mds (#2303)
Replaces buttons in console to start using MinIO Design System (mds)

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-09-09 17:42:30 -05:00
Harshavardhana
1108cee626 do not add preceding '/' for putRequests (#2306) 2022-09-09 15:33:58 -05:00
Javier Adriel
94fdba5990 Run lint in missing files (#2300) 2022-09-08 11:13:22 -05:00
Cesar Celis Hernandez
524258a9ea To migrate react warning test (#2273) 2022-09-06 17:49:45 -05:00
Alex
c0cf7a6d6a Release v0.20.1 (#2298)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-09-06 14:15:33 -07:00
Daniel Valdivia
f9916d1cd6 Update Site Replication Documentation link (#2297)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-09-06 12:39:14 -05:00
Cesar Celis Hernandez
52512c0ccc To repair the Operator API Tests & Operator UI Tests (#2292) 2022-09-06 09:19:31 -07:00
Lenin Alevski
989f041658 Support for providing Tenant client certificates (#2294) 2022-09-06 10:20:16 -05:00
Cesar Celis Hernandez
2f81b750a3 To repair SSO test (#2295) 2022-09-06 00:12:16 -07:00
Kaan Kabalak
035a5b88c2 Add support for Multiple IDPs on Login screen (#2258) 2022-09-03 11:02:48 -05:00
Alex
7702149962 Added missing prefix for downloads (#2286)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-09-03 10:01:45 -05:00
Alex
f3e24d62ca Fixed Visual height for Sites Replication (#2293) 2022-09-03 01:27:33 -05:00
jinapurapu
d663b9f346 Display configured logger_webhook endpoints (#2279) 2022-09-01 15:23:55 -05:00
Harshavardhana
ae147358b1 upgrade minio-go/v7 v7.0.35 (#2288)
changes LDAP/SSO to send login via
form body instead of query params
2022-08-31 21:59:40 -07:00
Alex
20bc53119e Filtered prefixes in versions list (#2285)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-08-30 18:28:16 -05:00
jinapurapu
3a3a4b2fea Interactive Bucket Naming Rules component (#2262) 2022-08-30 13:02:10 -05:00
Alex
497437729b Select User & Groups Policy modal updates (#2284)
Select User Policy modal updates

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-08-30 12:06:59 -05:00
Harshavardhana
1c37fcf398 update UBI base image to 8.6 2022-08-29 23:48:28 -07:00
Cesar Celis Hernandez
67af66fc55 Format all files after swagger-gen (#2283) 2022-08-29 22:53:50 -05:00
Cesar Celis Hernandez
288c843a17 Catch error in gofmt (#2266) 2022-08-29 19:28:39 -05:00
Cesar Celis Hernandez
9357c2db0e Formatting missing areas with gofmt (#2278)
Co-authored-by: Lenin Alevski <alevsk.8772@gmail.com>
2022-08-29 18:04:09 -04:00
Lenin Alevski
139771f4d4 Fixes and improvements for Tenant Security page (#2252)
- Tenant securityContext was only being applied to first pool
- Fixed style issues on tenant security page to be more consistent
- Added missing FsGroupChangePolicy in the SecurityContextSelector
  component

Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
2022-08-29 15:35:23 -05:00
Alex
b7783aaa1c Removed double border in raw policy / yaml containers (#2277)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-08-26 18:41:28 -05:00
Ashish Kumar Sinha
9821beb1de read license from envt variable (#2259) 2022-08-26 18:09:15 -05:00
Cesar Celis Hernandez
d279f722f8 Migrate reuse golang dependencies (#2275) 2022-08-26 16:57:27 -05:00
Cesar Celis Hernandez
9539a8e18a Migrate semgrep to datacenter (#2271) 2022-08-26 15:30:33 -05:00
Alex
f11b9bff17 Improved policy create policy screen (#2268)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-08-26 13:07:42 -05:00
Aditya Manthramurthy
06c282dd9a Fix config parsing bug with updated madmin helper (#2264) 2022-08-25 10:45:07 -07:00
Cesar Celis Hernandez
3e9fb853d9 Correct gofmt version 1.19 (#2267) 2022-08-25 11:44:55 -05:00
Alex
cd21ad2085 Fixed erratic behavior in configuration pages (#2269)
- Issue with fields being cleared in forms with CSV component present
- Load configuration panels on section change

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2022-08-25 09:22:05 -05:00
Cesar Celis Hernandez
729100ae16 Execute Lint Job with Self Hosted Runner (#2265) 2022-08-24 22:09:07 -05:00
Cesar Celis Hernandez
bcd29a4232 Migrate vulnerable-dependencies-checks to datacenter (#2263) 2022-08-24 19:34:16 -05:00
Minio Trusted
380a9d7faa update go mod tidy
Signed-off-by: Harshavardhana <harsha@minio.io>
2022-08-22 23:59:23 -07:00
Alex
9cd0033504 Release v0.20.0 (#2261)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-08-22 23:27:22 -07:00
Aditya Manthramurthy
483fe77a35 Fix config parsing using updated method (#2251)
Fix config parsing using madmin and mc bump up

- The config parsing client-side logic is updated in madmin-go

- This change also has fixes associated with breakage caused by bumping
up the mc dependency
2022-08-23 00:27:26 -05:00
jinapurapu
1742303ad7 Changed timestamp to date format in widgets CSV download (#2253) 2022-08-22 10:34:49 -05:00
jinapurapu
292fb3920f Created button to download Widget data as CSV or PNG file (#2241) 2022-08-19 12:48:15 -05:00
Javier Adriel
9ed8f11b22 Change register tabs (#2250)
Co-authored-by: Alex <33497058+bexsoft@users.noreply.github.com>
2022-08-17 18:32:10 -05:00
Prakash Senthil Vel
860d8c6b78 UI to delete configured notification targets (#2213) 2022-08-17 15:40:37 -05:00
Alex
99965805a6 Reimplemented DirectPV API in operator console (#2207)
- Updated API to use latest directpv library

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-08-17 13:05:07 -05:00
Alex
7036d1328e Added Color customization to embedded object browser (#2246)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-08-17 11:06:10 -05:00
Lenin Alevski
697910c7b2 fix: buckets browse button was not clickable (#2249)
Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
2022-08-16 18:23:48 -05:00
Kaan Kabalak
64dc605843 Fix inconsistencies in Health Diagnostics UI (#2239) 2022-08-12 22:45:08 -05:00
jinapurapu
75fa88e6e2 Added delay to Audit Log tests to reduce failure (#2245) 2022-08-12 22:44:27 -05:00
Alex
2857b8c586 Release v0.19.5 (#2243) 2022-08-10 20:43:36 -07:00
Alex
b1788c29db Disabled Object Locking button when permissions are not set (#2226)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2022-08-10 22:15:18 -05:00
jinapurapu
2e1401f013 Increased delay to reduce failure of Operator UI test (#2240) 2022-08-10 16:12:55 -05:00
Alex
1e1c11b13c Added FSGroupChangePolicy support to create tenant screen (#2233)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2022-08-10 13:28:15 -05:00
Javier Adriel
25c1c854b1 Add new section to register tenants with API key in operator (#2222) 2022-08-09 13:23:15 -05:00
Javier Adriel
5be2cc1965 Implement register handlers (#2219) 2022-08-09 13:22:53 -05:00
Alex
4aa3f40792 Removed permanent scrollbar in embedded object browser (#2237)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-08-09 12:02:09 -05:00
jinapurapu
3f41a82fd3 Image field fix (#2231) 2022-08-09 11:04:43 -05:00
Harshavardhana
1b641b4222 return bad request instead of 403's (#2229)
S3 API requests '403' as valid error
in some situations when client is probing
the server for valid S3 endpoint.

return '400 Bad Request' instead.
2022-08-08 15:37:01 -05:00
jinapurapu
85aabebbb4 Added text to AddBuckets Helpbox advising to enable versioning to enable retention (#2235)
Added hepbox guidance text to enable versioning in order to set retention on bucket creation
2022-08-08 14:08:08 -05:00
Pedro Juarez
919232261d switch to node version specified in .nvmrc file (#2225) 2022-08-05 17:54:47 -07:00
Harshavardhana
ddd25a20eb update CREDITS and enable builds for go1.19 (#2227) 2022-08-05 10:07:38 -05:00
Harshavardhana
84b8f9d6fa support P-384, P-512 constant time implementations (#2224)
fixes #2223
2022-08-04 15:36:38 -07:00
jinapurapu
46af0ff74c Protocol Logos for Add Tenant - Identity Provider (#2210) 2022-08-04 09:14:38 -07:00
Javier Adriel
b3651ed0a3 Auto register API key once it is retrieved from subnet (#2217) 2022-08-03 09:43:22 -07:00
Alex
78c4fa393a Changed x axis notation to display date indicator in zoom mode (#2221)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-08-02 22:23:27 -07:00
Kaan Kabalak
84c4159062 Fix anchors and update links for License page features (#2220) 2022-08-02 20:30:16 -05:00
Javier Adriel
ac2888fc4e Implement login and api key handlers (#2204) 2022-08-02 10:41:12 -05:00
Alex
c311847dcf Changed wrong button structure un buckets list page (#2218)
Also fixed issue with tests part 3 workflow

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-08-01 22:04:51 -05:00
Harshavardhana
cb6cda7265 fix: crash in operator console for missing fsGroup (#2211)
Bonus: Add support for "fsGroupChangePolicy"
Bonus: keep only github actions in workflow folder
2022-08-01 19:04:00 -07:00
Cesar Celis Hernandez
16fd5470db Correcting response on invalid login attempt (#2216)
Verifying detailed message error from bad login in SSO Test
2022-08-01 18:12:39 -05:00
jiuker
ea0cac2a92 fix:Incorrect template (#2196)
The formatting template is incorrectly formatted.
2022-08-01 17:44:35 -05:00
Alex
33b041ef34 Fixed incompatibility with some base64 strings & React Router v6 (#2208)
* Fixed incompatibility with some base64 strings & React Router v6

This affected Object Browser & certain Cyrillic / Chinese names

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-08-01 15:15:03 -05:00
Garen Chan
b692ea693f Fix error: setMultiBucketReplication healthCheckPeriod not work (#2212) 2022-08-01 13:12:54 -07:00
Cesar Celis Hernandez
fd39e50c08 Updating SSO Error Message on bad login (#2215)
Updating error message on bad sso login
2022-08-01 14:09:07 -05:00
Alex
ad4b9c050a Added DirectPV mode to Operator console (#2203)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-08-01 12:57:31 -05:00
Alex
1deb6371ed Release v0.19.4 (#2209)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-07-29 13:12:41 -07:00
Aditya Manthramurthy
3b11556f4b Fix build after swagger codegen (#2201) 2022-07-28 13:20:16 -07:00
Lenin Alevski
25f719b0e2 TLS Certificates help box and small bug fixes (#2206)
- Added TLSHelpBox component
- fix: Use the right `add` icon component in the security tab to be consistent
- fix: Add/Remove additional certificates button for custom certificates
- fix: Add/Remove additional users button for built-in IDP

Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
2022-07-28 14:18:28 -05:00
Alex
231b63f1b0 Added duration param to speedtest (#2205) 2022-07-27 21:00:54 -05:00
Javier Adriel
e73370cc8c Add dummy subnet handlers (#2198) 2022-07-27 16:34:19 -07:00
Javier Adriel
5d25dd4c06 Improve marketplace test coverage (#2202)
* Improve marketplace test coverage

* gofumpt
2022-07-27 16:33:56 -07:00
Kaan Kabalak
51a8bacc18 Implement WebSockets for Profile download (#2190) 2022-07-26 18:40:24 -07:00
Harshavardhana
db07f546a4 Release v0.19.3
Signed-off-by: Harshavardhana <harsha@minio.io>
2022-07-24 09:51:03 -07:00
Harshavardhana
255cf0bc85 fix: hard regression in console login from v0.19.2 release
fixes #2197
2022-07-24 09:41:55 -07:00
1391 changed files with 32888 additions and 10360 deletions

View File

@@ -25,7 +25,7 @@ jobs:
- reuse-golang-dependencies
- vulnerable-dependencies-checks
- semgrep-static-code-analysis
runs-on: ubuntu-latest
runs-on: [ self-hosted, vm-docker ]
strategy:
matrix:
@@ -85,6 +85,13 @@ jobs:
./replication/coverage/
key: ${{ runner.os }}-replication-coverage-2-${{ github.run_id }}
# To save our replication.out file into an artifact.
# By default, GitHub stores build logs and artifacts for 90 days.
- uses: actions/upload-artifact@v3
with:
name: replication-artifact
path: ./replication/coverage/replication.out
sso-integration:
name: SSO Integration Test
@@ -136,6 +143,10 @@ jobs:
echo "The idea is to build minio image from downloaded repository";
cd $GITHUB_WORKSPACE/minio_repository;
echo "replace github.com/minio/console => ../" >> go.mod
echo "updates to go.mod needed; to update it: go mod tidy"
go mod tidy
echo "Get git version to build MinIO Image";
VERSION=`git rev-parse HEAD`;
echo $VERSION;
@@ -180,6 +191,19 @@ jobs:
- uses: actions/checkout@v2
# To build operator image, we need to clone the repository first
- name: clone https://github.com/minio/operator
uses: actions/checkout@master
with:
# Repository name with owner. For example, actions/checkout
# Default: ${{ github.repository }}
repository: minio/operator
# Relative path under $GITHUB_WORKSPACE to place the repository
# To have two repositories under the same test
path: 'operator_repository'
- uses: actions/cache@v2
name: Go Mod Cache
with:
@@ -193,7 +217,7 @@ jobs:
curl -sLO "https://dl.k8s.io/release/v1.23.1/bin/linux/amd64/kubectl" -o kubectl
chmod +x kubectl
mv kubectl /usr/local/bin
"${GITHUB_WORKSPACE}/.github/workflows/deploy-tenant.sh"
"${GITHUB_WORKSPACE}/tests/deploy-tenant.sh"
echo "start ---> make test-operator-integration";
make test-operator-integration;
@@ -207,7 +231,7 @@ jobs:
lint-job:
name: Checking Lint
runs-on: ${{ matrix.os }}
runs-on: [ self-hosted ]
strategy:
matrix:
go-version: [ 1.18.x ]
@@ -231,7 +255,7 @@ jobs:
vulnerable-dependencies-checks:
name: "Check for vulnerable dependencies"
runs-on: ${{ matrix.os }}
runs-on: self-hosted
strategy:
matrix:
go-version: [ 1.18.x ]
@@ -253,32 +277,34 @@ jobs:
CGO_ENABLED: 0
GO111MODULE: on
run: |
sudo apt install jq -y
sudo sysctl net.ipv6.conf.all.disable_ipv6=0
sudo sysctl net.ipv6.conf.default.disable_ipv6=0
sudo apt install jq -y || apt install jq -y
sudo sysctl net.ipv6.conf.all.disable_ipv6=0 || sysctl net.ipv6.conf.all.disable_ipv6=0
sudo sysctl net.ipv6.conf.default.disable_ipv6=0 || sysctl net.ipv6.conf.default.disable_ipv6=0
nancy_version=$(curl --retry 10 -Ls -o /dev/null -w "%{url_effective}" https://github.com/sonatype-nexus-community/nancy/releases/latest | sed "s/https:\/\/github.com\/sonatype-nexus-community\/nancy\/releases\/tag\///")
curl -L -o nancy https://github.com/sonatype-nexus-community/nancy/releases/download/${nancy_version}/nancy-${nancy_version}-linux-amd64 && chmod +x nancy
go list -deps -json ./... | jq -s 'unique_by(.Module.Path)|.[]|select(has("Module"))|.Module' | ./nancy sleuth
semgrep-static-code-analysis:
name: "semgrep checks"
runs-on: ${{ matrix.os }}
container:
image: "returntocorp/semgrep"
runs-on: self-hosted
strategy:
matrix:
os: [ ubuntu-latest ]
steps:
- name: Check out source code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Scanning code on ${{ matrix.os }}
continue-on-error: false
run: |
# Install semgrep rather than using a container due to:
# https://github.com/actions/checkout/issues/334
sudo apt install -y python3-pip || apt install -y python3-pip
pip3 install semgrep
semgrep --config semgrep.yaml $(pwd)/portal-ui --error
no-warnings-and-make-assets:
name: "React Code Has No Warnings & is Prettified, then Make Assets"
runs-on: ${{ matrix.os }}
runs-on: self-hosted
strategy:
matrix:
go-version: [ 1.18.x ]
@@ -289,12 +315,18 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
id: go
- uses: actions/setup-node@v2
with:
node-version: '17'
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Read .nvmrc
id: node_version
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
- uses: actions/setup-node@v2
with:
node-version: ${{ env.NVMRC }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
@@ -338,7 +370,7 @@ jobs:
reuse-golang-dependencies:
name: reuse golang dependencies
runs-on: ${{ matrix.os }}
runs-on: self-hosted
strategy:
matrix:
go-version: [ 1.18.x ]
@@ -376,7 +408,7 @@ jobs:
- reuse-golang-dependencies
- vulnerable-dependencies-checks
- semgrep-static-code-analysis
runs-on: ${{ matrix.os }}
runs-on: [ self-hosted, vm-docker, xvfb-run ]
strategy:
matrix:
go-version: [ 1.18.x ]
@@ -387,12 +419,18 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
id: go
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Read .nvmrc
id: node_version
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
- uses: actions/setup-node@v2
with:
node-version: ${{ env.NVMRC }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
@@ -434,6 +472,18 @@ jobs:
run: |
make console
- name: Install dependencies
env:
GO111MODULE: on
GOOS: linux
run: |
cd portal-ui; yarn install;
- name: clean-previous-containers-if-any
run: |
docker stop minio || true;
docker container prune -f || true;
- name: Start Console, front-end app and initialize users/policies
run: |
(./console server) & (make initialize-permissions)
@@ -441,7 +491,7 @@ jobs:
- name: Run TestCafe Tests
uses: DevExpress/testcafe-action@latest
with:
args: '"chrome:headless" portal-ui/tests/permissions-1/ --skip-js-errors -c 3'
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-1/ --skip-js-errors -c 3'
- name: Clean up users & policies
run: |
@@ -455,7 +505,7 @@ jobs:
- reuse-golang-dependencies
- vulnerable-dependencies-checks
- semgrep-static-code-analysis
runs-on: ${{ matrix.os }}
runs-on: [ self-hosted, vm-docker, xvfb-run ]
strategy:
matrix:
go-version: [ 1.18.x ]
@@ -466,12 +516,18 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
id: go
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Read .nvmrc
id: node_version
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
- uses: actions/setup-node@v2
with:
node-version: ${{ env.NVMRC }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
@@ -513,6 +569,11 @@ jobs:
run: |
make console
- name: clean-previous-containers-if-any
run: |
docker stop minio || true;
docker container prune -f || true;
- name: Start Console, front-end app and initialize users/policies
run: |
(./console server) & (make initialize-permissions)
@@ -520,7 +581,7 @@ jobs:
- name: Run TestCafe Tests
uses: DevExpress/testcafe-action@latest
with:
args: '"chrome:headless" portal-ui/tests/permissions-2/ --skip-js-errors -c 3'
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-2/ --skip-js-errors -c 3'
- name: Clean up users & policies
run: |
@@ -534,7 +595,7 @@ jobs:
- reuse-golang-dependencies
- vulnerable-dependencies-checks
- semgrep-static-code-analysis
runs-on: ${{ matrix.os }}
runs-on: [ self-hosted, vm-docker, xvfb-run ]
strategy:
matrix:
go-version: [ 1.18.x ]
@@ -545,12 +606,18 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
id: go
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Read .nvmrc
id: node_version
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
- uses: actions/setup-node@v2
with:
node-version: ${{ env.NVMRC }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
@@ -592,6 +659,11 @@ jobs:
run: |
make console
- name: clean-previous-containers-if-any
run: |
docker stop minio || true;
docker container prune -f || true;
- name: Start Console, front-end app and initialize users/policies
run: |
(./console server) & (make initialize-permissions)
@@ -599,7 +671,7 @@ jobs:
- name: Run TestCafe Tests
uses: DevExpress/testcafe-action@latest
with:
args: '"chrome:headless" portal-ui/tests/permissions-3/ --skip-js-errors -c 3'
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-3/ --skip-js-errors -c 3'
- name: Clean up users & policies
run: |
@@ -614,7 +686,7 @@ jobs:
- reuse-golang-dependencies
- vulnerable-dependencies-checks
- semgrep-static-code-analysis
runs-on: ${{ matrix.os }}
runs-on: [ self-hosted, vm-docker, xvfb-run ]
timeout-minutes: 5
strategy:
matrix:
@@ -626,11 +698,14 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
id: go
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Read .nvmrc
id: node_version
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
- uses: actions/setup-node@v2
with:
node-version: ${{ env.NVMRC }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
@@ -667,6 +742,12 @@ jobs:
GOOS: linux
run: |
make console
- name: clean-previous-containers-if-any
run: |
docker stop minio || true;
docker container prune -f || true;
- name: Start Console, front-end app and initialize users/policies
run: |
(./console server) & (make initialize-permissions)
@@ -674,7 +755,7 @@ jobs:
timeout-minutes: 5
uses: DevExpress/testcafe-action@latest
with:
args: '"chrome:headless" portal-ui/tests/permissions-4/ --skip-js-errors'
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-4/ --skip-js-errors'
all-permissions-5:
name: Permissions Tests Part 5
@@ -684,7 +765,7 @@ jobs:
- reuse-golang-dependencies
- vulnerable-dependencies-checks
- semgrep-static-code-analysis
runs-on: ${{ matrix.os }}
runs-on: [ self-hosted, vm-docker, xvfb-run ]
strategy:
matrix:
go-version: [ 1.18.x ]
@@ -695,11 +776,14 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
id: go
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Read .nvmrc
id: node_version
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
- uses: actions/setup-node@v2
with:
node-version: ${{ env.NVMRC }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
@@ -736,6 +820,12 @@ jobs:
GOOS: linux
run: |
make console
- name: clean-previous-containers-if-any
run: |
docker stop minio || true;
docker container prune -f || true;
- name: Start Console, front-end app and initialize users/policies
run: |
(./console server) & (make initialize-permissions)
@@ -743,7 +833,7 @@ jobs:
timeout-minutes: 5
uses: DevExpress/testcafe-action@latest
with:
args: '"chrome:headless" portal-ui/tests/permissions-5/ --skip-js-errors'
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-5/ --skip-js-errors'
all-permissions-6:
name: Permissions Tests Part 6
@@ -753,7 +843,7 @@ jobs:
- reuse-golang-dependencies
- vulnerable-dependencies-checks
- semgrep-static-code-analysis
runs-on: ${{ matrix.os }}
runs-on: [ self-hosted, vm-docker, xvfb-run ]
strategy:
matrix:
go-version: [ 1.18.x ]
@@ -764,11 +854,14 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
id: go
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Read .nvmrc
id: node_version
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
- uses: actions/setup-node@v2
with:
node-version: ${{ env.NVMRC }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
@@ -805,6 +898,12 @@ jobs:
GOOS: linux
run: |
make console
- name: clean-previous-containers-if-any
run: |
docker stop minio || true;
docker container prune -f || true;
- name: Start Console, front-end app and initialize users/policies
run: |
(./console server) & (make initialize-permissions)
@@ -812,7 +911,7 @@ jobs:
timeout-minutes: 5
uses: DevExpress/testcafe-action@latest
with:
args: '"chrome:headless" portal-ui/tests/permissions-6/ --skip-js-errors'
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-6/ --skip-js-errors'
all-permissions-7:
name: Permissions Tests Part 7
@@ -822,7 +921,7 @@ jobs:
- reuse-golang-dependencies
- vulnerable-dependencies-checks
- semgrep-static-code-analysis
runs-on: ${{ matrix.os }}
runs-on: [ self-hosted, vm-docker, xvfb-run ]
strategy:
matrix:
go-version: [ 1.18.x ]
@@ -833,11 +932,14 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
id: go
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Read .nvmrc
id: node_version
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
- uses: actions/setup-node@v2
with:
node-version: ${{ env.NVMRC }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
@@ -874,6 +976,12 @@ jobs:
GOOS: linux
run: |
make console
- name: clean-previous-containers-if-any
run: |
docker stop minio || true;
docker container prune -f || true;
- name: Start Console, front-end app and initialize users/policies
run: |
(./console server) & (make initialize-permissions)
@@ -881,7 +989,7 @@ jobs:
timeout-minutes: 5
uses: DevExpress/testcafe-action@latest
with:
args: '"chrome:headless" portal-ui/tests/permissions-7/ --skip-js-errors'
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-7/ --skip-js-errors'
all-permissions-8:
name: Permissions Tests Part 8
@@ -891,7 +999,7 @@ jobs:
- reuse-golang-dependencies
- vulnerable-dependencies-checks
- semgrep-static-code-analysis
runs-on: ${{ matrix.os }}
runs-on: [ self-hosted, vm-docker, xvfb-run ]
strategy:
matrix:
go-version: [ 1.18.x ]
@@ -902,11 +1010,14 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
id: go
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Read .nvmrc
id: node_version
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
- uses: actions/setup-node@v2
with:
node-version: ${{ env.NVMRC }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
@@ -943,6 +1054,12 @@ jobs:
GOOS: linux
run: |
make console
- name: clean-previous-containers-if-any
run: |
docker stop minio || true;
docker container prune -f || true;
- name: Start Console, front-end app and initialize users/policies
run: |
(./console server) & (make initialize-permissions)
@@ -950,7 +1067,7 @@ jobs:
timeout-minutes: 5
uses: DevExpress/testcafe-action@latest
with:
args: '"chrome:headless" portal-ui/tests/permissions-8/ --skip-js-errors'
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-8/ --skip-js-errors'
all-permissions-9:
name: Permissions Tests Part 9
@@ -960,7 +1077,7 @@ jobs:
- reuse-golang-dependencies
- vulnerable-dependencies-checks
- semgrep-static-code-analysis
runs-on: ${{ matrix.os }}
runs-on: [ self-hosted, vm-docker, xvfb-run ]
strategy:
matrix:
go-version: [ 1.18.x ]
@@ -971,12 +1088,18 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
id: go
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Read .nvmrc
id: node_version
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
- uses: actions/setup-node@v2
with:
node-version: ${{ env.NVMRC }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
@@ -1018,6 +1141,11 @@ jobs:
run: |
make console
- name: clean-previous-containers-if-any
run: |
docker stop minio || true;
docker container prune -f || true;
- name: Start Console, front-end app and initialize users/policies
run: |
(./console server) & (make initialize-permissions)
@@ -1025,7 +1153,7 @@ jobs:
- name: Run TestCafe Tests
uses: DevExpress/testcafe-action@latest
with:
args: '"chrome:headless" portal-ui/tests/permissions-9/ --skip-js-errors -c 3'
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-9/ --skip-js-errors -c 3'
- name: Clean up users & policies
run: |
@@ -1050,11 +1178,31 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
id: go
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Check out code into the Go module directory
uses: actions/checkout@v2
# To build operator image, we need to clone the repository first
- name: clone https://github.com/minio/operator
uses: actions/checkout@master
with:
# Repository name with owner. For example, actions/checkout
# Default: ${{ github.repository }}
repository: minio/operator
# Relative path under $GITHUB_WORKSPACE to place the repository
# To have two repositories under the same test
path: 'operator_repository'
- name: Read .nvmrc
id: node_version
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
- uses: actions/setup-node@v2
with:
node-version: ${{ env.NVMRC }}
- uses: actions/cache@v2
name: Go Mod Cache
with:
@@ -1666,6 +1814,12 @@ jobs:
./pkg/coverage/
key: ${{ runner.os }}-coverage-pkg-2-${{ github.run_id }}
# Get the replication.out file from the artifact since this is working for self host runner.
- uses: actions/download-artifact@v3
with:
name: replication-artifact
path: replication/coverage
- name: Get coverage
run: |
echo "change directory to gocovmerge"

View File

@@ -5,6 +5,12 @@ linters-settings:
misspell:
locale: US
goheader:
values:
regexp:
copyright-holder: Copyright \(c\) (20\d\d\-20\d\d)|2021|({{year}})
template-path: .license.tmpl
linters:
disable-all: true
enable:
@@ -28,27 +34,21 @@ linters:
- tenv
- durationcheck
linters-settings:
goheader:
values:
regexp:
copyright-holder: Copyright \(c\) (20\d\d\-20\d\d)|2021|({{year}})
template-path: .license.tmpl
service:
golangci-lint-version: 1.43.0 # use the fixed version to not introduce new linters unexpectedly
issues:
exclude-use-default: false
exclude:
- should have a package comment
# TODO(y4m4): Remove once all exported ident. have comments!
- comment on exported function
- comment on exported type
- should have comment
- use leading k in Go names
- comment on exported const
- should have a package comment
# TODO(y4m4): Remove once all exported ident. have comments!
- comment on exported function
- comment on exported type
- should have comment
- use leading k in Go names
- comment on exported const
run:
skip-dirs:
- pkg/clientgen
- pkg/apis/networking.gke.io
- restapi/operations

1
.nvmrc Normal file
View File

@@ -0,0 +1 @@
17

2768
CREDITS

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,5 @@
FROM node:17 as uilayer
ARG NODE_VERSION
FROM node:$NODE_VERSION as uilayer
WORKDIR /app

View File

@@ -1,4 +1,5 @@
FROM node:17 as uilayer
ARG NODE_VERSION
FROM node:$NODE_VERSION as uilayer
WORKDIR /app

View File

@@ -1,4 +1,4 @@
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.5
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.6
ARG TAG

View File

@@ -6,6 +6,7 @@ BUILD_TIME:=$(shell date 2>/dev/null)
TAG ?= "minio/console:$(BUILD_VERSION)-dev"
MINIO_VERSION ?= "quay.io/minio/minio:latest"
TARGET_BUCKET ?= "target"
NODE_VERSION := $(shell cat .nvmrc)
default: console
@@ -15,22 +16,19 @@ console:
@(GO111MODULE=on CGO_ENABLED=0 go build -trimpath --tags=kqueue,operator --ldflags "-s -w" -o console ./cmd/console)
k8sdev:
@docker build -t $(TAG) --build-arg build_version=$(BUILD_VERSION) --build-arg build_time='$(BUILD_TIME)' .
@docker build -t $(TAG) --build-arg build_version=$(BUILD_VERSION) --build-arg build_time='$(BUILD_TIME)' --build-arg NODE_VERSION='$(NODE_VERSION)' .
@kind load docker-image $(TAG)
@echo "Done, now restart your console deployment"
getdeps:
@mkdir -p ${GOPATH}/bin
@echo "Installing golangci-lint" && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.45.2
@echo "Installing golangci-lint" && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin
verifiers: getdeps fmt lint
fmt:
@echo "Running $@ check"
@GO111MODULE=on gofmt -d restapi/
@GO111MODULE=on gofmt -d pkg/
@GO111MODULE=on gofmt -d cmd/
@GO111MODULE=on gofmt -d cluster/
@(env bash $(PWD)/verify-gofmt.sh)
crosscompile:
@(env bash $(PWD)/cross-compile.sh $(arg1))
@@ -45,9 +43,13 @@ install: console
@mkdir -p $(GOPATH)/bin && cp -f $(PWD)/console $(GOPATH)/bin/console
@echo "Installation successful. To learn more, try \"console --help\"."
swagger-gen: clean-swagger swagger-console swagger-operator
swagger-gen: clean-swagger swagger-console swagger-operator apply-gofmt
@echo "Done Generating swagger server code from yaml"
apply-gofmt:
@echo "Applying gofmt to all generated an existing files"
@GO111MODULE=on gofmt -w .
clean-swagger:
@echo "cleaning"
@rm -rf models
@@ -63,7 +65,8 @@ swagger-operator:
@swagger generate server -A operator --main-package=operator --server-package=operatorapi --exclude-main -P models.Principal -f ./swagger-operator.yml -r NOTICE
assets:
@(cd portal-ui; yarn install --prefer-offline; make build-static; yarn prettier --write . --loglevel warn; cd ..)
@(if [ -f "${NVM_DIR}/nvm.sh" ]; then \. "${NVM_DIR}/nvm.sh" && nvm install && nvm use && npm install -g yarn ; fi &&\
cd portal-ui; yarn install --prefer-offline; make build-static; yarn prettier --write . --loglevel warn; cd ..)
test-integration:
@(docker stop pgsqlcontainer || true)
@@ -261,7 +264,7 @@ clean:
@rm -vf console
docker:
@docker buildx build --output=type=docker --platform linux/amd64 -t $(TAG) --build-arg build_version=$(BUILD_VERSION) --build-arg build_time='$(BUILD_TIME)' .
@docker buildx build --output=type=docker --platform linux/amd64 -t $(TAG) --build-arg build_version=$(BUILD_VERSION) --build-arg build_time='$(BUILD_TIME)' --build-arg NODE_VERSION='$(NODE_VERSION)' .
release: swagger-gen
@echo "Generating Release: $(RELEASE)"

View File

@@ -17,6 +17,7 @@
package cluster
import (
directpvclient "github.com/minio/directpv/pkg/client"
operator "github.com/minio/operator/pkg/client/clientset/versioned"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
@@ -63,3 +64,13 @@ func OperatorClient(token string) (*operator.Clientset, error) {
func K8sClient(token string) (*kubernetes.Clientset, error) {
return kubernetes.NewForConfig(GetK8sConfig(token))
}
// DirectPV interfaces required to fetch information
func DirectPVDriveInterface(token string) (*directpvclient.DirectCSIDriveInterface, error) {
return directpvclient.DirectCSIDriveInterfaceForConfig(GetK8sConfig(token))
}
func DirectPVVolumeInterface(token string) (*directpvclient.DirectCSIVolumeInterface, error) {
return directpvclient.DirectCSIVolumeInterfaceForConfig(GetK8sConfig(token))
}

View File

@@ -98,7 +98,7 @@ func buildServer() (*restapi.Server, error) {
return nil, err
}
api := operations.NewConsoleAPI(swaggerSpec, nil)
api := operations.NewConsoleAPI(swaggerSpec)
api.Logger = restapi.LogInfo
server := restapi.NewServer(api)

82
go.mod
View File

@@ -18,33 +18,41 @@ require (
github.com/google/uuid v1.3.0
github.com/gorilla/websocket v1.5.0
github.com/jessevdk/go-flags v1.5.0
github.com/klauspost/compress v1.15.1
github.com/minio/cli v1.22.0
github.com/klauspost/compress v1.15.9
github.com/minio/cli v1.23.0
github.com/minio/directpv v1.4.4-0.20220805090942-948ca4731651
github.com/minio/highwayhash v1.0.2
github.com/minio/kes v0.19.2
github.com/minio/madmin-go v1.4.3
github.com/minio/mc v0.0.0-20220705180830-01b87ecc02ff
github.com/minio/minio-go/v7 v7.0.30
github.com/minio/operator v0.0.0-20220414212219-ba4c097324b2
github.com/minio/pkg v1.1.23
github.com/minio/selfupdate v0.4.0
github.com/minio/madmin-go v1.4.26
github.com/minio/mc v0.0.0-20220818165341-8c239d16aa37
github.com/minio/minio-go/v7 v7.0.35
github.com/minio/operator v0.0.0-20220902184351-21e4073132b0
github.com/minio/pkg v1.4.0
github.com/minio/selfupdate v0.5.0
github.com/mitchellh/go-homedir v1.1.0
github.com/rs/xid v1.4.0
github.com/secure-io/sio-go v0.3.1
github.com/stretchr/testify v1.7.1
github.com/tidwall/gjson v1.14.0
github.com/stretchr/testify v1.8.0
github.com/tidwall/gjson v1.14.2
github.com/unrolled/secure v1.10.0
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e
golang.org/x/net v0.0.0-20220421235706-1d1ef9303861
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa
golang.org/x/net v0.0.0-20220722155237-a158d28d115b
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.23.5
k8s.io/apimachinery v0.23.5
k8s.io/client-go v0.23.5
k8s.io/api v0.24.3
k8s.io/apimachinery v0.24.3
k8s.io/client-go v0.24.3
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9
)
require (
cloud.google.com/go v0.99.0 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.11.18 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.13 // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect
github.com/beorn7/perks v1.0.1 // indirect
@@ -59,8 +67,11 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/emicklei/go-restful/v3 v3.8.0 // indirect
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/form3tech-oss/jwt-go v3.2.3+incompatible // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/gdamore/encoding v1.0.0 // indirect
github.com/gdamore/tcell/v2 v2.4.1-0.20210905002822-f057f0a857a1 // indirect
github.com/go-logr/logr v1.2.2 // indirect
@@ -72,17 +83,20 @@ require (
github.com/goccy/go-json v0.9.4 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.7 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.0.11 // indirect
github.com/klauspost/cpuid/v2 v2.1.0 // indirect
github.com/lestrrat-go/backoff/v2 v2.0.8 // indirect
github.com/lestrrat-go/blackmagic v1.0.0 // indirect
github.com/lestrrat-go/httpcc v1.0.0 // indirect
@@ -91,12 +105,15 @@ require (
github.com/lestrrat-go/option v1.0.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-ieproxy v0.0.1 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mb0/glob v0.0.0-20160210091149-1eb79d2de6c4 // indirect
github.com/miekg/dns v1.1.48 // indirect
github.com/minio/colorjson v1.0.2 // indirect
github.com/minio/filepath v1.0.0 // indirect
github.com/minio/md5-simd v1.1.2 // indirect
@@ -108,16 +125,18 @@ require (
github.com/muesli/ansi v0.0.0-20211031195517-c9f0611b6c70 // indirect
github.com/muesli/reflow v0.3.0 // indirect
github.com/muesli/termenv v0.11.1-0.20220212125758-44cd13922739 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/navidys/tvxwidgets v0.1.0 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/philhofer/fwd v1.1.2-0.20210722190033-5c56ac6d0bb9 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pkg/xattr v0.4.5 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/posener/complete v1.2.3 // indirect
github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect
github.com/prometheus/client_golang v1.12.1 // indirect
github.com/prometheus/client_golang v1.12.2 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.33.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
@@ -125,8 +144,14 @@ require (
github.com/rivo/tview v0.0.0-20220216162559-96063d6082f3 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/rjeczalik/notify v0.9.2 // indirect
github.com/shirou/gopsutil/v3 v3.22.2 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/shirou/gopsutil/v3 v3.22.7 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.10.0 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
github.com/tinylib/msgp v1.1.7-0.20211026165309-e818a1881b0e // indirect
@@ -136,25 +161,30 @@ require (
go.etcd.io/etcd/api/v3 v3.5.2 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.2 // indirect
go.etcd.io/etcd/client/v3 v3.5.2 // indirect
go.mongodb.org/mongo-driver v1.8.4 // indirect
go.mongodb.org/mongo-driver v1.9.1 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.21.0 // indirect
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20220224211638-0e9765cccd65 // indirect
golang.org/x/tools v0.1.10 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20220302033224-9aa15565e42a // indirect
google.golang.org/grpc v1.44.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/h2non/filetype.v1 v1.0.5 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.66.4 // indirect
gopkg.in/ini.v1 v1.66.6 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/klog/v2 v2.40.1 // indirect
k8s.io/kube-openapi v0.0.0-20220124234850-424119656bbf // indirect
k8s.io/apiextensions-apiserver v0.24.3 // indirect
k8s.io/klog/v2 v2.60.1 // indirect
k8s.io/kube-openapi v0.0.0-20220627174259-011e075b9cb8 // indirect
sigs.k8s.io/controller-runtime v0.11.1 // indirect
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect

1137
go.sum

File diff suppressed because it is too large Load Diff

View File

@@ -71,7 +71,7 @@ func initConsoleServer() (*restapi.Server, error) {
restapi.LogInfo = noLog
restapi.LogError = noLog
api := operations.NewConsoleAPI(swaggerSpec, nil)
api := operations.NewConsoleAPI(swaggerSpec)
api.Logger = noLog
server := restapi.NewServer(api)

View File

@@ -20,18 +20,16 @@ import (
"archive/zip"
"bytes"
"fmt"
"io"
"log"
"net/http"
"strings"
"testing"
"time"
"github.com/gorilla/websocket"
"github.com/stretchr/testify/assert"
)
func TestStartProfiling(t *testing.T) {
testAsser := assert.New(t)
testAssert := assert.New(t)
tests := []struct {
name string
@@ -58,53 +56,28 @@ func TestStartProfiling(t *testing.T) {
"profile-127.0.0.1:9000-mutex-before.pprof": false,
}
client := &http.Client{
Timeout: 3 * time.Second,
}
wsDestination := "/ws/profile?types=cpu,mem,block,mutex,trace,threads,goroutines"
wsFinalURL := fmt.Sprintf("ws://localhost:9090%s", wsDestination)
destination := "/api/v1/profiling/start"
finalURL := fmt.Sprintf("http://localhost:9090%s", destination)
request, err := http.NewRequest("POST", finalURL, strings.NewReader("{\"type\":\"cpu,mem,block,mutex,trace,threads,goroutines\"}"))
ws, _, err := websocket.DefaultDialer.Dial(wsFinalURL, nil)
if err != nil {
log.Println(err)
return
}
defer ws.Close()
_, zipFileBytes, err := ws.ReadMessage()
if err != nil {
log.Println(err)
return
}
request.Header.Add("Cookie", fmt.Sprintf("token=%s", token))
request.Header.Add("Content-Type", "application/json")
response, err := client.Do(request)
testAsser.Nil(err, fmt.Sprintf("%s returned an error: %v", tt.name, err))
testAsser.Equal(201, response.StatusCode)
time.Sleep(5 * time.Second)
destination = "/api/v1/profiling/stop"
finalURL = fmt.Sprintf("http://localhost:9090%s", destination)
request, err = http.NewRequest("POST", finalURL, nil)
if err != nil {
log.Println(err)
return
}
request.Header.Add("Cookie", fmt.Sprintf("token=%s", token))
request.Header.Add("Content-Type", "application/json")
response, err = client.Do(request)
testAsser.Nil(err, fmt.Sprintf("%s returned an error: %v", tt.name, err))
testAsser.Equal(200, response.StatusCode)
zipFileBytes, err := io.ReadAll(response.Body)
if err != nil {
testAsser.Nil(err, fmt.Sprintf("%s returned an error: %v", tt.name, err))
}
filetype := http.DetectContentType(zipFileBytes)
testAsser.Equal("application/zip", filetype)
testAssert.Equal("application/zip", filetype)
zipReader, err := zip.NewReader(bytes.NewReader(zipFileBytes), int64(len(zipFileBytes)))
if err != nil {
testAsser.Nil(err, fmt.Sprintf("%s returned an error: %v", tt.name, err))
testAssert.Nil(err, fmt.Sprintf("%s returned an error: %v", tt.name, err))
}
// Read all the files from zip archive
@@ -113,7 +86,7 @@ func TestStartProfiling(t *testing.T) {
}
for k, v := range files {
testAsser.Equal(true, v, fmt.Sprintf("%s : compressed file expected to have %v file inside", tt.name, k))
testAssert.Equal(true, v, fmt.Sprintf("%s : compressed file expected to have %v file inside", tt.name, k))
}
})
}

View File

@@ -15,7 +15,7 @@ spec:
serviceAccountName: console-sa
containers:
- name: console
image: 'minio/console:v0.19.2'
image: 'minio/console:v0.20.4'
imagePullPolicy: "IfNotPresent"
env:
- name: CONSOLE_OPERATOR_MODE

View File

@@ -32,7 +32,7 @@ spec:
spec:
containers:
- name: console
image: 'minio/console:v0.19.2'
image: 'minio/console:v0.20.4'
imagePullPolicy: "IfNotPresent"
env:
- name: CONSOLE_MINIO_SERVER

View File

@@ -58,6 +58,9 @@ type CreateTenantRequest struct {
// encryption
Encryption *EncryptionConfiguration `json:"encryption,omitempty"`
// environment variables
EnvironmentVariables []*EnvironmentVariable `json:"environmentVariables"`
// erasure coding parity
ErasureCodingParity int64 `json:"erasureCodingParity,omitempty"`
@@ -85,8 +88,8 @@ type CreateTenantRequest struct {
// log search configuration
LogSearchConfiguration *LogSearchConfiguration `json:"logSearchConfiguration,omitempty"`
// mounth path
MounthPath string `json:"mounth_path,omitempty"`
// mount path
MountPath string `json:"mount_path,omitempty"`
// name
// Required: true
@@ -123,6 +126,10 @@ func (m *CreateTenantRequest) Validate(formats strfmt.Registry) error {
res = append(res, err)
}
if err := m.validateEnvironmentVariables(formats); err != nil {
res = append(res, err)
}
if err := m.validateIdp(formats); err != nil {
res = append(res, err)
}
@@ -199,6 +206,32 @@ func (m *CreateTenantRequest) validateEncryption(formats strfmt.Registry) error
return nil
}
func (m *CreateTenantRequest) validateEnvironmentVariables(formats strfmt.Registry) error {
if swag.IsZero(m.EnvironmentVariables) { // not required
return nil
}
for i := 0; i < len(m.EnvironmentVariables); i++ {
if swag.IsZero(m.EnvironmentVariables[i]) { // not required
continue
}
if m.EnvironmentVariables[i] != nil {
if err := m.EnvironmentVariables[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("environmentVariables" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("environmentVariables" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *CreateTenantRequest) validateIdp(formats strfmt.Registry) error {
if swag.IsZero(m.Idp) { // not required
return nil
@@ -355,6 +388,10 @@ func (m *CreateTenantRequest) ContextValidate(ctx context.Context, formats strfm
res = append(res, err)
}
if err := m.contextValidateEnvironmentVariables(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateIdp(ctx, formats); err != nil {
res = append(res, err)
}
@@ -417,6 +454,26 @@ func (m *CreateTenantRequest) contextValidateEncryption(ctx context.Context, for
return nil
}
func (m *CreateTenantRequest) contextValidateEnvironmentVariables(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.EnvironmentVariables); i++ {
if m.EnvironmentVariables[i] != nil {
if err := m.EnvironmentVariables[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("environmentVariables" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("environmentVariables" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *CreateTenantRequest) contextValidateIdp(ctx context.Context, formats strfmt.Registry) error {
if m.Idp != nil {

View File

@@ -29,10 +29,10 @@ import (
"github.com/go-openapi/swag"
)
// DirectCSIDriveInfo direct c s i drive info
// DirectPVDriveInfo direct p v drive info
//
// swagger:model directCSIDriveInfo
type DirectCSIDriveInfo struct {
// swagger:model directPVDriveInfo
type DirectPVDriveInfo struct {
// allocated
Allocated int64 `json:"allocated,omitempty"`
@@ -56,18 +56,18 @@ type DirectCSIDriveInfo struct {
Volumes int64 `json:"volumes,omitempty"`
}
// Validate validates this direct c s i drive info
func (m *DirectCSIDriveInfo) Validate(formats strfmt.Registry) error {
// Validate validates this direct p v drive info
func (m *DirectPVDriveInfo) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this direct c s i drive info based on context it is used
func (m *DirectCSIDriveInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
// ContextValidate validates this direct p v drive info based on context it is used
func (m *DirectPVDriveInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *DirectCSIDriveInfo) MarshalBinary() ([]byte, error) {
func (m *DirectPVDriveInfo) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@@ -75,8 +75,8 @@ func (m *DirectCSIDriveInfo) MarshalBinary() ([]byte, error) {
}
// UnmarshalBinary interface implementation
func (m *DirectCSIDriveInfo) UnmarshalBinary(b []byte) error {
var res DirectCSIDriveInfo
func (m *DirectPVDriveInfo) UnmarshalBinary(b []byte) error {
var res DirectPVDriveInfo
if err := swag.ReadJSON(b, &res); err != nil {
return err
}

View File

@@ -29,10 +29,10 @@ import (
"github.com/go-openapi/swag"
)
// DirectCSIVolumeInfo direct c s i volume info
// DirectPVVolumeInfo direct p v volume info
//
// swagger:model directCSIVolumeInfo
type DirectCSIVolumeInfo struct {
// swagger:model directPVVolumeInfo
type DirectPVVolumeInfo struct {
// capacity
Capacity int64 `json:"capacity,omitempty"`
@@ -47,18 +47,18 @@ type DirectCSIVolumeInfo struct {
Volume string `json:"volume,omitempty"`
}
// Validate validates this direct c s i volume info
func (m *DirectCSIVolumeInfo) Validate(formats strfmt.Registry) error {
// Validate validates this direct p v volume info
func (m *DirectPVVolumeInfo) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this direct c s i volume info based on context it is used
func (m *DirectCSIVolumeInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
// ContextValidate validates this direct p v volume info based on context it is used
func (m *DirectPVVolumeInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *DirectCSIVolumeInfo) MarshalBinary() ([]byte, error) {
func (m *DirectPVVolumeInfo) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@@ -66,8 +66,8 @@ func (m *DirectCSIVolumeInfo) MarshalBinary() ([]byte, error) {
}
// UnmarshalBinary interface implementation
func (m *DirectCSIVolumeInfo) UnmarshalBinary(b []byte) error {
var res DirectCSIVolumeInfo
func (m *DirectPVVolumeInfo) UnmarshalBinary(b []byte) error {
var res DirectPVVolumeInfo
if err := swag.ReadJSON(b, &res); err != nil {
return err
}

View File

@@ -0,0 +1,70 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// EnvironmentConstants environment constants
//
// swagger:model environmentConstants
type EnvironmentConstants struct {
// max concurrent downloads
MaxConcurrentDownloads int64 `json:"maxConcurrentDownloads,omitempty"`
// max concurrent uploads
MaxConcurrentUploads int64 `json:"maxConcurrentUploads,omitempty"`
}
// Validate validates this environment constants
func (m *EnvironmentConstants) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this environment constants based on context it is used
func (m *EnvironmentConstants) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *EnvironmentConstants) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *EnvironmentConstants) UnmarshalBinary(b []byte) error {
var res EnvironmentConstants
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -31,17 +31,17 @@ import (
"github.com/go-openapi/swag"
)
// FormatDirectCSIDrivesResponse format direct c s i drives response
// FormatDirectPVDrivesResponse format direct p v drives response
//
// swagger:model formatDirectCSIDrivesResponse
type FormatDirectCSIDrivesResponse struct {
// swagger:model formatDirectPVDrivesResponse
type FormatDirectPVDrivesResponse struct {
// format issues list
FormatIssuesList []*CsiFormatErrorResponse `json:"formatIssuesList"`
FormatIssuesList []*PvFormatErrorResponse `json:"formatIssuesList"`
}
// Validate validates this format direct c s i drives response
func (m *FormatDirectCSIDrivesResponse) Validate(formats strfmt.Registry) error {
// Validate validates this format direct p v drives response
func (m *FormatDirectPVDrivesResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateFormatIssuesList(formats); err != nil {
@@ -54,7 +54,7 @@ func (m *FormatDirectCSIDrivesResponse) Validate(formats strfmt.Registry) error
return nil
}
func (m *FormatDirectCSIDrivesResponse) validateFormatIssuesList(formats strfmt.Registry) error {
func (m *FormatDirectPVDrivesResponse) validateFormatIssuesList(formats strfmt.Registry) error {
if swag.IsZero(m.FormatIssuesList) { // not required
return nil
}
@@ -80,8 +80,8 @@ func (m *FormatDirectCSIDrivesResponse) validateFormatIssuesList(formats strfmt.
return nil
}
// ContextValidate validate this format direct c s i drives response based on the context it is used
func (m *FormatDirectCSIDrivesResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
// ContextValidate validate this format direct p v drives response based on the context it is used
func (m *FormatDirectPVDrivesResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateFormatIssuesList(ctx, formats); err != nil {
@@ -94,7 +94,7 @@ func (m *FormatDirectCSIDrivesResponse) ContextValidate(ctx context.Context, for
return nil
}
func (m *FormatDirectCSIDrivesResponse) contextValidateFormatIssuesList(ctx context.Context, formats strfmt.Registry) error {
func (m *FormatDirectPVDrivesResponse) contextValidateFormatIssuesList(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.FormatIssuesList); i++ {
@@ -115,7 +115,7 @@ func (m *FormatDirectCSIDrivesResponse) contextValidateFormatIssuesList(ctx cont
}
// MarshalBinary interface implementation
func (m *FormatDirectCSIDrivesResponse) MarshalBinary() ([]byte, error) {
func (m *FormatDirectPVDrivesResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@@ -123,8 +123,8 @@ func (m *FormatDirectCSIDrivesResponse) MarshalBinary() ([]byte, error) {
}
// UnmarshalBinary interface implementation
func (m *FormatDirectCSIDrivesResponse) UnmarshalBinary(b []byte) error {
var res FormatDirectCSIDrivesResponse
func (m *FormatDirectPVDrivesResponse) UnmarshalBinary(b []byte) error {
var res FormatDirectPVDrivesResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}

View File

@@ -31,17 +31,17 @@ import (
"github.com/go-openapi/swag"
)
// GetDirectCSIDriveListResponse get direct c s i drive list response
// GetDirectPVDriveListResponse get direct p v drive list response
//
// swagger:model getDirectCSIDriveListResponse
type GetDirectCSIDriveListResponse struct {
// swagger:model getDirectPVDriveListResponse
type GetDirectPVDriveListResponse struct {
// drives
Drives []*DirectCSIDriveInfo `json:"drives"`
Drives []*DirectPVDriveInfo `json:"drives"`
}
// Validate validates this get direct c s i drive list response
func (m *GetDirectCSIDriveListResponse) Validate(formats strfmt.Registry) error {
// Validate validates this get direct p v drive list response
func (m *GetDirectPVDriveListResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateDrives(formats); err != nil {
@@ -54,7 +54,7 @@ func (m *GetDirectCSIDriveListResponse) Validate(formats strfmt.Registry) error
return nil
}
func (m *GetDirectCSIDriveListResponse) validateDrives(formats strfmt.Registry) error {
func (m *GetDirectPVDriveListResponse) validateDrives(formats strfmt.Registry) error {
if swag.IsZero(m.Drives) { // not required
return nil
}
@@ -80,8 +80,8 @@ func (m *GetDirectCSIDriveListResponse) validateDrives(formats strfmt.Registry)
return nil
}
// ContextValidate validate this get direct c s i drive list response based on the context it is used
func (m *GetDirectCSIDriveListResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
// ContextValidate validate this get direct p v drive list response based on the context it is used
func (m *GetDirectPVDriveListResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateDrives(ctx, formats); err != nil {
@@ -94,7 +94,7 @@ func (m *GetDirectCSIDriveListResponse) ContextValidate(ctx context.Context, for
return nil
}
func (m *GetDirectCSIDriveListResponse) contextValidateDrives(ctx context.Context, formats strfmt.Registry) error {
func (m *GetDirectPVDriveListResponse) contextValidateDrives(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Drives); i++ {
@@ -115,7 +115,7 @@ func (m *GetDirectCSIDriveListResponse) contextValidateDrives(ctx context.Contex
}
// MarshalBinary interface implementation
func (m *GetDirectCSIDriveListResponse) MarshalBinary() ([]byte, error) {
func (m *GetDirectPVDriveListResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@@ -123,8 +123,8 @@ func (m *GetDirectCSIDriveListResponse) MarshalBinary() ([]byte, error) {
}
// UnmarshalBinary interface implementation
func (m *GetDirectCSIDriveListResponse) UnmarshalBinary(b []byte) error {
var res GetDirectCSIDriveListResponse
func (m *GetDirectPVDriveListResponse) UnmarshalBinary(b []byte) error {
var res GetDirectPVDriveListResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}

View File

@@ -31,17 +31,17 @@ import (
"github.com/go-openapi/swag"
)
// GetDirectCSIVolumeListResponse get direct c s i volume list response
// GetDirectPVVolumeListResponse get direct p v volume list response
//
// swagger:model getDirectCSIVolumeListResponse
type GetDirectCSIVolumeListResponse struct {
// swagger:model getDirectPVVolumeListResponse
type GetDirectPVVolumeListResponse struct {
// volumes
Volumes []*DirectCSIVolumeInfo `json:"volumes"`
Volumes []*DirectPVVolumeInfo `json:"volumes"`
}
// Validate validates this get direct c s i volume list response
func (m *GetDirectCSIVolumeListResponse) Validate(formats strfmt.Registry) error {
// Validate validates this get direct p v volume list response
func (m *GetDirectPVVolumeListResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateVolumes(formats); err != nil {
@@ -54,7 +54,7 @@ func (m *GetDirectCSIVolumeListResponse) Validate(formats strfmt.Registry) error
return nil
}
func (m *GetDirectCSIVolumeListResponse) validateVolumes(formats strfmt.Registry) error {
func (m *GetDirectPVVolumeListResponse) validateVolumes(formats strfmt.Registry) error {
if swag.IsZero(m.Volumes) { // not required
return nil
}
@@ -80,8 +80,8 @@ func (m *GetDirectCSIVolumeListResponse) validateVolumes(formats strfmt.Registry
return nil
}
// ContextValidate validate this get direct c s i volume list response based on the context it is used
func (m *GetDirectCSIVolumeListResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
// ContextValidate validate this get direct p v volume list response based on the context it is used
func (m *GetDirectPVVolumeListResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateVolumes(ctx, formats); err != nil {
@@ -94,7 +94,7 @@ func (m *GetDirectCSIVolumeListResponse) ContextValidate(ctx context.Context, fo
return nil
}
func (m *GetDirectCSIVolumeListResponse) contextValidateVolumes(ctx context.Context, formats strfmt.Registry) error {
func (m *GetDirectPVVolumeListResponse) contextValidateVolumes(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Volumes); i++ {
@@ -115,7 +115,7 @@ func (m *GetDirectCSIVolumeListResponse) contextValidateVolumes(ctx context.Cont
}
// MarshalBinary interface implementation
func (m *GetDirectCSIVolumeListResponse) MarshalBinary() ([]byte, error) {
func (m *GetDirectPVVolumeListResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@@ -123,8 +123,8 @@ func (m *GetDirectCSIVolumeListResponse) MarshalBinary() ([]byte, error) {
}
// UnmarshalBinary interface implementation
func (m *GetDirectCSIVolumeListResponse) UnmarshalBinary(b []byte) error {
var res GetDirectCSIVolumeListResponse
func (m *GetDirectPVVolumeListResponse) UnmarshalBinary(b []byte) error {
var res GetDirectPVVolumeListResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmDeleteKeyRequest km delete key request
//
// swagger:model kmDeleteKeyRequest
type KmDeleteKeyRequest interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmListKeysRequest km list keys request
//
// swagger:model kmListKeysRequest
type KmListKeysRequest interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmsAssignPolicyRequest kms assign policy request
//
// swagger:model kmsAssignPolicyRequest
type KmsAssignPolicyRequest interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmsAssignPolicyResponse kms assign policy response
//
// swagger:model kmsAssignPolicyResponse
type KmsAssignPolicyResponse interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmsCreateKeyRequest kms create key request
//
// swagger:model kmsCreateKeyRequest
type KmsCreateKeyRequest interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmsCreateKeyResponse kms create key response
//
// swagger:model kmsCreateKeyResponse
type KmsCreateKeyResponse interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmsDeleteIdentityRequest kms delete identity request
//
// swagger:model kmsDeleteIdentityRequest
type KmsDeleteIdentityRequest interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmsDeleteIdentityResponse kms delete identity response
//
// swagger:model kmsDeleteIdentityResponse
type KmsDeleteIdentityResponse interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmsDeleteKeyResponse kms delete key response
//
// swagger:model kmsDeleteKeyResponse
type KmsDeleteKeyResponse interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmsDeletePolicyRequest kms delete policy request
//
// swagger:model kmsDeletePolicyRequest
type KmsDeletePolicyRequest interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmsDeletePolicyResponse kms delete policy response
//
// swagger:model kmsDeletePolicyResponse
type KmsDeletePolicyResponse interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmsDescribeIdentityRequest kms describe identity request
//
// swagger:model kmsDescribeIdentityRequest
type KmsDescribeIdentityRequest interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmsDescribeIdentityResponse kms describe identity response
//
// swagger:model kmsDescribeIdentityResponse
type KmsDescribeIdentityResponse interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmsDescribePolicyRequest kms describe policy request
//
// swagger:model kmsDescribePolicyRequest
type KmsDescribePolicyRequest interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmsDescribePolicyResponse kms describe policy response
//
// swagger:model kmsDescribePolicyResponse
type KmsDescribePolicyResponse interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmsDescribeSelfIdentityRequest kms describe self identity request
//
// swagger:model kmsDescribeSelfIdentityRequest
type KmsDescribeSelfIdentityRequest interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmsDescribeSelfIdentityResponse kms describe self identity response
//
// swagger:model kmsDescribeSelfIdentityResponse
type KmsDescribeSelfIdentityResponse interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmsGetPolicyRequest kms get policy request
//
// swagger:model kmsGetPolicyRequest
type KmsGetPolicyRequest interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmsGetPolicyResponse kms get policy response
//
// swagger:model kmsGetPolicyResponse
type KmsGetPolicyResponse interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmsImportKeyRequest kms import key request
//
// swagger:model kmsImportKeyRequest
type KmsImportKeyRequest interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmsImportKeyResponse kms import key response
//
// swagger:model kmsImportKeyResponse
type KmsImportKeyResponse interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmsKeyStatusRequest kms key status request
//
// swagger:model kmsKeyStatusRequest
type KmsKeyStatusRequest interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmsKeyStatusResponse kms key status response
//
// swagger:model kmsKeyStatusResponse
type KmsKeyStatusResponse interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmsListIdentitiesRequest kms list identities request
//
// swagger:model kmsListIdentitiesRequest
type KmsListIdentitiesRequest interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmsListIdentitiesResponse kms list identities response
//
// swagger:model kmsListIdentitiesResponse
type KmsListIdentitiesResponse interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmsListKeysResponse kms list keys response
//
// swagger:model kmsListKeysResponse
type KmsListKeysResponse interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmsListPoliciesRequest kms list policies request
//
// swagger:model kmsListPoliciesRequest
type KmsListPoliciesRequest interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmsListPoliciesResponse kms list policies response
//
// swagger:model kmsListPoliciesResponse
type KmsListPoliciesResponse interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmsSetPolicyRequest kms set policy request
//
// swagger:model kmsSetPolicyRequest
type KmsSetPolicyRequest interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmsSetPolicyResponse kms set policy response
//
// swagger:model kmsSetPolicyResponse
type KmsSetPolicyResponse interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmsStatusRequest kms status request
//
// swagger:model kmsStatusRequest
type KmsStatusRequest interface{}

View File

@@ -0,0 +1,28 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// KmsStatusResponse kms status response
//
// swagger:model kmsStatusResponse
type KmsStatusResponse interface{}

View File

@@ -37,12 +37,18 @@ import (
// swagger:model loginDetails
type LoginDetails struct {
// display names
DisplayNames []string `json:"displayNames"`
// is direct p v
IsDirectPV bool `json:"isDirectPV,omitempty"`
// login strategy
// Enum: [form redirect service-account redirect-service-account]
LoginStrategy string `json:"loginStrategy,omitempty"`
// redirect
Redirect string `json:"redirect,omitempty"`
Redirect []string `json:"redirect"`
}
// Validate validates this login details

View File

@@ -37,6 +37,9 @@ import (
// swagger:model operatorSessionResponse
type OperatorSessionResponse struct {
// direct p v
DirectPV bool `json:"directPV,omitempty"`
// features
Features []string `json:"features"`

View File

@@ -0,0 +1,67 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// OperatorSubnetAPIKey operator subnet API key
//
// swagger:model operatorSubnetAPIKey
type OperatorSubnetAPIKey struct {
// api key
APIKey string `json:"apiKey,omitempty"`
}
// Validate validates this operator subnet API key
func (m *OperatorSubnetAPIKey) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this operator subnet API key based on context it is used
func (m *OperatorSubnetAPIKey) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *OperatorSubnetAPIKey) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *OperatorSubnetAPIKey) UnmarshalBinary(b []byte) error {
var res OperatorSubnetAPIKey
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,122 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// OperatorSubnetLoginMFARequest operator subnet login m f a request
//
// swagger:model operatorSubnetLoginMFARequest
type OperatorSubnetLoginMFARequest struct {
// mfa token
// Required: true
MfaToken *string `json:"mfa_token"`
// otp
// Required: true
Otp *string `json:"otp"`
// username
// Required: true
Username *string `json:"username"`
}
// Validate validates this operator subnet login m f a request
func (m *OperatorSubnetLoginMFARequest) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateMfaToken(formats); err != nil {
res = append(res, err)
}
if err := m.validateOtp(formats); err != nil {
res = append(res, err)
}
if err := m.validateUsername(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *OperatorSubnetLoginMFARequest) validateMfaToken(formats strfmt.Registry) error {
if err := validate.Required("mfa_token", "body", m.MfaToken); err != nil {
return err
}
return nil
}
func (m *OperatorSubnetLoginMFARequest) validateOtp(formats strfmt.Registry) error {
if err := validate.Required("otp", "body", m.Otp); err != nil {
return err
}
return nil
}
func (m *OperatorSubnetLoginMFARequest) validateUsername(formats strfmt.Registry) error {
if err := validate.Required("username", "body", m.Username); err != nil {
return err
}
return nil
}
// ContextValidate validates this operator subnet login m f a request based on context it is used
func (m *OperatorSubnetLoginMFARequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *OperatorSubnetLoginMFARequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *OperatorSubnetLoginMFARequest) UnmarshalBinary(b []byte) error {
var res OperatorSubnetLoginMFARequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,70 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// OperatorSubnetLoginRequest operator subnet login request
//
// swagger:model operatorSubnetLoginRequest
type OperatorSubnetLoginRequest struct {
// password
Password string `json:"password,omitempty"`
// username
Username string `json:"username,omitempty"`
}
// Validate validates this operator subnet login request
func (m *OperatorSubnetLoginRequest) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this operator subnet login request based on context it is used
func (m *OperatorSubnetLoginRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *OperatorSubnetLoginRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *OperatorSubnetLoginRequest) UnmarshalBinary(b []byte) error {
var res OperatorSubnetLoginRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,70 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// OperatorSubnetLoginResponse operator subnet login response
//
// swagger:model operatorSubnetLoginResponse
type OperatorSubnetLoginResponse struct {
// access token
AccessToken string `json:"access_token,omitempty"`
// mfa token
MfaToken string `json:"mfa_token,omitempty"`
}
// Validate validates this operator subnet login response
func (m *OperatorSubnetLoginResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this operator subnet login response based on context it is used
func (m *OperatorSubnetLoginResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *OperatorSubnetLoginResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *OperatorSubnetLoginResponse) UnmarshalBinary(b []byte) error {
var res OperatorSubnetLoginResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,67 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// OperatorSubnetRegisterAPIKeyResponse operator subnet register API key response
//
// swagger:model operatorSubnetRegisterAPIKeyResponse
type OperatorSubnetRegisterAPIKeyResponse struct {
// registered
Registered bool `json:"registered,omitempty"`
}
// Validate validates this operator subnet register API key response
func (m *OperatorSubnetRegisterAPIKeyResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this operator subnet register API key response based on context it is used
func (m *OperatorSubnetRegisterAPIKeyResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *OperatorSubnetRegisterAPIKeyResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *OperatorSubnetRegisterAPIKeyResponse) UnmarshalBinary(b []byte) error {
var res OperatorSubnetRegisterAPIKeyResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -46,6 +46,9 @@ type Principal struct {
// account access key
AccountAccessKey string `json:"accountAccessKey,omitempty"`
// custom style ob
CustomStyleOb string `json:"customStyleOb,omitempty"`
// hm
Hm bool `json:"hm,omitempty"`

View File

@@ -29,10 +29,10 @@ import (
"github.com/go-openapi/swag"
)
// CsiFormatErrorResponse csi format error response
// PvFormatErrorResponse pv format error response
//
// swagger:model csiFormatErrorResponse
type CsiFormatErrorResponse struct {
// swagger:model pvFormatErrorResponse
type PvFormatErrorResponse struct {
// drive
Drive string `json:"drive,omitempty"`
@@ -44,18 +44,18 @@ type CsiFormatErrorResponse struct {
Node string `json:"node,omitempty"`
}
// Validate validates this csi format error response
func (m *CsiFormatErrorResponse) Validate(formats strfmt.Registry) error {
// Validate validates this pv format error response
func (m *PvFormatErrorResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this csi format error response based on context it is used
func (m *CsiFormatErrorResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
// ContextValidate validates this pv format error response based on context it is used
func (m *PvFormatErrorResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *CsiFormatErrorResponse) MarshalBinary() ([]byte, error) {
func (m *PvFormatErrorResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@@ -63,8 +63,8 @@ func (m *CsiFormatErrorResponse) MarshalBinary() ([]byte, error) {
}
// UnmarshalBinary interface implementation
func (m *CsiFormatErrorResponse) UnmarshalBinary(b []byte) error {
var res CsiFormatErrorResponse
func (m *PvFormatErrorResponse) UnmarshalBinary(b []byte) error {
var res PvFormatErrorResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}

View File

@@ -37,8 +37,10 @@ import (
type SecurityContext struct {
// fs group
// Required: true
FsGroup *string `json:"fsGroup"`
FsGroup string `json:"fsGroup,omitempty"`
// fs group change policy
FsGroupChangePolicy string `json:"fsGroupChangePolicy,omitempty"`
// run as group
// Required: true
@@ -57,10 +59,6 @@ type SecurityContext struct {
func (m *SecurityContext) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateFsGroup(formats); err != nil {
res = append(res, err)
}
if err := m.validateRunAsGroup(formats); err != nil {
res = append(res, err)
}
@@ -79,15 +77,6 @@ func (m *SecurityContext) Validate(formats strfmt.Registry) error {
return nil
}
func (m *SecurityContext) validateFsGroup(formats strfmt.Registry) error {
if err := validate.Required("fsGroup", "body", m.FsGroup); err != nil {
return err
}
return nil
}
func (m *SecurityContext) validateRunAsGroup(formats strfmt.Registry) error {
if err := validate.Required("runAsGroup", "body", m.RunAsGroup); err != nil {

View File

@@ -41,9 +41,15 @@ type SessionResponse struct {
// allow resources
AllowResources []*PermissionResource `json:"allowResources"`
// custom styles
CustomStyles string `json:"customStyles,omitempty"`
// distributed mode
DistributedMode bool `json:"distributedMode,omitempty"`
// env constants
EnvConstants *EnvironmentConstants `json:"envConstants,omitempty"`
// features
Features []string `json:"features"`
@@ -66,6 +72,10 @@ func (m *SessionResponse) Validate(formats strfmt.Registry) error {
res = append(res, err)
}
if err := m.validateEnvConstants(formats); err != nil {
res = append(res, err)
}
if err := m.validateStatus(formats); err != nil {
res = append(res, err)
}
@@ -102,6 +112,25 @@ func (m *SessionResponse) validateAllowResources(formats strfmt.Registry) error
return nil
}
func (m *SessionResponse) validateEnvConstants(formats strfmt.Registry) error {
if swag.IsZero(m.EnvConstants) { // not required
return nil
}
if m.EnvConstants != nil {
if err := m.EnvConstants.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("envConstants")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("envConstants")
}
return err
}
}
return nil
}
var sessionResponseTypeStatusPropEnum []interface{}
func init() {
@@ -149,6 +178,10 @@ func (m *SessionResponse) ContextValidate(ctx context.Context, formats strfmt.Re
res = append(res, err)
}
if err := m.contextValidateEnvConstants(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
@@ -175,6 +208,22 @@ func (m *SessionResponse) contextValidateAllowResources(ctx context.Context, for
return nil
}
func (m *SessionResponse) contextValidateEnvConstants(ctx context.Context, formats strfmt.Registry) error {
if m.EnvConstants != nil {
if err := m.EnvConstants.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("envConstants")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("envConstants")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *SessionResponse) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -175,6 +175,9 @@ func (m *TenantSecurityResponse) UnmarshalBinary(b []byte) error {
// swagger:model TenantSecurityResponseCustomCertificates
type TenantSecurityResponseCustomCertificates struct {
// client
Client []*CertificateInfo `json:"client"`
// minio
Minio []*CertificateInfo `json:"minio"`
@@ -186,6 +189,10 @@ type TenantSecurityResponseCustomCertificates struct {
func (m *TenantSecurityResponseCustomCertificates) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateClient(formats); err != nil {
res = append(res, err)
}
if err := m.validateMinio(formats); err != nil {
res = append(res, err)
}
@@ -200,6 +207,32 @@ func (m *TenantSecurityResponseCustomCertificates) Validate(formats strfmt.Regis
return nil
}
func (m *TenantSecurityResponseCustomCertificates) validateClient(formats strfmt.Registry) error {
if swag.IsZero(m.Client) { // not required
return nil
}
for i := 0; i < len(m.Client); i++ {
if swag.IsZero(m.Client[i]) { // not required
continue
}
if m.Client[i] != nil {
if err := m.Client[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("customCertificates" + "." + "client" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("customCertificates" + "." + "client" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *TenantSecurityResponseCustomCertificates) validateMinio(formats strfmt.Registry) error {
if swag.IsZero(m.Minio) { // not required
return nil
@@ -256,6 +289,10 @@ func (m *TenantSecurityResponseCustomCertificates) validateMinioCAs(formats strf
func (m *TenantSecurityResponseCustomCertificates) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateClient(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateMinio(ctx, formats); err != nil {
res = append(res, err)
}
@@ -270,6 +307,26 @@ func (m *TenantSecurityResponseCustomCertificates) ContextValidate(ctx context.C
return nil
}
func (m *TenantSecurityResponseCustomCertificates) contextValidateClient(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Client); i++ {
if m.Client[i] != nil {
if err := m.Client[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("customCertificates" + "." + "client" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("customCertificates" + "." + "client" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *TenantSecurityResponseCustomCertificates) contextValidateMinio(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Minio); i++ {

View File

@@ -43,11 +43,14 @@ type Tier struct {
// gcs
Gcs *TierGcs `json:"gcs,omitempty"`
// minio
Minio *TierMinio `json:"minio,omitempty"`
// s3
S3 *TierS3 `json:"s3,omitempty"`
// type
// Enum: [s3 gcs azure unsupported]
// Enum: [s3 gcs azure minio unsupported]
Type string `json:"type,omitempty"`
}
@@ -63,6 +66,10 @@ func (m *Tier) Validate(formats strfmt.Registry) error {
res = append(res, err)
}
if err := m.validateMinio(formats); err != nil {
res = append(res, err)
}
if err := m.validateS3(formats); err != nil {
res = append(res, err)
}
@@ -115,6 +122,25 @@ func (m *Tier) validateGcs(formats strfmt.Registry) error {
return nil
}
func (m *Tier) validateMinio(formats strfmt.Registry) error {
if swag.IsZero(m.Minio) { // not required
return nil
}
if m.Minio != nil {
if err := m.Minio.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("minio")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("minio")
}
return err
}
}
return nil
}
func (m *Tier) validateS3(formats strfmt.Registry) error {
if swag.IsZero(m.S3) { // not required
return nil
@@ -138,7 +164,7 @@ var tierTypeTypePropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["s3","gcs","azure","unsupported"]`), &res); err != nil {
if err := json.Unmarshal([]byte(`["s3","gcs","azure","minio","unsupported"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
@@ -157,6 +183,9 @@ const (
// TierTypeAzure captures enum value "azure"
TierTypeAzure string = "azure"
// TierTypeMinio captures enum value "minio"
TierTypeMinio string = "minio"
// TierTypeUnsupported captures enum value "unsupported"
TierTypeUnsupported string = "unsupported"
)
@@ -194,6 +223,10 @@ func (m *Tier) ContextValidate(ctx context.Context, formats strfmt.Registry) err
res = append(res, err)
}
if err := m.contextValidateMinio(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateS3(ctx, formats); err != nil {
res = append(res, err)
}
@@ -236,6 +269,22 @@ func (m *Tier) contextValidateGcs(ctx context.Context, formats strfmt.Registry)
return nil
}
func (m *Tier) contextValidateMinio(ctx context.Context, formats strfmt.Registry) error {
if m.Minio != nil {
if err := m.Minio.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("minio")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("minio")
}
return err
}
}
return nil
}
func (m *Tier) contextValidateS3(ctx context.Context, formats strfmt.Registry) error {
if m.S3 != nil {

97
models/tier_minio.go Normal file
View File

@@ -0,0 +1,97 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// TierMinio tier minio
//
// swagger:model tier_minio
type TierMinio struct {
// accesskey
Accesskey string `json:"accesskey,omitempty"`
// bucket
Bucket string `json:"bucket,omitempty"`
// endpoint
Endpoint string `json:"endpoint,omitempty"`
// name
Name string `json:"name,omitempty"`
// objects
Objects string `json:"objects,omitempty"`
// prefix
Prefix string `json:"prefix,omitempty"`
// region
Region string `json:"region,omitempty"`
// secretkey
Secretkey string `json:"secretkey,omitempty"`
// storageclass
Storageclass string `json:"storageclass,omitempty"`
// usage
Usage string `json:"usage,omitempty"`
// versions
Versions string `json:"versions,omitempty"`
}
// Validate validates this tier minio
func (m *TierMinio) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this tier minio based on context it is used
func (m *TierMinio) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *TierMinio) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TierMinio) UnmarshalBinary(b []byte) error {
var res TierMinio
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -36,18 +36,25 @@ import (
// swagger:model tlsConfiguration
type TLSConfiguration struct {
// ca certificates
CaCertificates []string `json:"ca_certificates"`
// minio c as certificates
MinioCAsCertificates []string `json:"minioCAsCertificates"`
// minio
Minio []*KeyPairConfiguration `json:"minio"`
// minio client certificates
MinioClientCertificates []*KeyPairConfiguration `json:"minioClientCertificates"`
// minio server certificates
MinioServerCertificates []*KeyPairConfiguration `json:"minioServerCertificates"`
}
// Validate validates this tls configuration
func (m *TLSConfiguration) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateMinio(formats); err != nil {
if err := m.validateMinioClientCertificates(formats); err != nil {
res = append(res, err)
}
if err := m.validateMinioServerCertificates(formats); err != nil {
res = append(res, err)
}
@@ -57,22 +64,48 @@ func (m *TLSConfiguration) Validate(formats strfmt.Registry) error {
return nil
}
func (m *TLSConfiguration) validateMinio(formats strfmt.Registry) error {
if swag.IsZero(m.Minio) { // not required
func (m *TLSConfiguration) validateMinioClientCertificates(formats strfmt.Registry) error {
if swag.IsZero(m.MinioClientCertificates) { // not required
return nil
}
for i := 0; i < len(m.Minio); i++ {
if swag.IsZero(m.Minio[i]) { // not required
for i := 0; i < len(m.MinioClientCertificates); i++ {
if swag.IsZero(m.MinioClientCertificates[i]) { // not required
continue
}
if m.Minio[i] != nil {
if err := m.Minio[i].Validate(formats); err != nil {
if m.MinioClientCertificates[i] != nil {
if err := m.MinioClientCertificates[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("minio" + "." + strconv.Itoa(i))
return ve.ValidateName("minioClientCertificates" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("minio" + "." + strconv.Itoa(i))
return ce.ValidateName("minioClientCertificates" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *TLSConfiguration) validateMinioServerCertificates(formats strfmt.Registry) error {
if swag.IsZero(m.MinioServerCertificates) { // not required
return nil
}
for i := 0; i < len(m.MinioServerCertificates); i++ {
if swag.IsZero(m.MinioServerCertificates[i]) { // not required
continue
}
if m.MinioServerCertificates[i] != nil {
if err := m.MinioServerCertificates[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("minioServerCertificates" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("minioServerCertificates" + "." + strconv.Itoa(i))
}
return err
}
@@ -87,7 +120,11 @@ func (m *TLSConfiguration) validateMinio(formats strfmt.Registry) error {
func (m *TLSConfiguration) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateMinio(ctx, formats); err != nil {
if err := m.contextValidateMinioClientCertificates(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateMinioServerCertificates(ctx, formats); err != nil {
res = append(res, err)
}
@@ -97,16 +134,36 @@ func (m *TLSConfiguration) ContextValidate(ctx context.Context, formats strfmt.R
return nil
}
func (m *TLSConfiguration) contextValidateMinio(ctx context.Context, formats strfmt.Registry) error {
func (m *TLSConfiguration) contextValidateMinioClientCertificates(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Minio); i++ {
for i := 0; i < len(m.MinioClientCertificates); i++ {
if m.Minio[i] != nil {
if err := m.Minio[i].ContextValidate(ctx, formats); err != nil {
if m.MinioClientCertificates[i] != nil {
if err := m.MinioClientCertificates[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("minio" + "." + strconv.Itoa(i))
return ve.ValidateName("minioClientCertificates" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("minio" + "." + strconv.Itoa(i))
return ce.ValidateName("minioClientCertificates" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *TLSConfiguration) contextValidateMinioServerCertificates(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.MinioServerCertificates); i++ {
if m.MinioServerCertificates[i] != nil {
if err := m.MinioServerCertificates[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("minioServerCertificates" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("minioServerCertificates" + "." + strconv.Itoa(i))
}
return err
}

View File

@@ -175,11 +175,14 @@ func (m *UpdateTenantSecurityRequest) UnmarshalBinary(b []byte) error {
// swagger:model UpdateTenantSecurityRequestCustomCertificates
type UpdateTenantSecurityRequestCustomCertificates struct {
// minio
Minio []*KeyPairConfiguration `json:"minio"`
// minio c as certificates
MinioCAsCertificates []string `json:"minioCAsCertificates"`
// minio c as
MinioCAs []string `json:"minioCAs"`
// minio client certificates
MinioClientCertificates []*KeyPairConfiguration `json:"minioClientCertificates"`
// minio server certificates
MinioServerCertificates []*KeyPairConfiguration `json:"minioServerCertificates"`
// secrets to be deleted
SecretsToBeDeleted []string `json:"secretsToBeDeleted"`
@@ -189,7 +192,11 @@ type UpdateTenantSecurityRequestCustomCertificates struct {
func (m *UpdateTenantSecurityRequestCustomCertificates) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateMinio(formats); err != nil {
if err := m.validateMinioClientCertificates(formats); err != nil {
res = append(res, err)
}
if err := m.validateMinioServerCertificates(formats); err != nil {
res = append(res, err)
}
@@ -199,22 +206,48 @@ func (m *UpdateTenantSecurityRequestCustomCertificates) Validate(formats strfmt.
return nil
}
func (m *UpdateTenantSecurityRequestCustomCertificates) validateMinio(formats strfmt.Registry) error {
if swag.IsZero(m.Minio) { // not required
func (m *UpdateTenantSecurityRequestCustomCertificates) validateMinioClientCertificates(formats strfmt.Registry) error {
if swag.IsZero(m.MinioClientCertificates) { // not required
return nil
}
for i := 0; i < len(m.Minio); i++ {
if swag.IsZero(m.Minio[i]) { // not required
for i := 0; i < len(m.MinioClientCertificates); i++ {
if swag.IsZero(m.MinioClientCertificates[i]) { // not required
continue
}
if m.Minio[i] != nil {
if err := m.Minio[i].Validate(formats); err != nil {
if m.MinioClientCertificates[i] != nil {
if err := m.MinioClientCertificates[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("customCertificates" + "." + "minio" + "." + strconv.Itoa(i))
return ve.ValidateName("customCertificates" + "." + "minioClientCertificates" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("customCertificates" + "." + "minio" + "." + strconv.Itoa(i))
return ce.ValidateName("customCertificates" + "." + "minioClientCertificates" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *UpdateTenantSecurityRequestCustomCertificates) validateMinioServerCertificates(formats strfmt.Registry) error {
if swag.IsZero(m.MinioServerCertificates) { // not required
return nil
}
for i := 0; i < len(m.MinioServerCertificates); i++ {
if swag.IsZero(m.MinioServerCertificates[i]) { // not required
continue
}
if m.MinioServerCertificates[i] != nil {
if err := m.MinioServerCertificates[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("customCertificates" + "." + "minioServerCertificates" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("customCertificates" + "." + "minioServerCertificates" + "." + strconv.Itoa(i))
}
return err
}
@@ -229,7 +262,11 @@ func (m *UpdateTenantSecurityRequestCustomCertificates) validateMinio(formats st
func (m *UpdateTenantSecurityRequestCustomCertificates) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateMinio(ctx, formats); err != nil {
if err := m.contextValidateMinioClientCertificates(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateMinioServerCertificates(ctx, formats); err != nil {
res = append(res, err)
}
@@ -239,16 +276,36 @@ func (m *UpdateTenantSecurityRequestCustomCertificates) ContextValidate(ctx cont
return nil
}
func (m *UpdateTenantSecurityRequestCustomCertificates) contextValidateMinio(ctx context.Context, formats strfmt.Registry) error {
func (m *UpdateTenantSecurityRequestCustomCertificates) contextValidateMinioClientCertificates(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Minio); i++ {
for i := 0; i < len(m.MinioClientCertificates); i++ {
if m.Minio[i] != nil {
if err := m.Minio[i].ContextValidate(ctx, formats); err != nil {
if m.MinioClientCertificates[i] != nil {
if err := m.MinioClientCertificates[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("customCertificates" + "." + "minio" + "." + strconv.Itoa(i))
return ve.ValidateName("customCertificates" + "." + "minioClientCertificates" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("customCertificates" + "." + "minio" + "." + strconv.Itoa(i))
return ce.ValidateName("customCertificates" + "." + "minioClientCertificates" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *UpdateTenantSecurityRequestCustomCertificates) contextValidateMinioServerCertificates(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.MinioServerCertificates); i++ {
if m.MinioServerCertificates[i] != nil {
if err := m.MinioServerCertificates[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("customCertificates" + "." + "minioServerCertificates" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("customCertificates" + "." + "minioServerCertificates" + "." + strconv.Itoa(i))
}
return err
}

View File

@@ -69,3 +69,10 @@ func getK8sSAToken() string {
func getMarketplace() string {
return env.Get(ConsoleMarketplace, "")
}
// Get DirectPVMode
func getDirectPVEnabled() bool {
currentMode := env.Get(DirectPVMode, "off")
return currentMode == "on"
}

View File

@@ -89,7 +89,12 @@ func configureAPI(api *operations.OperatorAPI) http.Handler {
registerVolumesHandlers(api)
// Namespaces handlers
registerNamespaceHandlers(api)
// Marketplace handlers
registerMarketplaceHandlers(api)
// Subnet handlers
registerOperatorSubnetHandlers(api)
// Direct PV handlers
registerDirectPVHandlers(api)
api.PreServerShutdown = func() {}

View File

@@ -25,6 +25,9 @@ const (
prometheusPath = "prometheus.io/path"
prometheusPort = "prometheus.io/port"
prometheusScrape = "prometheus.io/scrape"
// Constants for DirectPV
DirectPVMode = "DIRECTPV_MODE"
)
// Image versions

328
operatorapi/directpv.go Normal file
View File

@@ -0,0 +1,328 @@
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package operatorapi
import (
"context"
"errors"
"sort"
"strings"
"github.com/minio/directpv/pkg/utils"
"github.com/go-openapi/runtime/middleware"
"github.com/minio/console/cluster"
"github.com/minio/console/models"
"github.com/minio/console/operatorapi/operations"
"github.com/minio/console/operatorapi/operations/operator_api"
xerrors "github.com/minio/console/restapi"
directcsi "github.com/minio/directpv/pkg/apis/direct.csi.min.io/v1beta4"
"github.com/minio/directpv/pkg/sys"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
const XFS = "xfs"
func registerDirectPVHandlers(api *operations.OperatorAPI) {
api.OperatorAPIGetDirectPVDriveListHandler = operator_api.GetDirectPVDriveListHandlerFunc(func(params operator_api.GetDirectPVDriveListParams, session *models.Principal) middleware.Responder {
resp, err := getDirectPVDrivesListResponse(session)
if err != nil {
return operator_api.NewGetDirectPVDriveListDefault(int(err.Code)).WithPayload(err)
}
return operator_api.NewGetDirectPVDriveListOK().WithPayload(resp)
})
api.OperatorAPIGetDirectPVVolumeListHandler = operator_api.GetDirectPVVolumeListHandlerFunc(func(params operator_api.GetDirectPVVolumeListParams, session *models.Principal) middleware.Responder {
resp, err := getDirectPVVolumesListResponse(session)
if err != nil {
return operator_api.NewGetDirectPVVolumeListDefault(int(err.Code)).WithPayload(err)
}
return operator_api.NewGetDirectPVVolumeListOK().WithPayload(resp)
})
api.OperatorAPIDirectPVFormatDriveHandler = operator_api.DirectPVFormatDriveHandlerFunc(func(params operator_api.DirectPVFormatDriveParams, session *models.Principal) middleware.Responder {
resp, err := formatVolumesResponse(session, params)
if err != nil {
return operator_api.NewDirectPVFormatDriveDefault(int(err.Code)).WithPayload(err)
}
return operator_api.NewDirectPVFormatDriveOK().WithPayload(resp)
})
}
// getDirectPVVolumesList returns directPV drives
func getDirectPVDriveList(ctx context.Context, driveInterface DirectPVDrivesClientI) (*models.GetDirectPVDriveListResponse, error) {
drivesList, err := driveInterface.List(ctx, metav1.ListOptions{})
if err != nil {
return nil, err
}
res := &models.GetDirectPVDriveListResponse{}
// implementation same as directPV `drives ls` command
driveName := func(val string) string {
dr := strings.ReplaceAll(val, sys.DirectCSIDevRoot+"/", "")
dr = strings.ReplaceAll(dr, sys.HostDevRoot+"/", "")
return strings.ReplaceAll(dr, sys.DirectCSIPartitionInfix, "")
}
drivesSorted := drivesList.Items
// sort by nodename, path and status
sort.Slice(drivesSorted, func(i, j int) bool {
d1 := drivesSorted[i]
d2 := drivesSorted[j]
if v := strings.Compare(d1.Status.NodeName, d2.Status.NodeName); v != 0 {
return v < 0
}
if v := strings.Compare(d1.Status.Path, d2.Status.Path); v != 0 {
return v < 0
}
return strings.Compare(string(d1.Status.DriveStatus), string(d2.Status.DriveStatus)) < 0
})
for _, d := range drivesSorted {
volumes := 0
if len(d.Finalizers) > 1 {
volumes = len(d.Finalizers) - 1
}
dr := driveName(d.Status.Path)
dr = strings.ReplaceAll("/dev/"+dr, sys.DirectCSIPartitionInfix, "")
status := d.Status.DriveStatus
msg := ""
for _, c := range d.Status.Conditions {
switch c.Type {
case string(directcsi.DirectCSIDriveConditionInitialized), string(directcsi.DirectCSIDriveConditionOwned), string(directcsi.DirectCSIDriveConditionReady):
if c.Status != metav1.ConditionTrue {
msg = c.Message
if msg != "" {
status = d.Status.DriveStatus + "*"
msg = strings.ReplaceAll(msg, d.Name, "")
msg = strings.ReplaceAll(msg, sys.DirectCSIDevRoot, "/dev")
msg = strings.ReplaceAll(msg, sys.DirectCSIPartitionInfix, "")
msg = strings.Split(msg, "\n")[0]
}
}
}
}
var allocatedCapacity int64
if status == directcsi.DriveStatusInUse {
allocatedCapacity = d.Status.AllocatedCapacity
}
drStatus := d.Status.DriveStatus
driveInfo := &models.DirectPVDriveInfo{
Drive: dr,
Capacity: d.Status.TotalCapacity,
Allocated: allocatedCapacity,
Node: d.Status.NodeName,
Status: string(drStatus),
Message: msg,
Volumes: int64(volumes),
}
res.Drives = append(res.Drives, driveInfo)
}
return res, nil
}
func getDirectPVDrivesListResponse(session *models.Principal) (*models.GetDirectPVDriveListResponse, *models.Error) {
ctx := context.Background()
driveInterface, err := cluster.DirectPVDriveInterface(session.STSSessionToken)
if err != nil {
return nil, xerrors.ErrorWithContext(ctx, err)
}
directPVDrvClient := &directPVDrivesClient{
client: driveInterface,
}
drives, err := getDirectPVDriveList(ctx, directPVDrvClient)
if err != nil {
return nil, xerrors.ErrorWithContext(ctx, err)
}
return drives, nil
}
// getDirectPVVolumesList returns directPV volumes
func getDirectPVVolumesList(ctx context.Context, volumeInterface DirectPVVolumesClientI) (*models.GetDirectPVVolumeListResponse, error) {
volList, err := volumeInterface.List(ctx, metav1.ListOptions{})
if err != nil {
return nil, err
}
driveName := func(val string) string {
dr := strings.ReplaceAll(val, sys.DirectCSIDevRoot+"/", "")
return strings.ReplaceAll(dr, sys.HostDevRoot+"/", "")
}
getLabelValue := func(obj metav1.Object, key string) string {
if labels := obj.GetLabels(); labels != nil {
return labels[key]
}
return ""
}
var volumes []*models.DirectPVVolumeInfo
for _, v := range volList.Items {
vol := &models.DirectPVVolumeInfo{
Volume: v.Name,
Capacity: v.Status.TotalCapacity,
Drive: driveName(getLabelValue(&v, string(utils.DrivePathLabelKey))),
Node: v.Status.NodeName,
}
volumes = append(volumes, vol)
}
res := &models.GetDirectPVVolumeListResponse{
Volumes: volumes,
}
return res, nil
}
func getDirectPVVolumesListResponse(session *models.Principal) (*models.GetDirectPVVolumeListResponse, *models.Error) {
ctx := context.Background()
volumeInterface, err := cluster.DirectPVVolumeInterface(session.STSSessionToken)
if err != nil {
return nil, xerrors.ErrorWithContext(ctx, err)
}
directPVVolClient := &directPVVolumesClient{
client: volumeInterface,
}
volumes, err := getDirectPVVolumesList(ctx, directPVVolClient)
if err != nil {
return nil, xerrors.ErrorWithContext(ctx, err)
}
return volumes, nil
}
func formatDrives(ctx context.Context, driveInterface DirectPVDrivesClientI, drives []string, force bool) (*models.FormatDirectPVDrivesResponse, error) {
if len(drives) == 0 {
return nil, errors.New("at least one drive needs to be set")
}
driveList, err := driveInterface.List(ctx, metav1.ListOptions{})
if err != nil {
return nil, err
}
driveName := func(val string) string {
dr := strings.ReplaceAll(val, sys.DirectCSIDevRoot+"/", "")
dr = strings.ReplaceAll(dr, sys.HostDevRoot+"/", "")
return strings.ReplaceAll(dr, sys.DirectCSIPartitionInfix, "")
}
drivesArray := map[string]string{}
for _, driveFromAPI := range drives {
drivesArray[driveFromAPI] = driveFromAPI
}
if len(driveList.Items) == 0 {
return nil, errors.New("no resources found globally")
}
var errorResponses []*models.PvFormatErrorResponse
for _, driveItem := range driveList.Items {
drName := "/dev/" + driveName(driveItem.Status.Path)
driveName := driveItem.Status.NodeName + ":" + drName
base := &models.PvFormatErrorResponse{
Node: driveItem.Status.NodeName,
Drive: drName,
Error: "",
}
// Element is requested to be formatted
if _, ok := drivesArray[driveName]; ok {
if driveItem.Status.DriveStatus == directcsi.DriveStatusUnavailable {
base.Error = "Status is unavailable"
errorResponses = append(errorResponses, base)
continue
}
if driveItem.Status.DriveStatus == directcsi.DriveStatusInUse {
base.Error = "Drive in use. Cannot be formatted"
errorResponses = append(errorResponses, base)
continue
}
if driveItem.Status.DriveStatus == directcsi.DriveStatusReady {
base.Error = "Drive already owned and managed."
errorResponses = append(errorResponses, base)
continue
}
if driveItem.Status.Filesystem != "" && !force {
base.Error = "Drive already has a fs. Use force to overwrite"
errorResponses = append(errorResponses, base)
continue
}
if driveItem.Status.DriveStatus == directcsi.DriveStatusReleased {
base.Error = "Drive is in 'released state'. Please wait until it becomes available"
errorResponses = append(errorResponses, base)
continue
}
// Validation passes, we request format
driveItem.Spec.DirectCSIOwned = true
driveItem.Spec.RequestedFormat = &directcsi.RequestedFormat{
Filesystem: XFS,
Force: force,
}
_, err := driveInterface.Update(ctx, &driveItem, metav1.UpdateOptions{})
if err != nil {
base.Error = err.Error()
errorResponses = append(errorResponses, base)
}
}
}
returnErrors := &models.FormatDirectPVDrivesResponse{
FormatIssuesList: errorResponses,
}
return returnErrors, nil
}
func formatVolumesResponse(session *models.Principal, params operator_api.DirectPVFormatDriveParams) (*models.FormatDirectPVDrivesResponse, *models.Error) {
ctx := context.Background()
driveInterface, err := cluster.DirectPVDriveInterface(session.STSSessionToken)
if err != nil {
return nil, xerrors.ErrorWithContext(ctx, err)
}
directPVDrvClient := &directPVDrivesClient{
client: driveInterface,
}
formatResult, errFormat := formatDrives(ctx, directPVDrvClient, params.Body.Drives, *params.Body.Force)
if errFormat != nil {
return nil, xerrors.ErrorWithContext(ctx, errFormat)
}
return formatResult, nil
}

View File

@@ -0,0 +1,73 @@
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package operatorapi
import (
"context"
"github.com/minio/directpv/pkg/apis/direct.csi.min.io/v1beta4"
directPVClient "github.com/minio/directpv/pkg/client"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// DirectPVDrivesClientI interface with all functions to be implemented
// by mock when testing, it should include all DirectPVDrivesClientI respective api calls
// that are used within this project.
type DirectPVDrivesClientI interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1beta4.DirectCSIDriveList, error)
Update(ctx context.Context, driveItem *v1beta4.DirectCSIDrive, opts metav1.UpdateOptions) (*v1beta4.DirectCSIDriveList, error)
}
// Interface implementation
//
// Define the structure of directpv drive client and define the functions that are actually used
// from the minio operator / directpv interface.
type directPVDrivesClient struct {
client *directPVClient.DirectCSIDriveInterface
}
// List implements the listing for DirectPV Drives List functionality
func (dpd *directPVDrivesClient) List(ctx context.Context, opts metav1.ListOptions) (*v1beta4.DirectCSIDriveList, error) {
return dpd.List(ctx, opts)
}
// Update implements the listing for DirectPV Drives Update functionality
func (dpd *directPVDrivesClient) Update(ctx context.Context, driveItem *v1beta4.DirectCSIDrive, opts metav1.UpdateOptions) (*v1beta4.DirectCSIDriveList, error) {
return dpd.Update(ctx, driveItem, opts)
}
// DirectPVVolumesClientI interface with all functions to be implemented
// by mock when testing, it should include all DirectPVVolumesClientI respective api calls
// that are used within this project.
type DirectPVVolumesClientI interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1beta4.DirectCSIVolumeList, error)
}
// Interface implementation
//
// Define the structure of directpv volumes client and define the functions that are actually used
// from the minio operator / directpv interface.
type directPVVolumesClient struct {
client *directPVClient.DirectCSIVolumeInterface
}
// List implements the listing for DirectPV Volumes List functionality
func (dpv *directPVVolumesClient) List(ctx context.Context, opts metav1.ListOptions) (*v1beta4.DirectCSIVolumeList, error) {
return dpv.List(ctx, opts)
}

View File

@@ -0,0 +1,410 @@
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package operatorapi
import (
"context"
"errors"
"testing"
"github.com/minio/directpv/pkg/apis/direct.csi.min.io/v1beta4"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
var (
dpdClientListMock func(ctx context.Context, opts v1.ListOptions) (*v1beta4.DirectCSIDriveList, error)
dpdClientUpdateMock func(ctx context.Context, driveItem *v1beta4.DirectCSIDrive, opts v1.UpdateOptions) (*v1beta4.DirectCSIDriveList, error)
)
// mock function for drives List()
func (dpdm directPVDriveMock) List(ctx context.Context, opts v1.ListOptions) (*v1beta4.DirectCSIDriveList, error) {
return dpdClientListMock(ctx, opts)
}
func (dpdm directPVDriveMock) Update(ctx context.Context, driveItem *v1beta4.DirectCSIDrive, opts v1.UpdateOptions) (*v1beta4.DirectCSIDriveList, error) {
return dpdClientUpdateMock(ctx, driveItem, opts)
}
var dpvClientListMock func(ctx context.Context, opts v1.ListOptions) (*v1beta4.DirectCSIVolumeList, error)
// mock function for volumes List()
func (dpvm directPVVolumeMock) List(ctx context.Context, opts v1.ListOptions) (*v1beta4.DirectCSIVolumeList, error) {
return dpvClientListMock(ctx, opts)
}
// DirectPVDrivesList
func Test_GetDirectPVDrives(t *testing.T) {
directPVDrvMock := directPVDriveMock{}
type args struct {
ctx context.Context
opts v1.ListOptions
}
tests := []struct {
name string
args args
client DirectPVDrivesClientI
mockListDrives func(ctx context.Context, opts v1.ListOptions) (*v1beta4.DirectCSIDriveList, error)
wantErr bool
}{
{
name: "Can List Drives correctly",
args: args{
ctx: context.Background(),
opts: v1.ListOptions{},
},
client: directPVDrvMock,
mockListDrives: func(ctx context.Context, opts v1.ListOptions) (*v1beta4.DirectCSIDriveList, error) {
items := []v1beta4.DirectCSIDrive{}
returnList := v1beta4.DirectCSIDriveList{
Items: items,
}
return &returnList, nil
},
wantErr: false,
},
{
name: "Drives request from DirectPV failed",
args: args{
ctx: context.Background(),
},
client: directPVDrvMock,
mockListDrives: func(ctx context.Context, opts v1.ListOptions) (*v1beta4.DirectCSIDriveList, error) {
return nil, errors.New("some error occurred")
},
wantErr: true,
},
{
name: "Drives request from DirectPV has information and doesn't return errors",
args: args{
ctx: context.Background(),
},
client: directPVDrvMock,
mockListDrives: func(ctx context.Context, opts v1.ListOptions) (*v1beta4.DirectCSIDriveList, error) {
items := []v1beta4.DirectCSIDrive{
{
Status: v1beta4.DirectCSIDriveStatus{
Path: "/var/lib/direct-csi/devices/test-part-dev0-directcsi",
AllocatedCapacity: 0,
FreeCapacity: 4772382377372,
RootPartition: "/",
PartitionNum: 0,
Filesystem: "nfs",
Mountpoint: "",
NodeName: "test-dev0-directcsi",
DriveStatus: v1beta4.DriveStatusReady,
ModelNumber: "testModel",
SerialNumber: "testSN",
TotalCapacity: 4772382377372,
PhysicalBlockSize: 1024,
LogicalBlockSize: 1024,
AccessTier: "",
FilesystemUUID: "",
PartitionUUID: "",
MajorNumber: 0,
MinorNumber: 0,
UeventSerial: "",
UeventFSUUID: "",
WWID: "",
Vendor: "",
DMName: "",
DMUUID: "",
MDUUID: "",
PartTableUUID: "",
PartTableType: "",
Virtual: false,
ReadOnly: false,
Partitioned: false,
SwapOn: false,
Master: "",
OtherMountsInfo: nil,
PCIPath: "",
SerialNumberLong: "",
Conditions: []v1.Condition{{
Type: "",
Status: "",
ObservedGeneration: 0,
LastTransitionTime: v1.Time{},
Reason: "",
Message: "",
}},
},
},
{
Status: v1beta4.DirectCSIDriveStatus{
Path: "/var/lib/direct-csi/devices/test-part-dev1-directcsi",
AllocatedCapacity: 0,
FreeCapacity: 4772382377372,
RootPartition: "/",
PartitionNum: 0,
Filesystem: "nfs",
Mountpoint: "",
NodeName: "test-dev1-directcsi",
DriveStatus: v1beta4.DriveStatus(v1beta4.DirectCSIDriveConditionOwned),
ModelNumber: "testModel",
SerialNumber: "testSN2",
TotalCapacity: 4772382377372,
PhysicalBlockSize: 1024,
LogicalBlockSize: 1024,
AccessTier: "",
FilesystemUUID: "",
PartitionUUID: "",
MajorNumber: 0,
MinorNumber: 0,
UeventSerial: "",
UeventFSUUID: "",
WWID: "",
Vendor: "",
DMName: "",
DMUUID: "",
MDUUID: "",
PartTableUUID: "",
PartTableType: "",
Virtual: false,
ReadOnly: false,
Partitioned: false,
SwapOn: false,
Master: "",
OtherMountsInfo: nil,
PCIPath: "",
SerialNumberLong: "",
Conditions: nil,
},
},
}
returnList := v1beta4.DirectCSIDriveList{
Items: items,
}
return &returnList, nil
},
wantErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
dpdClientListMock = tt.mockListDrives
_, err := getDirectPVDriveList(tt.args.ctx, tt.client)
if (err != nil) != tt.wantErr {
t.Errorf("getNamespaceCreated() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}
// DirectPVVolumesList
func Test_GetDirectPVVolumes(t *testing.T) {
directPVVolMock := directPVVolumeMock{}
type args struct {
ctx context.Context
opts v1.ListOptions
}
tests := []struct {
name string
args args
volumesClient DirectPVVolumesClientI
mockListVolumes func(ctx context.Context, opts v1.ListOptions) (*v1beta4.DirectCSIVolumeList, error)
wantErr bool
}{
{
name: "Can List Volumes correctly",
args: args{
ctx: context.Background(),
opts: v1.ListOptions{},
},
volumesClient: directPVVolMock,
mockListVolumes: func(ctx context.Context, opts v1.ListOptions) (*v1beta4.DirectCSIVolumeList, error) {
items := []v1beta4.DirectCSIVolume{}
returnList := v1beta4.DirectCSIVolumeList{
Items: items,
}
return &returnList, nil
},
wantErr: false,
},
{
name: "Drives request from DirectPV is ok but volumes request failed",
args: args{
ctx: context.Background(),
},
volumesClient: directPVVolMock,
mockListVolumes: func(ctx context.Context, opts v1.ListOptions) (*v1beta4.DirectCSIVolumeList, error) {
return nil, errors.New("some error occurred")
},
wantErr: true,
},
{
name: "Can List Volumes & Drives correctly without any issue",
args: args{
ctx: context.Background(),
opts: v1.ListOptions{},
},
volumesClient: directPVVolMock,
mockListVolumes: func(ctx context.Context, opts v1.ListOptions) (*v1beta4.DirectCSIVolumeList, error) {
items := []v1beta4.DirectCSIVolume{{
Status: v1beta4.DirectCSIVolumeStatus{
Drive: "/var/lib/direct-csi/devices/test-part-dev1-directcsi",
NodeName: "testNodeName",
HostPath: "",
StagingPath: "",
ContainerPath: "",
TotalCapacity: 4772382377372,
AvailableCapacity: 4772382377372,
UsedCapacity: 0,
Conditions: nil,
},
}}
returnList := v1beta4.DirectCSIVolumeList{
Items: items,
}
return &returnList, nil
},
wantErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
dpvClientListMock = tt.mockListVolumes
_, err := getDirectPVVolumesList(tt.args.ctx, tt.volumesClient)
if (err != nil) != tt.wantErr {
t.Errorf("getNamespaceCreated() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}
// FormatDrives
func Test_GetDirectPVFormatDrives(t *testing.T) {
directPVDrvMock := directPVDriveMock{}
type args struct {
ctx context.Context
opts v1.ListOptions
}
tests := []struct {
name string
args args
drivesClient DirectPVDrivesClientI
mockListDrives func(ctx context.Context, opts v1.ListOptions) (*v1beta4.DirectCSIDriveList, error)
drives []string
force bool
wantErr bool
}{
{
name: "Format doesn't crash on empty list & returns error",
args: args{
ctx: context.Background(),
opts: v1.ListOptions{},
},
drivesClient: directPVDrvMock,
mockListDrives: func(ctx context.Context, opts v1.ListOptions) (*v1beta4.DirectCSIDriveList, error) {
items := []v1beta4.DirectCSIDrive{}
returnList := v1beta4.DirectCSIDriveList{
Items: items,
}
return &returnList, nil
},
drives: []string{},
force: false,
wantErr: true,
},
{
name: "Can Format Selected drives",
args: args{
ctx: context.Background(),
opts: v1.ListOptions{},
},
drivesClient: directPVDrvMock,
mockListDrives: func(ctx context.Context, opts v1.ListOptions) (*v1beta4.DirectCSIDriveList, error) {
items := []v1beta4.DirectCSIDrive{
{
Status: v1beta4.DirectCSIDriveStatus{
Path: "/var/lib/direct-csi/devices/test-part-dev1-directcsi",
AllocatedCapacity: 0,
FreeCapacity: 4772382377372,
RootPartition: "/",
PartitionNum: 0,
Filesystem: "nfs",
Mountpoint: "",
NodeName: "test-dev1-directcsi",
DriveStatus: v1beta4.DriveStatusAvailable,
ModelNumber: "testModel",
SerialNumber: "testSN2",
TotalCapacity: 4772382377372,
PhysicalBlockSize: 1024,
LogicalBlockSize: 1024,
AccessTier: "",
FilesystemUUID: "",
PartitionUUID: "",
MajorNumber: 0,
MinorNumber: 0,
UeventSerial: "",
UeventFSUUID: "",
WWID: "",
Vendor: "",
DMName: "",
DMUUID: "",
MDUUID: "",
PartTableUUID: "",
PartTableType: "",
Virtual: false,
ReadOnly: false,
Partitioned: false,
SwapOn: false,
Master: "",
OtherMountsInfo: nil,
PCIPath: "",
SerialNumberLong: "",
Conditions: nil,
},
},
}
returnList := v1beta4.DirectCSIDriveList{
Items: items,
}
return &returnList, nil
},
drives: []string{"test-dev1-directcsi:/dev/testdev1-directcsi"},
force: false,
wantErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
dpdClientListMock = tt.mockListDrives
_, err := formatDrives(tt.args.ctx, tt.drivesClient, tt.drives, tt.force)
if (err != nil) != tt.wantErr {
t.Errorf("getNamespaceCreated() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}

View File

@@ -18,18 +18,18 @@
// Package operatorapi MinIO Console Server
//
// Schemes:
// http
// ws
// Host: localhost
// BasePath: /api/v1
// Version: 0.1.0
// Schemes:
// http
// ws
// Host: localhost
// BasePath: /api/v1
// Version: 0.1.0
//
// Consumes:
// - application/json
// Consumes:
// - application/json
//
// Produces:
// - application/json
// Produces:
// - application/json
//
// swagger:meta
package operatorapi

File diff suppressed because it is too large Load Diff

View File

@@ -101,7 +101,7 @@ func getLoginDetailsResponse(params authApi.LoginDetailParams) (*models.LoginDet
r := params.HTTPRequest
loginStrategy := models.LoginDetailsLoginStrategyServiceDashAccount
redirectURL := ""
redirectURL := []string{}
if oauth2.IsIDPEnabled() {
loginStrategy = models.LoginDetailsLoginStrategyRedirectDashServiceDashAccount
@@ -111,13 +111,17 @@ func getLoginDetailsResponse(params authApi.LoginDetailParams) (*models.LoginDet
return nil, restapi.ErrorWithContext(ctx, err)
}
// Validate user against IDP
identityProvider := &auth.IdentityProvider{Client: oauth2Client}
redirectURL = identityProvider.GenerateLoginURL()
identityProvider := &auth.IdentityProvider{
KeyFunc: oauth2.DefaultDerivedKey,
Client: oauth2Client,
}
redirectURL = append(redirectURL, identityProvider.GenerateLoginURL())
}
loginDetails := &models.LoginDetails{
LoginStrategy: loginStrategy,
Redirect: redirectURL,
IsDirectPV: getDirectPVEnabled(),
}
return loginDetails, nil
}
@@ -145,7 +149,10 @@ func getLoginOauth2AuthResponse(params authApi.LoginOauth2AuthParams) (*models.L
return nil, restapi.ErrorWithContext(ctx, err)
}
// initialize new identity provider
identityProvider := auth.IdentityProvider{Client: oauth2Client}
identityProvider := auth.IdentityProvider{
KeyFunc: oauth2.DefaultDerivedKey,
Client: oauth2Client,
}
// Validate user against IDP
_, err = verifyUserAgainstIDP(ctx, identityProvider, *lr.Code, *lr.State)
if err != nil {

View File

@@ -19,7 +19,9 @@ package operatorapi
import (
"context"
"errors"
"fmt"
"net/http"
"net/http/httptest"
"os"
"testing"
@@ -34,6 +36,7 @@ import (
var (
testWithError = false
testServerWithError = false
errMock = errors.New("mock error")
k8sClientGetConfigMapMock func(ctx context.Context, namespace, configMap string, opts metav1.GetOptions) (*corev1.ConfigMap, error)
k8sClientCreateConfigMapMock func(ctx context.Context, namespace string, cm *corev1.ConfigMap, opts metav1.CreateOptions) (*corev1.ConfigMap, error)
@@ -43,9 +46,10 @@ var (
type MarketplaceTestSuite struct {
suite.Suite
assert *assert.Assertions
kClient k8sClientMock
namespace string
assert *assert.Assertions
kClient k8sClientMock
namespace string
postServer *httptest.Server
}
func (c k8sClientMock) getConfigMap(ctx context.Context, namespace, configMap string, opts metav1.GetOptions) (*corev1.ConfigMap, error) {
@@ -72,6 +76,17 @@ func (suite *MarketplaceTestSuite) SetupSuite() {
k8sClientUpdateConfigMapMock = suite.updateConfigMapMock
k8sClientDeleteConfigMapMock = suite.deleteConfigMapMock
os.Setenv(mpConfigMapKey, "mp-mock-config")
suite.postServer = httptest.NewServer(http.HandlerFunc(suite.postHandler))
}
func (suite *MarketplaceTestSuite) postHandler(
w http.ResponseWriter, r *http.Request,
) {
if testServerWithError {
w.WriteHeader(400)
} else {
fmt.Fprintf(w, `{"post": "Post response"}`)
}
}
func (suite *MarketplaceTestSuite) TearDownSuite() {
@@ -173,14 +188,26 @@ func (suite *MarketplaceTestSuite) TestSetMPIntegrationWithError() {
os.Unsetenv(mpHostEnvVar)
}
// TODO: Add mock server for testing microservice
// func (suite *MarketplaceTestSuite) TestSetMPIntegrationNoError() {
// testWithError = false
// ctx, cancel := context.WithCancel(context.Background())
// defer cancel()
// err := setMPIntegration(ctx, "mock@mock.com", "token", &suite.kClient)
// suite.assert.Nil(err)
// }
func (suite *MarketplaceTestSuite) TestSetMPIntegrationNoError() {
testWithError = false
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
os.Setenv(mpHostEnvVar, suite.postServer.URL)
err := setMPIntegration(ctx, "mock@mock.com", false, &suite.kClient)
suite.assert.Nil(err)
os.Unsetenv(mpHostEnvVar)
}
func (suite *MarketplaceTestSuite) TestSetMPIntegrationWithRequestError() {
testWithError = false
testServerWithError = true
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
os.Setenv(mpHostEnvVar, suite.postServer.URL)
err := setMPIntegration(ctx, "mock@mock.com", false, &suite.kClient)
suite.assert.NotNil(err)
os.Unsetenv(mpHostEnvVar)
}
func TestMarketplace(t *testing.T) {
suite.Run(t, new(MarketplaceTestSuite))

View File

@@ -22,8 +22,10 @@ import (
)
type (
opClientMock struct{}
httpClientMock struct{}
opClientMock struct{}
httpClientMock struct{}
directPVDriveMock struct{}
directPVVolumeMock struct{}
)
func createMockPVC(pvcMockName, pvcMockNamespace string) *v1.PersistentVolumeClaim {

View File

@@ -46,10 +46,10 @@ func NewLoginDetail(ctx *middleware.Context, handler LoginDetailHandler) *LoginD
return &LoginDetail{Context: ctx, Handler: handler}
}
/* LoginDetail swagger:route GET /login Auth loginDetail
/*
LoginDetail swagger:route GET /login Auth loginDetail
Returns login strategy, form or sso.
*/
type LoginDetail struct {
Context *middleware.Context

View File

@@ -33,7 +33,8 @@ import (
// LoginDetailOKCode is the HTTP code returned for type LoginDetailOK
const LoginDetailOKCode int = 200
/*LoginDetailOK A successful response.
/*
LoginDetailOK A successful response.
swagger:response loginDetailOK
*/
@@ -74,7 +75,8 @@ func (o *LoginDetailOK) WriteResponse(rw http.ResponseWriter, producer runtime.P
}
}
/*LoginDetailDefault Generic error response.
/*
LoginDetailDefault Generic error response.
swagger:response loginDetailDefault
*/

View File

@@ -46,10 +46,10 @@ func NewLoginOauth2Auth(ctx *middleware.Context, handler LoginOauth2AuthHandler)
return &LoginOauth2Auth{Context: ctx, Handler: handler}
}
/* LoginOauth2Auth swagger:route POST /login/oauth2/auth Auth loginOauth2Auth
/*
LoginOauth2Auth swagger:route POST /login/oauth2/auth Auth loginOauth2Auth
Identity Provider oauth2 callback endpoint.
*/
type LoginOauth2Auth struct {
Context *middleware.Context

View File

@@ -23,7 +23,6 @@ package auth
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"io"
"net/http"
@@ -83,7 +82,7 @@ func (o *LoginOauth2AuthParams) BindRequest(r *http.Request, route *middleware.M
res = append(res, err)
}
ctx := validate.WithOperationRequest(context.Background())
ctx := validate.WithOperationRequest(r.Context())
if err := body.ContextValidate(ctx, route.Formats); err != nil {
res = append(res, err)
}

View File

@@ -33,7 +33,8 @@ import (
// LoginOauth2AuthNoContentCode is the HTTP code returned for type LoginOauth2AuthNoContent
const LoginOauth2AuthNoContentCode int = 204
/*LoginOauth2AuthNoContent A successful login.
/*
LoginOauth2AuthNoContent A successful login.
swagger:response loginOauth2AuthNoContent
*/
@@ -54,7 +55,8 @@ func (o *LoginOauth2AuthNoContent) WriteResponse(rw http.ResponseWriter, produce
rw.WriteHeader(204)
}
/*LoginOauth2AuthDefault Generic error response.
/*
LoginOauth2AuthDefault Generic error response.
swagger:response loginOauth2AuthDefault
*/

View File

@@ -46,10 +46,10 @@ func NewLoginOperator(ctx *middleware.Context, handler LoginOperatorHandler) *Lo
return &LoginOperator{Context: ctx, Handler: handler}
}
/* LoginOperator swagger:route POST /login/operator Auth loginOperator
/*
LoginOperator swagger:route POST /login/operator Auth loginOperator
Login to Operator Console.
*/
type LoginOperator struct {
Context *middleware.Context

View File

@@ -23,7 +23,6 @@ package auth
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"io"
"net/http"
@@ -83,7 +82,7 @@ func (o *LoginOperatorParams) BindRequest(r *http.Request, route *middleware.Mat
res = append(res, err)
}
ctx := validate.WithOperationRequest(context.Background())
ctx := validate.WithOperationRequest(r.Context())
if err := body.ContextValidate(ctx, route.Formats); err != nil {
res = append(res, err)
}

View File

@@ -33,7 +33,8 @@ import (
// LoginOperatorNoContentCode is the HTTP code returned for type LoginOperatorNoContent
const LoginOperatorNoContentCode int = 204
/*LoginOperatorNoContent A successful login.
/*
LoginOperatorNoContent A successful login.
swagger:response loginOperatorNoContent
*/
@@ -54,7 +55,8 @@ func (o *LoginOperatorNoContent) WriteResponse(rw http.ResponseWriter, producer
rw.WriteHeader(204)
}
/*LoginOperatorDefault Generic error response.
/*
LoginOperatorDefault Generic error response.
swagger:response loginOperatorDefault
*/

View File

@@ -48,10 +48,10 @@ func NewLogout(ctx *middleware.Context, handler LogoutHandler) *Logout {
return &Logout{Context: ctx, Handler: handler}
}
/* Logout swagger:route POST /logout Auth logout
/*
Logout swagger:route POST /logout Auth logout
Logout from Operator.
*/
type Logout struct {
Context *middleware.Context

View File

@@ -33,7 +33,8 @@ import (
// LogoutOKCode is the HTTP code returned for type LogoutOK
const LogoutOKCode int = 200
/*LogoutOK A successful response.
/*
LogoutOK A successful response.
swagger:response logoutOK
*/
@@ -54,7 +55,8 @@ func (o *LogoutOK) WriteResponse(rw http.ResponseWriter, producer runtime.Produc
rw.WriteHeader(200)
}
/*LogoutDefault Generic error response.
/*
LogoutDefault Generic error response.
swagger:response logoutDefault
*/

View File

@@ -48,10 +48,10 @@ func NewSessionCheck(ctx *middleware.Context, handler SessionCheckHandler) *Sess
return &SessionCheck{Context: ctx, Handler: handler}
}
/* SessionCheck swagger:route GET /session Auth sessionCheck
/*
SessionCheck swagger:route GET /session Auth sessionCheck
Endpoint to check if your session is still valid
*/
type SessionCheck struct {
Context *middleware.Context

View File

@@ -33,7 +33,8 @@ import (
// SessionCheckOKCode is the HTTP code returned for type SessionCheckOK
const SessionCheckOKCode int = 200
/*SessionCheckOK A successful response.
/*
SessionCheckOK A successful response.
swagger:response sessionCheckOK
*/
@@ -74,7 +75,8 @@ func (o *SessionCheckOK) WriteResponse(rw http.ResponseWriter, producer runtime.
}
}
/*SessionCheckDefault Generic error response.
/*
SessionCheckDefault Generic error response.
swagger:response sessionCheckDefault
*/

View File

@@ -85,6 +85,9 @@ func NewOperatorAPI(spec *loads.Document) *OperatorAPI {
OperatorAPIDescribePodHandler: operator_api.DescribePodHandlerFunc(func(params operator_api.DescribePodParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation operator_api.DescribePod has not yet been implemented")
}),
OperatorAPIDirectPVFormatDriveHandler: operator_api.DirectPVFormatDriveHandlerFunc(func(params operator_api.DirectPVFormatDriveParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation operator_api.DirectPVFormatDrive has not yet been implemented")
}),
OperatorAPIDisableTenantLoggingHandler: operator_api.DisableTenantLoggingHandlerFunc(func(params operator_api.DisableTenantLoggingParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation operator_api.DisableTenantLogging has not yet been implemented")
}),
@@ -94,6 +97,12 @@ func NewOperatorAPI(spec *loads.Document) *OperatorAPI {
OperatorAPIGetAllocatableResourcesHandler: operator_api.GetAllocatableResourcesHandlerFunc(func(params operator_api.GetAllocatableResourcesParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation operator_api.GetAllocatableResources has not yet been implemented")
}),
OperatorAPIGetDirectPVDriveListHandler: operator_api.GetDirectPVDriveListHandlerFunc(func(params operator_api.GetDirectPVDriveListParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation operator_api.GetDirectPVDriveList has not yet been implemented")
}),
OperatorAPIGetDirectPVVolumeListHandler: operator_api.GetDirectPVVolumeListHandlerFunc(func(params operator_api.GetDirectPVVolumeListParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation operator_api.GetDirectPVVolumeList has not yet been implemented")
}),
OperatorAPIGetMPIntegrationHandler: operator_api.GetMPIntegrationHandlerFunc(func(params operator_api.GetMPIntegrationParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation operator_api.GetMPIntegration has not yet been implemented")
}),
@@ -166,6 +175,21 @@ func NewOperatorAPI(spec *loads.Document) *OperatorAPI {
AuthLogoutHandler: auth.LogoutHandlerFunc(func(params auth.LogoutParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation auth.Logout has not yet been implemented")
}),
OperatorAPIOperatorSubnetAPIKeyInfoHandler: operator_api.OperatorSubnetAPIKeyInfoHandlerFunc(func(params operator_api.OperatorSubnetAPIKeyInfoParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation operator_api.OperatorSubnetAPIKeyInfo has not yet been implemented")
}),
OperatorAPIOperatorSubnetAPIKeyHandler: operator_api.OperatorSubnetAPIKeyHandlerFunc(func(params operator_api.OperatorSubnetAPIKeyParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation operator_api.OperatorSubnetAPIKey has not yet been implemented")
}),
OperatorAPIOperatorSubnetLoginHandler: operator_api.OperatorSubnetLoginHandlerFunc(func(params operator_api.OperatorSubnetLoginParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation operator_api.OperatorSubnetLogin has not yet been implemented")
}),
OperatorAPIOperatorSubnetLoginMFAHandler: operator_api.OperatorSubnetLoginMFAHandlerFunc(func(params operator_api.OperatorSubnetLoginMFAParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation operator_api.OperatorSubnetLoginMFA has not yet been implemented")
}),
OperatorAPIOperatorSubnetRegisterAPIKeyHandler: operator_api.OperatorSubnetRegisterAPIKeyHandlerFunc(func(params operator_api.OperatorSubnetRegisterAPIKeyParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation operator_api.OperatorSubnetRegisterAPIKey has not yet been implemented")
}),
OperatorAPIPostMPIntegrationHandler: operator_api.PostMPIntegrationHandlerFunc(func(params operator_api.PostMPIntegrationParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation operator_api.PostMPIntegration has not yet been implemented")
}),
@@ -298,12 +322,18 @@ type OperatorAPI struct {
OperatorAPIDeleteTenantHandler operator_api.DeleteTenantHandler
// OperatorAPIDescribePodHandler sets the operation handler for the describe pod operation
OperatorAPIDescribePodHandler operator_api.DescribePodHandler
// OperatorAPIDirectPVFormatDriveHandler sets the operation handler for the direct p v format drive operation
OperatorAPIDirectPVFormatDriveHandler operator_api.DirectPVFormatDriveHandler
// OperatorAPIDisableTenantLoggingHandler sets the operation handler for the disable tenant logging operation
OperatorAPIDisableTenantLoggingHandler operator_api.DisableTenantLoggingHandler
// OperatorAPIEnableTenantLoggingHandler sets the operation handler for the enable tenant logging operation
OperatorAPIEnableTenantLoggingHandler operator_api.EnableTenantLoggingHandler
// OperatorAPIGetAllocatableResourcesHandler sets the operation handler for the get allocatable resources operation
OperatorAPIGetAllocatableResourcesHandler operator_api.GetAllocatableResourcesHandler
// OperatorAPIGetDirectPVDriveListHandler sets the operation handler for the get direct p v drive list operation
OperatorAPIGetDirectPVDriveListHandler operator_api.GetDirectPVDriveListHandler
// OperatorAPIGetDirectPVVolumeListHandler sets the operation handler for the get direct p v volume list operation
OperatorAPIGetDirectPVVolumeListHandler operator_api.GetDirectPVVolumeListHandler
// OperatorAPIGetMPIntegrationHandler sets the operation handler for the get m p integration operation
OperatorAPIGetMPIntegrationHandler operator_api.GetMPIntegrationHandler
// OperatorAPIGetMaxAllocatableMemHandler sets the operation handler for the get max allocatable mem operation
@@ -352,6 +382,16 @@ type OperatorAPI struct {
AuthLoginOperatorHandler auth.LoginOperatorHandler
// AuthLogoutHandler sets the operation handler for the logout operation
AuthLogoutHandler auth.LogoutHandler
// OperatorAPIOperatorSubnetAPIKeyInfoHandler sets the operation handler for the operator subnet API key info operation
OperatorAPIOperatorSubnetAPIKeyInfoHandler operator_api.OperatorSubnetAPIKeyInfoHandler
// OperatorAPIOperatorSubnetAPIKeyHandler sets the operation handler for the operator subnet Api key operation
OperatorAPIOperatorSubnetAPIKeyHandler operator_api.OperatorSubnetAPIKeyHandler
// OperatorAPIOperatorSubnetLoginHandler sets the operation handler for the operator subnet login operation
OperatorAPIOperatorSubnetLoginHandler operator_api.OperatorSubnetLoginHandler
// OperatorAPIOperatorSubnetLoginMFAHandler sets the operation handler for the operator subnet login m f a operation
OperatorAPIOperatorSubnetLoginMFAHandler operator_api.OperatorSubnetLoginMFAHandler
// OperatorAPIOperatorSubnetRegisterAPIKeyHandler sets the operation handler for the operator subnet register API key operation
OperatorAPIOperatorSubnetRegisterAPIKeyHandler operator_api.OperatorSubnetRegisterAPIKeyHandler
// OperatorAPIPostMPIntegrationHandler sets the operation handler for the post m p integration operation
OperatorAPIPostMPIntegrationHandler operator_api.PostMPIntegrationHandler
// OperatorAPIPutTenantYAMLHandler sets the operation handler for the put tenant y a m l operation
@@ -500,6 +540,9 @@ func (o *OperatorAPI) Validate() error {
if o.OperatorAPIDescribePodHandler == nil {
unregistered = append(unregistered, "operator_api.DescribePodHandler")
}
if o.OperatorAPIDirectPVFormatDriveHandler == nil {
unregistered = append(unregistered, "operator_api.DirectPVFormatDriveHandler")
}
if o.OperatorAPIDisableTenantLoggingHandler == nil {
unregistered = append(unregistered, "operator_api.DisableTenantLoggingHandler")
}
@@ -509,6 +552,12 @@ func (o *OperatorAPI) Validate() error {
if o.OperatorAPIGetAllocatableResourcesHandler == nil {
unregistered = append(unregistered, "operator_api.GetAllocatableResourcesHandler")
}
if o.OperatorAPIGetDirectPVDriveListHandler == nil {
unregistered = append(unregistered, "operator_api.GetDirectPVDriveListHandler")
}
if o.OperatorAPIGetDirectPVVolumeListHandler == nil {
unregistered = append(unregistered, "operator_api.GetDirectPVVolumeListHandler")
}
if o.OperatorAPIGetMPIntegrationHandler == nil {
unregistered = append(unregistered, "operator_api.GetMPIntegrationHandler")
}
@@ -581,6 +630,21 @@ func (o *OperatorAPI) Validate() error {
if o.AuthLogoutHandler == nil {
unregistered = append(unregistered, "auth.LogoutHandler")
}
if o.OperatorAPIOperatorSubnetAPIKeyInfoHandler == nil {
unregistered = append(unregistered, "operator_api.OperatorSubnetAPIKeyInfoHandler")
}
if o.OperatorAPIOperatorSubnetAPIKeyHandler == nil {
unregistered = append(unregistered, "operator_api.OperatorSubnetAPIKeyHandler")
}
if o.OperatorAPIOperatorSubnetLoginHandler == nil {
unregistered = append(unregistered, "operator_api.OperatorSubnetLoginHandler")
}
if o.OperatorAPIOperatorSubnetLoginMFAHandler == nil {
unregistered = append(unregistered, "operator_api.OperatorSubnetLoginMFAHandler")
}
if o.OperatorAPIOperatorSubnetRegisterAPIKeyHandler == nil {
unregistered = append(unregistered, "operator_api.OperatorSubnetRegisterAPIKeyHandler")
}
if o.OperatorAPIPostMPIntegrationHandler == nil {
unregistered = append(unregistered, "operator_api.PostMPIntegrationHandler")
}
@@ -779,6 +843,10 @@ func (o *OperatorAPI) initHandlerCache() {
if o.handlers["POST"] == nil {
o.handlers["POST"] = make(map[string]http.Handler)
}
o.handlers["POST"]["/directpv/drives/format"] = operator_api.NewDirectPVFormatDrive(o.context, o.OperatorAPIDirectPVFormatDriveHandler)
if o.handlers["POST"] == nil {
o.handlers["POST"] = make(map[string]http.Handler)
}
o.handlers["POST"]["/namespaces/{namespace}/tenants/{tenant}/disable-logging"] = operator_api.NewDisableTenantLogging(o.context, o.OperatorAPIDisableTenantLoggingHandler)
if o.handlers["POST"] == nil {
o.handlers["POST"] = make(map[string]http.Handler)
@@ -791,6 +859,14 @@ func (o *OperatorAPI) initHandlerCache() {
if o.handlers["GET"] == nil {
o.handlers["GET"] = make(map[string]http.Handler)
}
o.handlers["GET"]["/directpv/drives"] = operator_api.NewGetDirectPVDriveList(o.context, o.OperatorAPIGetDirectPVDriveListHandler)
if o.handlers["GET"] == nil {
o.handlers["GET"] = make(map[string]http.Handler)
}
o.handlers["GET"]["/directpv/volumes"] = operator_api.NewGetDirectPVVolumeList(o.context, o.OperatorAPIGetDirectPVVolumeListHandler)
if o.handlers["GET"] == nil {
o.handlers["GET"] = make(map[string]http.Handler)
}
o.handlers["GET"]["/mp-integration"] = operator_api.NewGetMPIntegration(o.context, o.OperatorAPIGetMPIntegrationHandler)
if o.handlers["GET"] == nil {
o.handlers["GET"] = make(map[string]http.Handler)
@@ -884,6 +960,26 @@ func (o *OperatorAPI) initHandlerCache() {
o.handlers["POST"] = make(map[string]http.Handler)
}
o.handlers["POST"]["/logout"] = auth.NewLogout(o.context, o.AuthLogoutHandler)
if o.handlers["GET"] == nil {
o.handlers["GET"] = make(map[string]http.Handler)
}
o.handlers["GET"]["/subnet/apikey/info"] = operator_api.NewOperatorSubnetAPIKeyInfo(o.context, o.OperatorAPIOperatorSubnetAPIKeyInfoHandler)
if o.handlers["GET"] == nil {
o.handlers["GET"] = make(map[string]http.Handler)
}
o.handlers["GET"]["/subnet/apikey"] = operator_api.NewOperatorSubnetAPIKey(o.context, o.OperatorAPIOperatorSubnetAPIKeyHandler)
if o.handlers["POST"] == nil {
o.handlers["POST"] = make(map[string]http.Handler)
}
o.handlers["POST"]["/subnet/login"] = operator_api.NewOperatorSubnetLogin(o.context, o.OperatorAPIOperatorSubnetLoginHandler)
if o.handlers["POST"] == nil {
o.handlers["POST"] = make(map[string]http.Handler)
}
o.handlers["POST"]["/subnet/login/mfa"] = operator_api.NewOperatorSubnetLoginMFA(o.context, o.OperatorAPIOperatorSubnetLoginMFAHandler)
if o.handlers["POST"] == nil {
o.handlers["POST"] = make(map[string]http.Handler)
}
o.handlers["POST"]["/subnet/apikey/register"] = operator_api.NewOperatorSubnetRegisterAPIKey(o.context, o.OperatorAPIOperatorSubnetRegisterAPIKeyHandler)
if o.handlers["POST"] == nil {
o.handlers["POST"] = make(map[string]http.Handler)
}

View File

@@ -48,10 +48,10 @@ func NewCreateNamespace(ctx *middleware.Context, handler CreateNamespaceHandler)
return &CreateNamespace{Context: ctx, Handler: handler}
}
/* CreateNamespace swagger:route POST /namespace OperatorAPI createNamespace
/*
CreateNamespace swagger:route POST /namespace OperatorAPI createNamespace
Creates a new Namespace with given information
*/
type CreateNamespace struct {
Context *middleware.Context

View File

@@ -23,7 +23,6 @@ package operator_api
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"io"
"net/http"
@@ -83,7 +82,7 @@ func (o *CreateNamespaceParams) BindRequest(r *http.Request, route *middleware.M
res = append(res, err)
}
ctx := validate.WithOperationRequest(context.Background())
ctx := validate.WithOperationRequest(r.Context())
if err := body.ContextValidate(ctx, route.Formats); err != nil {
res = append(res, err)
}

View File

@@ -33,7 +33,8 @@ import (
// CreateNamespaceCreatedCode is the HTTP code returned for type CreateNamespaceCreated
const CreateNamespaceCreatedCode int = 201
/*CreateNamespaceCreated A successful response.
/*
CreateNamespaceCreated A successful response.
swagger:response createNamespaceCreated
*/
@@ -54,7 +55,8 @@ func (o *CreateNamespaceCreated) WriteResponse(rw http.ResponseWriter, producer
rw.WriteHeader(201)
}
/*CreateNamespaceDefault Generic error response.
/*
CreateNamespaceDefault Generic error response.
swagger:response createNamespaceDefault
*/

View File

@@ -48,10 +48,10 @@ func NewCreateTenant(ctx *middleware.Context, handler CreateTenantHandler) *Crea
return &CreateTenant{Context: ctx, Handler: handler}
}
/* CreateTenant swagger:route POST /tenants OperatorAPI createTenant
/*
CreateTenant swagger:route POST /tenants OperatorAPI createTenant
Create Tenant
*/
type CreateTenant struct {
Context *middleware.Context

View File

@@ -23,7 +23,6 @@ package operator_api
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"io"
"net/http"
@@ -83,7 +82,7 @@ func (o *CreateTenantParams) BindRequest(r *http.Request, route *middleware.Matc
res = append(res, err)
}
ctx := validate.WithOperationRequest(context.Background())
ctx := validate.WithOperationRequest(r.Context())
if err := body.ContextValidate(ctx, route.Formats); err != nil {
res = append(res, err)
}

Some files were not shown because too many files have changed in this diff Show More