Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from containerum/develop
Develop
- Loading branch information
Showing
128 changed files
with
3,888 additions
and
930 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
package kubeErrors | ||
package kubeerrors | ||
|
||
//go:generate noice -t Errors.toml -o . |
14 changes: 13 additions & 1 deletion
14
pkg/kubeErrors/kubeErrors.go → pkg/kubeerrors/kubeerrors.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package kubernetes | ||
|
||
import ( | ||
log "github.com/sirupsen/logrus" | ||
api_storage "k8s.io/api/storage/v1" | ||
api_meta "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
func (k *Kube) GetStorageClassesList() (*api_storage.StorageClassList, error) { | ||
storages, err := k.StorageV1().StorageClasses().List(api_meta.ListOptions{}) | ||
if err != nil { | ||
log.Error(err) | ||
return nil, err | ||
} | ||
return storages, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package model | ||
|
||
import ( | ||
api_storage "k8s.io/api/storage/v1" | ||
) | ||
|
||
// StorageList -- model for storage names list | ||
// | ||
// swagger:model | ||
type StorageList []string | ||
|
||
// ParseStoragesList parses kubernetes v1.StorageClassList to more convenient StorageList struct. | ||
func ParseStoragesList(storages interface{}) (*StorageList, error) { | ||
nativeStorages := storages.(*api_storage.StorageClassList) | ||
if nativeStorages == nil { | ||
return nil, ErrUnableConvertStorageList | ||
} | ||
|
||
storageList := make(StorageList, len(nativeStorages.Items)) | ||
for i := range nativeStorages.Items { | ||
storageList[i] = nativeStorages.Items[i].Name | ||
} | ||
return &storageList, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.