mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
vendor files
This commit is contained in:
2
vendor/github.com/container-storage-interface/spec/.gitignore
generated
vendored
Normal file
2
vendor/github.com/container-storage-interface/spec/.gitignore
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/csi.proto.tmp
|
||||
.DS_Store
|
38
vendor/github.com/container-storage-interface/spec/.travis.yml
generated
vendored
Normal file
38
vendor/github.com/container-storage-interface/spec/.travis.yml
generated
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
# Setting "sudo" to false forces Travis-CI to use its
|
||||
# container-based build infrastructure, which has shorter
|
||||
# queue times.
|
||||
sudo: false
|
||||
|
||||
# Use the newer Travis-CI build templates based on the
|
||||
# Debian Linux distribution "Trusty" release.
|
||||
dist: trusty
|
||||
|
||||
# Selecting C as the language keeps the container to a
|
||||
# minimum footprint.
|
||||
language: c
|
||||
|
||||
jobs:
|
||||
include:
|
||||
|
||||
# The test stage validates that the protobuf file was updated
|
||||
# correctly prior to being committed.
|
||||
- stage: test
|
||||
script: make
|
||||
|
||||
# The lang stages validate the specification using
|
||||
# language-specific bindings.
|
||||
|
||||
# Lang stage: Cxx
|
||||
- stage: lang
|
||||
script: make -C lib/cxx
|
||||
|
||||
# Lang stage: Go
|
||||
- stage: lang
|
||||
language: go
|
||||
go: 1.8.3
|
||||
go_import_path: github.com/container-storage-interface/spec
|
||||
install:
|
||||
- make -C lib/go protoc
|
||||
- make -C lib/go protoc-gen-go
|
||||
script:
|
||||
- make -C lib/go
|
48
vendor/github.com/container-storage-interface/spec/CONTRIBUTING.md
generated
vendored
Normal file
48
vendor/github.com/container-storage-interface/spec/CONTRIBUTING.md
generated
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
# How to Contribute
|
||||
|
||||
CSI is under [Apache 2.0](LICENSE) and accepts contributions via GitHub pull requests.
|
||||
This document outlines some of the conventions on development workflow, commit message formatting, contact points and other resources to make it easier to get your contribution accepted.
|
||||
|
||||
## Markdown style
|
||||
|
||||
To keep consistency throughout the Markdown files in the CSI spec, all files should be formatted one sentence per line.
|
||||
This fixes two things: it makes diffing easier with git and it resolves fights about line wrapping length.
|
||||
For example, this paragraph will span three lines in the Markdown source.
|
||||
|
||||
## Code style
|
||||
|
||||
This also applies to the code snippets in the markdown files.
|
||||
|
||||
* Please wrap the code at 72 characters.
|
||||
|
||||
## Comments
|
||||
|
||||
This also applies to the code snippets in the markdown files.
|
||||
|
||||
* End each sentence within a comment with a punctuation mark (please note that we generally prefer periods); this applies to incomplete sentences as well.
|
||||
* For trailing comments, leave one space between the end of the code and the beginning of the comment.
|
||||
|
||||
## Git commit
|
||||
|
||||
Prior to committing code please run `make` in order to update the protobuf file and any language bindings.
|
||||
|
||||
### Commit Style
|
||||
|
||||
Each commit should represent a single logical (atomic) change: this makes your changes easier to review.
|
||||
|
||||
* Try to avoid unrelated cleanups (e.g., typo fixes or style nits) in the same commit that makes functional changes.
|
||||
While typo fixes are great, including them in the same commit as functional changes makes the commit history harder to read.
|
||||
* Developers often make incremental commits to save their progress when working on a change, and then “rewrite history” (e.g., using `git rebase -i`) to create a clean set of commits once the change is ready to be reviewed.
|
||||
|
||||
Simple house-keeping for clean git history.
|
||||
Read more on [How to Write a Git Commit Message](http://chris.beams.io/posts/git-commit/) or the Discussion section of [`git-commit(1)`](http://git-scm.com/docs/git-commit).
|
||||
|
||||
* Separate the subject from body with a blank line.
|
||||
* Limit the subject line to 50 characters.
|
||||
* Capitalize the subject line.
|
||||
* Do not end the subject line with a period.
|
||||
* Use the imperative mood in the subject line.
|
||||
* Wrap the body at 72 characters.
|
||||
* Use the body to explain what and why vs. how.
|
||||
* If there was important/useful/essential conversation or information, copy or include a reference.
|
||||
* When possible, one keyword to scope the change in the subject (i.e. "README: ...", "tool: ...").
|
201
vendor/github.com/container-storage-interface/spec/LICENSE
generated
vendored
Normal file
201
vendor/github.com/container-storage-interface/spec/LICENSE
generated
vendored
Normal file
@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright {yyyy} {name of copyright owner}
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
50
vendor/github.com/container-storage-interface/spec/Makefile
generated
vendored
Normal file
50
vendor/github.com/container-storage-interface/spec/Makefile
generated
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
all: build
|
||||
|
||||
CSI_SPEC := spec.md
|
||||
CSI_PROTO := csi.proto
|
||||
|
||||
# This is the target for building the temporary CSI protobuf file.
|
||||
#
|
||||
# The temporary file is not versioned, and thus will always be
|
||||
# built on Travis-CI.
|
||||
$(CSI_PROTO).tmp: $(CSI_SPEC)
|
||||
cat $? | \
|
||||
sed -n -e '/```protobuf$$/,/```$$/ p' | \
|
||||
sed -e 's@^```.*$$@////////@g' > $@
|
||||
|
||||
# This is the target for building the CSI protobuf file.
|
||||
#
|
||||
# This target depends on its temp file, which is not versioned.
|
||||
# Therefore when built on Travis-CI the temp file will always
|
||||
# be built and trigger this target. On Travis-CI the temp file
|
||||
# is compared with the real file, and if they differ the build
|
||||
# will fail.
|
||||
#
|
||||
# Locally the temp file is simply copied over the real file.
|
||||
$(CSI_PROTO): $(CSI_PROTO).tmp
|
||||
ifeq (true,$(TRAVIS))
|
||||
diff "$@" "$?"
|
||||
else
|
||||
diff "$@" "$?" > /dev/null 2>&1 || cp -f "$?" "$@"
|
||||
endif
|
||||
|
||||
build: check
|
||||
|
||||
# If this is not running on Travis-CI then for sake of convenience
|
||||
# go ahead and update the language bindings as well.
|
||||
ifneq (true,$(TRAVIS))
|
||||
build:
|
||||
$(MAKE) -C lib/go
|
||||
$(MAKE) -C lib/cxx
|
||||
endif
|
||||
|
||||
clean:
|
||||
|
||||
clobber: clean
|
||||
rm -f $(CSI_PROTO) $(CSI_PROTO).tmp
|
||||
|
||||
# check generated files for violation of standards
|
||||
check: $(CSI_PROTO)
|
||||
awk '{ if (length > 72) print NR, $$0 }' $? | diff - /dev/null
|
||||
|
||||
.PHONY: clean clobber check
|
10
vendor/github.com/container-storage-interface/spec/OWNERS
generated
vendored
Normal file
10
vendor/github.com/container-storage-interface/spec/OWNERS
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
approvers:
|
||||
- saad-ali # Representing Kubernetes
|
||||
- thockin # Representing Kubernetes
|
||||
- jieyu # Representing Mesos
|
||||
- jdef # Representing Mesos
|
||||
- cpuguy83 # Representing Docker
|
||||
- mycure # Representing Docker
|
||||
- julian-hj # Representing Cloud Foundry
|
||||
- paulcwarren # Representing Cloud Foundry
|
||||
reviewers:
|
5
vendor/github.com/container-storage-interface/spec/README.md
generated
vendored
Normal file
5
vendor/github.com/container-storage-interface/spec/README.md
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
# Container Storage Interface (CSI) Specification [](https://travis-ci.org/container-storage-interface/spec)
|
||||
|
||||

|
||||
|
||||
This project contains the CSI [specification](spec.md) and [protobuf](csi.proto) files.
|
1
vendor/github.com/container-storage-interface/spec/VERSION
generated
vendored
Normal file
1
vendor/github.com/container-storage-interface/spec/VERSION
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
0.2.0
|
627
vendor/github.com/container-storage-interface/spec/csi.proto
generated
vendored
Normal file
627
vendor/github.com/container-storage-interface/spec/csi.proto
generated
vendored
Normal file
@ -0,0 +1,627 @@
|
||||
////////
|
||||
syntax = "proto3";
|
||||
package csi;
|
||||
////////
|
||||
////////
|
||||
service Identity {
|
||||
rpc GetSupportedVersions (GetSupportedVersionsRequest)
|
||||
returns (GetSupportedVersionsResponse) {}
|
||||
|
||||
rpc GetPluginInfo(GetPluginInfoRequest)
|
||||
returns (GetPluginInfoResponse) {}
|
||||
}
|
||||
|
||||
service Controller {
|
||||
rpc CreateVolume (CreateVolumeRequest)
|
||||
returns (CreateVolumeResponse) {}
|
||||
|
||||
rpc DeleteVolume (DeleteVolumeRequest)
|
||||
returns (DeleteVolumeResponse) {}
|
||||
|
||||
rpc ControllerPublishVolume (ControllerPublishVolumeRequest)
|
||||
returns (ControllerPublishVolumeResponse) {}
|
||||
|
||||
rpc ControllerUnpublishVolume (ControllerUnpublishVolumeRequest)
|
||||
returns (ControllerUnpublishVolumeResponse) {}
|
||||
|
||||
rpc ValidateVolumeCapabilities (ValidateVolumeCapabilitiesRequest)
|
||||
returns (ValidateVolumeCapabilitiesResponse) {}
|
||||
|
||||
rpc ListVolumes (ListVolumesRequest)
|
||||
returns (ListVolumesResponse) {}
|
||||
|
||||
rpc GetCapacity (GetCapacityRequest)
|
||||
returns (GetCapacityResponse) {}
|
||||
|
||||
rpc ControllerProbe (ControllerProbeRequest)
|
||||
returns (ControllerProbeResponse) {}
|
||||
|
||||
rpc ControllerGetCapabilities (ControllerGetCapabilitiesRequest)
|
||||
returns (ControllerGetCapabilitiesResponse) {}
|
||||
}
|
||||
|
||||
service Node {
|
||||
rpc NodePublishVolume (NodePublishVolumeRequest)
|
||||
returns (NodePublishVolumeResponse) {}
|
||||
|
||||
rpc NodeUnpublishVolume (NodeUnpublishVolumeRequest)
|
||||
returns (NodeUnpublishVolumeResponse) {}
|
||||
|
||||
rpc GetNodeID (GetNodeIDRequest)
|
||||
returns (GetNodeIDResponse) {}
|
||||
|
||||
rpc NodeProbe (NodeProbeRequest)
|
||||
returns (NodeProbeResponse) {}
|
||||
|
||||
rpc NodeGetCapabilities (NodeGetCapabilitiesRequest)
|
||||
returns (NodeGetCapabilitiesResponse) {}
|
||||
}
|
||||
////////
|
||||
////////
|
||||
message GetSupportedVersionsRequest {
|
||||
}
|
||||
|
||||
message GetSupportedVersionsResponse {
|
||||
// All the CSI versions that the Plugin supports. This field is
|
||||
// REQUIRED.
|
||||
repeated Version supported_versions = 1;
|
||||
}
|
||||
|
||||
// Specifies a version in Semantic Version 2.0 format.
|
||||
// (http://semver.org/spec/v2.0.0.html)
|
||||
message Version {
|
||||
uint32 major = 1; // This field is REQUIRED.
|
||||
uint32 minor = 2; // This field is REQUIRED.
|
||||
uint32 patch = 3; // This field is REQUIRED.
|
||||
}
|
||||
////////
|
||||
////////
|
||||
message GetPluginInfoRequest {
|
||||
// The API version assumed by the CO. This is a REQUIRED field.
|
||||
Version version = 1;
|
||||
}
|
||||
|
||||
message GetPluginInfoResponse {
|
||||
// The name MUST follow reverse domain name notation format
|
||||
// (https://en.wikipedia.org/wiki/Reverse_domain_name_notation).
|
||||
// It SHOULD include the plugin's host company name and the plugin
|
||||
// name, to minimize the possibility of collisions. It MUST be 63
|
||||
// characters or less, beginning and ending with an alphanumeric
|
||||
// character ([a-z0-9A-Z]) with dashes (-), underscores (_),
|
||||
// dots (.), and alphanumerics between. This field is REQUIRED.
|
||||
string name = 1;
|
||||
|
||||
// This field is REQUIRED. Value of this field is opaque to the CO.
|
||||
string vendor_version = 2;
|
||||
|
||||
// This field is OPTIONAL. Values are opaque to the CO.
|
||||
map<string, string> manifest = 3;
|
||||
}
|
||||
////////
|
||||
////////
|
||||
message CreateVolumeRequest {
|
||||
// The API version assumed by the CO. This field is REQUIRED.
|
||||
Version version = 1;
|
||||
|
||||
// The suggested name for the storage space. This field is REQUIRED.
|
||||
// It serves two purposes:
|
||||
// 1) Idempotency - This name is generated by the CO to achieve
|
||||
// idempotency. If `CreateVolume` fails, the volume may or may not
|
||||
// be provisioned. In this case, the CO may call `CreateVolume`
|
||||
// again, with the same name, to ensure the volume exists. The
|
||||
// Plugin should ensure that multiple `CreateVolume` calls for the
|
||||
// same name do not result in more than one piece of storage
|
||||
// provisioned corresponding to that name. If a Plugin is unable to
|
||||
// enforce idempotency, the CO's error recovery logic could result
|
||||
// in multiple (unused) volumes being provisioned.
|
||||
// 2) Suggested name - Some storage systems allow callers to specify
|
||||
// an identifier by which to refer to the newly provisioned
|
||||
// storage. If a storage system supports this, it can optionally
|
||||
// use this name as the identifier for the new volume.
|
||||
string name = 2;
|
||||
|
||||
// This field is OPTIONAL. This allows the CO to specify the capacity
|
||||
// requirement of the volume to be provisioned. If not specified, the
|
||||
// Plugin MAY choose an implementation-defined capacity range.
|
||||
CapacityRange capacity_range = 3;
|
||||
|
||||
// The capabilities that the provisioned volume MUST have: the Plugin
|
||||
// MUST provision a volume that could satisfy ALL of the
|
||||
// capabilities specified in this list. The Plugin MUST assume that
|
||||
// the CO MAY use the provisioned volume later with ANY of the
|
||||
// capabilities specified in this list. This also enables the CO to do
|
||||
// early validation: if ANY of the specified volume capabilities are
|
||||
// not supported by the Plugin, the call SHALL fail. This field is
|
||||
// REQUIRED.
|
||||
repeated VolumeCapability volume_capabilities = 4;
|
||||
|
||||
// Plugin specific parameters passed in as opaque key-value pairs.
|
||||
// This field is OPTIONAL. The Plugin is responsible for parsing and
|
||||
// validating these parameters. COs will treat these as opaque.
|
||||
map<string, string> parameters = 5;
|
||||
|
||||
// End user credentials used to authenticate/authorize volume creation
|
||||
// request.
|
||||
// This field contains credential data, for example username and
|
||||
// password. Each key must consist of alphanumeric characters, '-',
|
||||
// '_' or '.'. Each value MUST contain a valid string. An SP MAY
|
||||
// choose to accept binary (non-string) data by using a binary-to-text
|
||||
// encoding scheme, like base64. An SP SHALL advertise the
|
||||
// requirements for credentials in documentation. COs SHALL permit
|
||||
// users to pass through the required credentials. This information is
|
||||
// sensitive and MUST be treated as such (not logged, etc.) by the CO.
|
||||
// This field is OPTIONAL.
|
||||
map<string, string> user_credentials = 6;
|
||||
}
|
||||
|
||||
message CreateVolumeResponse {
|
||||
// Contains all attributes of the newly created volume that are
|
||||
// relevant to the CO along with information required by the Plugin
|
||||
// to uniquely identify the volume. This field is REQUIRED.
|
||||
VolumeInfo volume_info = 1;
|
||||
}
|
||||
|
||||
// Specify a capability of a volume.
|
||||
message VolumeCapability {
|
||||
// Indicate that the volume will be accessed via the block device API.
|
||||
message BlockVolume {
|
||||
// Intentionally empty, for now.
|
||||
}
|
||||
|
||||
// Indicate that the volume will be accessed via the filesystem API.
|
||||
message MountVolume {
|
||||
// The filesystem type. This field is OPTIONAL.
|
||||
// An empty string is equal to an unspecified field value.
|
||||
string fs_type = 1;
|
||||
|
||||
// The mount options that can be used for the volume. This field is
|
||||
// OPTIONAL. `mount_flags` MAY contain sensitive information.
|
||||
// Therefore, the CO and the Plugin MUST NOT leak this information
|
||||
// to untrusted entities. The total size of this repeated field
|
||||
// SHALL NOT exceed 4 KiB.
|
||||
repeated string mount_flags = 2;
|
||||
}
|
||||
|
||||
// Specify how a volume can be accessed.
|
||||
message AccessMode {
|
||||
enum Mode {
|
||||
UNKNOWN = 0;
|
||||
|
||||
// Can only be published once as read/write on a single node, at
|
||||
// any given time.
|
||||
SINGLE_NODE_WRITER = 1;
|
||||
|
||||
// Can only be published once as readonly on a single node, at
|
||||
// any given time.
|
||||
SINGLE_NODE_READER_ONLY = 2;
|
||||
|
||||
// Can be published as readonly at multiple nodes simultaneously.
|
||||
MULTI_NODE_READER_ONLY = 3;
|
||||
|
||||
// Can be published at multiple nodes simultaneously. Only one of
|
||||
// the node can be used as read/write. The rest will be readonly.
|
||||
MULTI_NODE_SINGLE_WRITER = 4;
|
||||
|
||||
// Can be published as read/write at multiple nodes
|
||||
// simultaneously.
|
||||
MULTI_NODE_MULTI_WRITER = 5;
|
||||
}
|
||||
|
||||
// This field is REQUIRED.
|
||||
Mode mode = 1;
|
||||
}
|
||||
|
||||
// Specifies what API the volume will be accessed using. One of the
|
||||
// following fields MUST be specified.
|
||||
oneof access_type {
|
||||
BlockVolume block = 1;
|
||||
MountVolume mount = 2;
|
||||
}
|
||||
|
||||
// This is a REQUIRED field.
|
||||
AccessMode access_mode = 3;
|
||||
}
|
||||
|
||||
// The capacity of the storage space in bytes. To specify an exact size,
|
||||
// `required_bytes` and `limit_bytes` can be set to the same value. At
|
||||
// least one of the these fields MUST be specified.
|
||||
message CapacityRange {
|
||||
// Volume must be at least this big. This field is OPTIONAL.
|
||||
// A value of 0 is equal to an unspecified field value.
|
||||
uint64 required_bytes = 1;
|
||||
|
||||
// Volume must not be bigger than this. This field is OPTIONAL.
|
||||
// A value of 0 is equal to an unspecified field value.
|
||||
uint64 limit_bytes = 2;
|
||||
}
|
||||
|
||||
// The information about a provisioned volume.
|
||||
message VolumeInfo {
|
||||
// The capacity of the volume in bytes. This field is OPTIONAL. If not
|
||||
// set (value of 0), it indicates that the capacity of the volume is
|
||||
// unknown (e.g., NFS share).
|
||||
uint64 capacity_bytes = 1;
|
||||
|
||||
// Contains identity information for the created volume. This field is
|
||||
// REQUIRED. The identity information will be used by the CO in
|
||||
// subsequent calls to refer to the provisioned volume.
|
||||
string id = 2;
|
||||
|
||||
// Attributes reflect static properties of a volume and MUST be passed
|
||||
// to volume validation and publishing calls.
|
||||
// Attributes SHALL be opaque to a CO. Attributes SHALL NOT be mutable
|
||||
// and SHALL be safe for the CO to cache. Attributes SHOULD NOT
|
||||
// contain sensitive information. Attributes MAY NOT uniquely identify
|
||||
// a volume. A volume uniquely identified by `id` SHALL always report
|
||||
// the same attributes. This field is OPTIONAL and when present MUST
|
||||
// be passed to volume validation and publishing calls.
|
||||
map<string,string> attributes = 3;
|
||||
}
|
||||
////////
|
||||
////////
|
||||
message DeleteVolumeRequest {
|
||||
// The API version assumed by the CO. This field is REQUIRED.
|
||||
Version version = 1;
|
||||
|
||||
// The ID of the volume to be deprovisioned.
|
||||
// This field is REQUIRED.
|
||||
string volume_id = 2;
|
||||
|
||||
// End user credentials used to authenticate/authorize volume deletion
|
||||
// request.
|
||||
// This field contains credential data, for example username and
|
||||
// password. Each key must consist of alphanumeric characters, '-',
|
||||
// '_' or '.'. Each value MUST contain a valid string. An SP MAY
|
||||
// choose to accept binary (non-string) data by using a binary-to-text
|
||||
// encoding scheme, like base64. An SP SHALL advertise the
|
||||
// requirements for credentials in documentation. COs SHALL permit
|
||||
// users to pass through the required credentials. This information is
|
||||
// sensitive and MUST be treated as such (not logged, etc.) by the CO.
|
||||
// This field is OPTIONAL.
|
||||
map<string, string> user_credentials = 3;
|
||||
}
|
||||
|
||||
message DeleteVolumeResponse {}
|
||||
////////
|
||||
////////
|
||||
message ControllerPublishVolumeRequest {
|
||||
// The API version assumed by the CO. This field is REQUIRED.
|
||||
Version version = 1;
|
||||
|
||||
// The ID of the volume to be used on a node.
|
||||
// This field is REQUIRED.
|
||||
string volume_id = 2;
|
||||
|
||||
// The ID of the node. This field is REQUIRED. The CO SHALL set this
|
||||
// field to match the node ID returned by `GetNodeID`.
|
||||
string node_id = 3;
|
||||
|
||||
// The capability of the volume the CO expects the volume to have.
|
||||
// This is a REQUIRED field.
|
||||
VolumeCapability volume_capability = 4;
|
||||
|
||||
// Whether to publish the volume in readonly mode. This field is
|
||||
// REQUIRED.
|
||||
bool readonly = 5;
|
||||
|
||||
// End user credentials used to authenticate/authorize controller
|
||||
// publish request.
|
||||
// This field contains credential data, for example username and
|
||||
// password. Each key must consist of alphanumeric characters, '-',
|
||||
// '_' or '.'. Each value MUST contain a valid string. An SP MAY
|
||||
// choose to accept binary (non-string) data by using a binary-to-text
|
||||
// encoding scheme, like base64. An SP SHALL advertise the
|
||||
// requirements for credentials in documentation. COs SHALL permit
|
||||
// users to pass through the required credentials. This information is
|
||||
// sensitive and MUST be treated as such (not logged, etc.) by the CO.
|
||||
// This field is OPTIONAL.
|
||||
map<string, string> user_credentials = 6;
|
||||
|
||||
// Attributes of the volume to be used on a node. This field is
|
||||
// OPTIONAL and MUST match the attributes of the VolumeInfo identified
|
||||
// by `volume_id`.
|
||||
map<string,string> volume_attributes = 7;
|
||||
}
|
||||
|
||||
message ControllerPublishVolumeResponse {
|
||||
// The SP specific information that will be passed to the Plugin in
|
||||
// the subsequent `NodePublishVolume` call for the given volume.
|
||||
// This information is opaque to the CO. This field is OPTIONAL.
|
||||
map<string, string> publish_volume_info = 1;
|
||||
}
|
||||
////////
|
||||
////////
|
||||
message ControllerUnpublishVolumeRequest {
|
||||
// The API version assumed by the CO. This field is REQUIRED.
|
||||
Version version = 1;
|
||||
|
||||
// The ID of the volume. This field is REQUIRED.
|
||||
string volume_id = 2;
|
||||
|
||||
// The ID of the node. This field is OPTIONAL. The CO SHOULD set this
|
||||
// field to match the node ID returned by `GetNodeID` or leave it
|
||||
// unset. If the value is set, the SP MUST unpublish the volume from
|
||||
// the specified node. If the value is unset, the SP MUST unpublish
|
||||
// the volume from all nodes it is published to.
|
||||
string node_id = 3;
|
||||
|
||||
// End user credentials used to authenticate/authorize controller
|
||||
// unpublish request.
|
||||
// This field contains credential data, for example username and
|
||||
// password. Each key must consist of alphanumeric characters, '-',
|
||||
// '_' or '.'. Each value MUST contain a valid string. An SP MAY
|
||||
// choose to accept binary (non-string) data by using a binary-to-text
|
||||
// encoding scheme, like base64. An SP SHALL advertise the
|
||||
// requirements for credentials in documentation. COs SHALL permit
|
||||
// users to pass through the required credentials. This information is
|
||||
// sensitive and MUST be treated as such (not logged, etc.) by the CO.
|
||||
// This field is OPTIONAL.
|
||||
map<string, string> user_credentials = 4;
|
||||
}
|
||||
|
||||
message ControllerUnpublishVolumeResponse {}
|
||||
////////
|
||||
////////
|
||||
message ValidateVolumeCapabilitiesRequest {
|
||||
// The API version assumed by the CO. This is a REQUIRED field.
|
||||
Version version = 1;
|
||||
|
||||
// The ID of the volume to check. This field is REQUIRED.
|
||||
string volume_id = 2;
|
||||
|
||||
// The capabilities that the CO wants to check for the volume. This
|
||||
// call SHALL return "supported" only if all the volume capabilities
|
||||
// specified below are supported. This field is REQUIRED.
|
||||
repeated VolumeCapability volume_capabilities = 3;
|
||||
|
||||
// Attributes of the volume to check. This field is OPTIONAL and MUST
|
||||
// match the attributes of the VolumeInfo identified by `volume_id`.
|
||||
map<string,string> volume_attributes = 4;
|
||||
}
|
||||
|
||||
message ValidateVolumeCapabilitiesResponse {
|
||||
// True if the Plugin supports the specified capabilities for the
|
||||
// given volume. This field is REQUIRED.
|
||||
bool supported = 1;
|
||||
|
||||
// Message to the CO if `supported` above is false. This field is
|
||||
// OPTIONAL.
|
||||
// An empty string is equal to an unspecified field value.
|
||||
string message = 2;
|
||||
}
|
||||
////////
|
||||
////////
|
||||
message ListVolumesRequest {
|
||||
// The API version assumed by the CO. This field is REQUIRED.
|
||||
Version version = 1;
|
||||
|
||||
// If specified (non-zero value), the Plugin MUST NOT return more
|
||||
// entries than this number in the response. If the actual number of
|
||||
// entries is more than this number, the Plugin MUST set `next_token`
|
||||
// in the response which can be used to get the next page of entries
|
||||
// in the subsequent `ListVolumes` call. This field is OPTIONAL. If
|
||||
// not specified (zero value), it means there is no restriction on the
|
||||
// number of entries that can be returned.
|
||||
uint32 max_entries = 2;
|
||||
|
||||
// A token to specify where to start paginating. Set this field to
|
||||
// `next_token` returned by a previous `ListVolumes` call to get the
|
||||
// next page of entries. This field is OPTIONAL.
|
||||
// An empty string is equal to an unspecified field value.
|
||||
string starting_token = 3;
|
||||
}
|
||||
|
||||
message ListVolumesResponse {
|
||||
message Entry {
|
||||
VolumeInfo volume_info = 1;
|
||||
}
|
||||
|
||||
repeated Entry entries = 1;
|
||||
|
||||
// This token allows you to get the next page of entries for
|
||||
// `ListVolumes` request. If the number of entries is larger than
|
||||
// `max_entries`, use the `next_token` as a value for the
|
||||
// `starting_token` field in the next `ListVolumes` request. This
|
||||
// field is OPTIONAL.
|
||||
// An empty string is equal to an unspecified field value.
|
||||
string next_token = 2;
|
||||
}
|
||||
////////
|
||||
////////
|
||||
message GetCapacityRequest {
|
||||
// The API version assumed by the CO. This is a REQUIRED field.
|
||||
Version version = 1;
|
||||
|
||||
// If specified, the Plugin SHALL report the capacity of the storage
|
||||
// that can be used to provision volumes that satisfy ALL of the
|
||||
// specified `volume_capabilities`. These are the same
|
||||
// `volume_capabilities` the CO will use in `CreateVolumeRequest`.
|
||||
// This field is OPTIONAL.
|
||||
repeated VolumeCapability volume_capabilities = 2;
|
||||
|
||||
// If specified, the Plugin SHALL report the capacity of the storage
|
||||
// that can be used to provision volumes with the given Plugin
|
||||
// specific `parameters`. These are the same `parameters` the CO will
|
||||
// use in `CreateVolumeRequest`. This field is OPTIONAL.
|
||||
map<string, string> parameters = 3;
|
||||
}
|
||||
|
||||
message GetCapacityResponse {
|
||||
// The available capacity of the storage that can be used to
|
||||
// provision volumes. If `volume_capabilities` or `parameters` is
|
||||
// specified in the request, the Plugin SHALL take those into
|
||||
// consideration when calculating the available capacity of the
|
||||
// storage. This field is REQUIRED.
|
||||
uint64 available_capacity = 1;
|
||||
}
|
||||
////////
|
||||
////////
|
||||
message ControllerProbeRequest {
|
||||
// The API version assumed by the CO. This is a REQUIRED field.
|
||||
Version version = 1;
|
||||
}
|
||||
|
||||
message ControllerProbeResponse {}
|
||||
////////
|
||||
////////
|
||||
message ControllerGetCapabilitiesRequest {
|
||||
// The API version assumed by the CO. This is a REQUIRED field.
|
||||
Version version = 1;
|
||||
}
|
||||
|
||||
message ControllerGetCapabilitiesResponse {
|
||||
// All the capabilities that the controller service supports. This
|
||||
// field is OPTIONAL.
|
||||
repeated ControllerServiceCapability capabilities = 2;
|
||||
}
|
||||
|
||||
// Specifies a capability of the controller service.
|
||||
message ControllerServiceCapability {
|
||||
message RPC {
|
||||
enum Type {
|
||||
UNKNOWN = 0;
|
||||
CREATE_DELETE_VOLUME = 1;
|
||||
PUBLISH_UNPUBLISH_VOLUME = 2;
|
||||
LIST_VOLUMES = 3;
|
||||
GET_CAPACITY = 4;
|
||||
}
|
||||
|
||||
Type type = 1;
|
||||
}
|
||||
|
||||
oneof type {
|
||||
// RPC that the controller supports.
|
||||
RPC rpc = 1;
|
||||
}
|
||||
}
|
||||
////////
|
||||
////////
|
||||
message NodePublishVolumeRequest {
|
||||
// The API version assumed by the CO. This is a REQUIRED field.
|
||||
Version version = 1;
|
||||
|
||||
// The ID of the volume to publish. This field is REQUIRED.
|
||||
string volume_id = 2;
|
||||
|
||||
// The CO SHALL set this field to the value returned by
|
||||
// `ControllerPublishVolume` if the corresponding Controller Plugin
|
||||
// has `PUBLISH_UNPUBLISH_VOLUME` controller capability, and SHALL be
|
||||
// left unset if the corresponding Controller Plugin does not have
|
||||
// this capability. This is an OPTIONAL field.
|
||||
map<string, string> publish_volume_info = 3;
|
||||
|
||||
// The path to which the volume will be published. It MUST be an
|
||||
// absolute path in the root filesystem of the process serving this
|
||||
// request. The CO SHALL ensure uniqueness of target_path per volume.
|
||||
// The CO SHALL ensure that the path exists, and that the process
|
||||
// serving the request has `read` and `write` permissions to the path.
|
||||
// This is a REQUIRED field.
|
||||
string target_path = 4;
|
||||
|
||||
// The capability of the volume the CO expects the volume to have.
|
||||
// This is a REQUIRED field.
|
||||
VolumeCapability volume_capability = 5;
|
||||
|
||||
// Whether to publish the volume in readonly mode. This field is
|
||||
// REQUIRED.
|
||||
bool readonly = 6;
|
||||
|
||||
// End user credentials used to authenticate/authorize node
|
||||
// publish request.
|
||||
// This field contains credential data, for example username and
|
||||
// password. Each key must consist of alphanumeric characters, '-',
|
||||
// '_' or '.'. Each value MUST contain a valid string. An SP MAY
|
||||
// choose to accept binary (non-string) data by using a binary-to-text
|
||||
// encoding scheme, like base64. An SP SHALL advertise the
|
||||
// requirements for credentials in documentation. COs SHALL permit
|
||||
// users to pass through the required credentials. This information is
|
||||
// sensitive and MUST be treated as such (not logged, etc.) by the CO.
|
||||
// This field is OPTIONAL.
|
||||
map<string, string> user_credentials = 7;
|
||||
|
||||
// Attributes of the volume to publish. This field is OPTIONAL and
|
||||
// MUST match the attributes of the VolumeInfo identified by
|
||||
// `volume_id`.
|
||||
map<string,string> volume_attributes = 8;
|
||||
}
|
||||
|
||||
message NodePublishVolumeResponse {}
|
||||
////////
|
||||
////////
|
||||
message NodeUnpublishVolumeRequest {
|
||||
// The API version assumed by the CO. This is a REQUIRED field.
|
||||
Version version = 1;
|
||||
|
||||
// The ID of the volume. This field is REQUIRED.
|
||||
string volume_id = 2;
|
||||
|
||||
// The path at which the volume was published. It MUST be an absolute
|
||||
// path in the root filesystem of the process serving this request.
|
||||
// This is a REQUIRED field.
|
||||
string target_path = 3;
|
||||
|
||||
// End user credentials used to authenticate/authorize node
|
||||
// unpublish request.
|
||||
// This field contains credential data, for example username and
|
||||
// password. Each key must consist of alphanumeric characters, '-',
|
||||
// '_' or '.'. Each value MUST contain a valid string. An SP MAY
|
||||
// choose to accept binary (non-string) data by using a binary-to-text
|
||||
// encoding scheme, like base64. An SP SHALL advertise the
|
||||
// requirements for credentials in documentation. COs SHALL permit
|
||||
// users to pass through the required credentials. This information is
|
||||
// sensitive and MUST be treated as such (not logged, etc.) by the CO.
|
||||
// This field is OPTIONAL.
|
||||
map<string, string> user_credentials = 4;
|
||||
}
|
||||
|
||||
message NodeUnpublishVolumeResponse {}
|
||||
////////
|
||||
////////
|
||||
message GetNodeIDRequest {
|
||||
// The API version assumed by the CO. This is a REQUIRED field.
|
||||
Version version = 1;
|
||||
}
|
||||
|
||||
message GetNodeIDResponse {
|
||||
// The ID of the node as understood by the SP which SHALL be used by
|
||||
// CO in subsequent `ControllerPublishVolume`.
|
||||
// This is a REQUIRED field.
|
||||
string node_id = 1;
|
||||
}
|
||||
////////
|
||||
////////
|
||||
message NodeProbeRequest {
|
||||
// The API version assumed by the CO. This is a REQUIRED field.
|
||||
Version version = 1;
|
||||
}
|
||||
|
||||
message NodeProbeResponse {}
|
||||
////////
|
||||
////////
|
||||
message NodeGetCapabilitiesRequest {
|
||||
// The API version assumed by the CO. This is a REQUIRED field.
|
||||
Version version = 1;
|
||||
}
|
||||
|
||||
message NodeGetCapabilitiesResponse {
|
||||
// All the capabilities that the node service supports. This field
|
||||
// is OPTIONAL.
|
||||
repeated NodeServiceCapability capabilities = 1;
|
||||
}
|
||||
|
||||
// Specifies a capability of the node service.
|
||||
message NodeServiceCapability {
|
||||
message RPC {
|
||||
enum Type {
|
||||
UNKNOWN = 0;
|
||||
}
|
||||
|
||||
Type type = 1;
|
||||
}
|
||||
|
||||
oneof type {
|
||||
// RPC that the controller supports.
|
||||
RPC rpc = 1;
|
||||
}
|
||||
}
|
||||
////////
|
2
vendor/github.com/container-storage-interface/spec/lib/README.md
generated
vendored
Normal file
2
vendor/github.com/container-storage-interface/spec/lib/README.md
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
# CSI Validation Libraries
|
||||
This directory contains language bindings generated from the CSI [protobuf file](../csi.proto) used to validate the model and workflows of the CSI specification.
|
9
vendor/github.com/container-storage-interface/spec/lib/cxx/Makefile
generated
vendored
Normal file
9
vendor/github.com/container-storage-interface/spec/lib/cxx/Makefile
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
all: build
|
||||
|
||||
build:
|
||||
@echo "cxx bindings & validation"
|
||||
|
||||
clean:
|
||||
@echo "clean cxx"
|
||||
|
||||
.PHONY: clean
|
4
vendor/github.com/container-storage-interface/spec/lib/go/.gitignore
generated
vendored
Normal file
4
vendor/github.com/container-storage-interface/spec/lib/go/.gitignore
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
/protoc
|
||||
/protoc-gen-go
|
||||
/csi.a
|
||||
/csi/.build/
|
119
vendor/github.com/container-storage-interface/spec/lib/go/Makefile
generated
vendored
Normal file
119
vendor/github.com/container-storage-interface/spec/lib/go/Makefile
generated
vendored
Normal file
@ -0,0 +1,119 @@
|
||||
all: build
|
||||
|
||||
########################################################################
|
||||
## GOLANG ##
|
||||
########################################################################
|
||||
|
||||
# If GOPATH isn't defined then set its default location.
|
||||
ifeq (,$(strip $(GOPATH)))
|
||||
GOPATH := $(HOME)/go
|
||||
else
|
||||
# If GOPATH is already set then update GOPATH to be its own
|
||||
# first element.
|
||||
GOPATH := $(word 1,$(subst :, ,$(GOPATH)))
|
||||
endif
|
||||
export GOPATH
|
||||
|
||||
|
||||
########################################################################
|
||||
## PROTOC ##
|
||||
########################################################################
|
||||
|
||||
# Only set PROTOC_VER if it has an empty value.
|
||||
ifeq (,$(strip $(PROTOC_VER)))
|
||||
PROTOC_VER := 3.3.0
|
||||
endif
|
||||
|
||||
PROTOC_OS := $(shell uname -s)
|
||||
ifeq (Darwin,$(PROTOC_OS))
|
||||
PROTOC_OS := osx
|
||||
endif
|
||||
|
||||
PROTOC_ARCH := $(shell uname -m)
|
||||
ifeq (i386,$(PROTOC_ARCH))
|
||||
PROTOC_ARCH := x86_32
|
||||
endif
|
||||
|
||||
PROTOC := ./protoc
|
||||
PROTOC_ZIP := protoc-$(PROTOC_VER)-$(PROTOC_OS)-$(PROTOC_ARCH).zip
|
||||
PROTOC_URL := https://github.com/google/protobuf/releases/download/v$(PROTOC_VER)/$(PROTOC_ZIP)
|
||||
PROTOC_TMP_DIR := .protoc
|
||||
PROTOC_TMP_BIN := $(PROTOC_TMP_DIR)/bin/protoc
|
||||
|
||||
$(PROTOC):
|
||||
-mkdir -p "$(PROTOC_TMP_DIR)" && \
|
||||
curl -L $(PROTOC_URL) -o "$(PROTOC_TMP_DIR)/$(PROTOC_ZIP)" && \
|
||||
unzip "$(PROTOC_TMP_DIR)/$(PROTOC_ZIP)" -d "$(PROTOC_TMP_DIR)" && \
|
||||
chmod 0755 "$(PROTOC_TMP_BIN)" && \
|
||||
cp -f "$(PROTOC_TMP_BIN)" "$@"
|
||||
-rm -fr "$(PROTOC_TMP_DIR)"
|
||||
stat "$@" > /dev/null 2>&1
|
||||
|
||||
|
||||
########################################################################
|
||||
## PROTOC-GEN-GO ##
|
||||
########################################################################
|
||||
|
||||
# This is the recipe for getting and installing the go plug-in
|
||||
# for protoc
|
||||
PROTOC_GEN_GO_PKG := github.com/golang/protobuf/protoc-gen-go
|
||||
PROTOC_GEN_GO := protoc-gen-go
|
||||
$(PROTOC_GEN_GO):
|
||||
go get -d $(PROTOC_GEN_GO_PKG) && \
|
||||
go build -o "$@" $(PROTOC_GEN_GO_PKG)
|
||||
|
||||
|
||||
########################################################################
|
||||
## PATH ##
|
||||
########################################################################
|
||||
|
||||
# Update PATH with the current directory. This enables the protoc
|
||||
# binary to discover the protoc-gen-go binary, built inside this
|
||||
# directory.
|
||||
export PATH := $(shell pwd):$(PATH)
|
||||
|
||||
|
||||
########################################################################
|
||||
## BUILD ##
|
||||
########################################################################
|
||||
CSI_GO := csi/csi.pb.go
|
||||
CSI_A := csi.a
|
||||
CSI_PROTO := ../../csi.proto
|
||||
CSI_GO_TMP := csi/.build/csi.pb.go
|
||||
|
||||
# This recipe generates the go language bindings to a temp area.
|
||||
$(CSI_GO_TMP): $(CSI_PROTO) | $(PROTOC) $(PROTOC_GEN_GO)
|
||||
@mkdir -p "$(@D)"
|
||||
$(PROTOC) -I "$(<D)" --go_out=plugins=grpc:"$(@D)" "$<"
|
||||
|
||||
# The temp language bindings are compared to the ones that are
|
||||
# versioned. If they are different then it means the language
|
||||
# bindings were not updated prior to being committed.
|
||||
$(CSI_GO): $(CSI_GO_TMP)
|
||||
ifeq (true,$(TRAVIS))
|
||||
diff "$@" "$?"
|
||||
else
|
||||
@mkdir -p "$(@D)"
|
||||
diff "$@" "$?" > /dev/null 2>&1 || cp -f "$?" "$@"
|
||||
endif
|
||||
|
||||
# This recipe builds the Go archive from the sources in three steps:
|
||||
#
|
||||
# 1. Go get any missing dependencies.
|
||||
# 2. Cache the packages.
|
||||
# 3. Build the archive file.
|
||||
$(CSI_A): $(CSI_GO)
|
||||
go get -d ./...
|
||||
go install ./csi
|
||||
go build -o "$@" ./csi
|
||||
|
||||
build: $(CSI_A)
|
||||
|
||||
clean:
|
||||
go clean -i ./...
|
||||
rm -f "$(CSI_A)"
|
||||
|
||||
clobber: clean
|
||||
rm -fr "$(PROTOC)" "$(PROTOC_GEN_GO)" "$(dir $(CSI_GO))"
|
||||
|
||||
.PHONY: clean clobber
|
21
vendor/github.com/container-storage-interface/spec/lib/go/README.md
generated
vendored
Normal file
21
vendor/github.com/container-storage-interface/spec/lib/go/README.md
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
# CSI Go Validation
|
||||
|
||||
This package is used to validate the CSI specification with Go language bindings.
|
||||
|
||||
## Build Reference
|
||||
|
||||
To validate the Go language bindings against the current specification use the following command:
|
||||
|
||||
```bash
|
||||
$ make
|
||||
```
|
||||
|
||||
The above command will download the `protoc` and `protoc-gen-go` binaries if they are not present and then proceed to build the CSI Go language bindings.
|
||||
|
||||
### Environment Variables
|
||||
|
||||
The following table lists the environment variables that can be used to influence the behavior of the Makefile:
|
||||
|
||||
| Name | Default Value | Description |
|
||||
|------|---------------|-------------|
|
||||
| `PROTOC_VER` | `3.3.0` | The version of the protoc binary. |
|
5
vendor/github.com/container-storage-interface/spec/lib/go/csi.go
generated
vendored
Normal file
5
vendor/github.com/container-storage-interface/spec/lib/go/csi.go
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
// Package csi is the Container Storage Interface (CSI) specification
|
||||
// repository. This package contains no functional code, and this file
|
||||
// exists only to make it possible to import this repository with a Go
|
||||
// dependency manager such as Dep (https://github.com/golang/dep).
|
||||
package csi
|
2529
vendor/github.com/container-storage-interface/spec/lib/go/csi/csi.pb.go
generated
vendored
Normal file
2529
vendor/github.com/container-storage-interface/spec/lib/go/csi/csi.pb.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
vendor/github.com/container-storage-interface/spec/logo.png
generated
vendored
Executable file
BIN
vendor/github.com/container-storage-interface/spec/logo.png
generated
vendored
Executable file
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
1388
vendor/github.com/container-storage-interface/spec/spec.md
generated
vendored
Normal file
1388
vendor/github.com/container-storage-interface/spec/spec.md
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user