feat(zfspv) Add golint check to travis (#175)

Signed-off-by: vaniisgh <vanisingh@live.co.uk>
This commit is contained in:
vaniisgh 2020-07-07 18:21:02 +05:30 committed by GitHub
parent 8b7ad5cb45
commit 8bbf3d7d2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 321 additions and 266 deletions

View file

@ -13,6 +13,7 @@ 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.
*/
package usage
const (
@ -34,12 +35,14 @@ const (
// RunningStatus status is running
RunningStatus string = "running"
// Event labels
EventLabelNode string = "nodes"
// EventLabelNode holds the string label "nodes"
EventLabelNode string = "nodes"
// EventLabelCapacity holds the string label "capacity"
EventLabelCapacity string = "capacity"
// Replica Event replication
Replica string = "replica:"
Replica string = "replica:"
// DefaultReplicaCount holds the replica count string
DefaultReplicaCount string = "replica:1"
// DefaultCASType Event application name constant for volume event

View file

@ -33,9 +33,9 @@ var (
installerType = "OPENEBS_IO_INSTALLER_TYPE"
)
// versionSet is a struct which stores (sort of) fixed information about a
// VersionSet is a struct which stores (sort of) fixed information about a
// k8s environment
type versionSet struct {
type VersionSet struct {
id string // OPENEBS_IO_USAGE_UUID
k8sVersion string // OPENEBS_IO_K8S_VERSION
k8sArch string // OPENEBS_IO_K8S_ARCH
@ -45,13 +45,13 @@ type versionSet struct {
}
// NewVersion returns a new versionSet struct
func NewVersion() *versionSet {
return &versionSet{}
func NewVersion() *VersionSet {
return &VersionSet{}
}
// fetchAndSetVersion consumes the Kubernetes API to get environment constants
// and returns a versionSet struct
func (v *versionSet) fetchAndSetVersion() error {
func (v *VersionSet) fetchAndSetVersion() error {
var err error
v.id, err = getUUIDbyNS("default")
if err != nil {
@ -79,7 +79,7 @@ func (v *versionSet) fetchAndSetVersion() error {
}
// getVersion is a wrapper over fetchAndSetVersion
func (v *versionSet) getVersion(override bool) error {
func (v *VersionSet) getVersion(override bool) error {
// If ENVs aren't set or the override is true, fetch the required
// values from the K8s APIserver
if _, present := env.Lookup(openEBSversion); !present || override {