Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <tamal@appscode.com>
  • Loading branch information
tamalsaha committed Oct 6, 2019
1 parent 78b79df commit 8628953
Show file tree
Hide file tree
Showing 11 changed files with 263 additions and 39 deletions.
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.12

require (
github.com/appscode/docker-registry-client v0.0.0-20180426150142-1bb02bb202b0
github.com/appscode/go v0.0.0-20190808133642-1d4ef1f1c1e0
github.com/appscode/go v0.0.0-20191006073906-e3d193d493fc
github.com/go-openapi/spec v0.19.0
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/gorilla/mux v1.7.3 // indirect
Expand All @@ -19,10 +19,10 @@ require (
k8s.io/client-go v11.0.0+incompatible
k8s.io/kube-openapi v0.0.0-20190502190224-411b2483e503
kmodules.xyz/client-go v0.0.0-20190808141354-bbb9e14f60ab
kmodules.xyz/custom-resources v0.0.0-20190808144301-114abf10dfe2
kmodules.xyz/custom-resources v0.0.0-20190927035424-65fe358bb045
kmodules.xyz/monitoring-agent-api v0.0.0-20190808150221-601a4005b7f7
kmodules.xyz/objectstore-api v0.0.0-20190808153322-733e8798e8de
kmodules.xyz/offshoot-api v0.0.0-20190808152534-e3dc715f844b
kmodules.xyz/objectstore-api v0.0.0-20191006080053-fc8b57fadcf0
kmodules.xyz/offshoot-api v0.0.0-20190901210649-de049192326c
kmodules.xyz/webhook-runtime v0.0.0-20190808145328-4186c470d56b
stash.appscode.dev/stash v0.9.0-rc.0
)
Expand Down
15 changes: 10 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ github.com/ant31/crd-validation v0.0.0-20180702145049-30f8a35d0ac2/go.mod h1:X0n
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
github.com/appscode/docker-registry-client v0.0.0-20180426150142-1bb02bb202b0 h1:AQhNemZFEetjnmg8cmNd0Cgcun6/aJTwjY/9UM6ZBhw=
github.com/appscode/docker-registry-client v0.0.0-20180426150142-1bb02bb202b0/go.mod h1:W9bsWfSbgJXUXzBZ+tSBV2g+zzT7ANPHQFsSXRHYKsA=
github.com/appscode/go v0.0.0-20190808133642-1d4ef1f1c1e0 h1:EZp2qE4LUJUG0wMHyUxOg982hVbOFh7qqcM1XIMVGpk=
github.com/appscode/go v0.0.0-20190808133642-1d4ef1f1c1e0/go.mod h1:iy07dV61Z7QQdCKJCIvUoDL21u6AIceRhZzyleh2ymc=
github.com/appscode/go v0.0.0-20191006073906-e3d193d493fc h1:QM15z3kImGt30V6nfAdI2UM4lrJ1Gp+5NBXZMag9iqo=
github.com/appscode/go v0.0.0-20191006073906-e3d193d493fc/go.mod h1:hUW7Fq0KY2/ntGnYAzemyUpIhLL6bXrTljN6SRY/+Lc=
github.com/appscode/osm v0.12.0 h1:7Rde+KnOp3EvHscXHS6rfdqiq6IO/2HZ2pKeE4f/sRo=
github.com/appscode/osm v0.12.0/go.mod h1:+ZXU2HilSSow2o0gsOolJfOTkhqQ2FcGROOum4wEh4w=
github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
Expand Down Expand Up @@ -515,8 +516,9 @@ gomodules.xyz/jsonpatch/v2 v2.0.0 h1:OyHbl+7IOECpPKfVK42oFr6N7+Y2dR+Jsb/IiDV3hOo
gomodules.xyz/jsonpatch/v2 v2.0.0/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU=
gomodules.xyz/stow v0.2.0 h1:GYymuy7sxAifaL0IXEmoHApeguXHK0hFT7ZQiYA8KTU=
gomodules.xyz/stow v0.2.0/go.mod h1:YDDPM4nmJgQhxq4I5aGtLM/xrvJzDSVM/fbc7NGizpY=
gomodules.xyz/version v0.0.0-20190507203204-7cec7ee542d3 h1:MiBtMikyjuBwD22+QIEsbnMHdRkknM/0N5ig34jSNgQ=
gomodules.xyz/version v0.0.0-20190507203204-7cec7ee542d3/go.mod h1:Y8xuV02mL/45psyPKG3NCVOwvAOy6T5Kx0l3rCjKSjU=
gomodules.xyz/version v0.1.0 h1:inGItCg/egI0jPMeIE0SQkiDIJaodOMoCrxYqasQLR0=
gomodules.xyz/version v0.1.0/go.mod h1:Y8xuV02mL/45psyPKG3NCVOwvAOy6T5Kx0l3rCjKSjU=
google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/api v0.0.0-20181220000619-583d854617af/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y=
Expand Down Expand Up @@ -591,14 +593,17 @@ k8s.io/utils v0.0.0-20190221042446-c2654d5206da h1:ElyM7RPonbKnQqOcw7dG2IK5uvQQn
k8s.io/utils v0.0.0-20190221042446-c2654d5206da/go.mod h1:8k8uAuAQ0rXslZKaEWd0c3oVhZz7sSzSiPnVZayjIX0=
kmodules.xyz/client-go v0.0.0-20190808141354-bbb9e14f60ab h1:rnKcFaDLtqpdooase2BqPfHV9Mu1WvzbTUmucnJjLio=
kmodules.xyz/client-go v0.0.0-20190808141354-bbb9e14f60ab/go.mod h1:1GI6h5D31op/2D+Hrn9DhXW6iUd5wsHBQRoLeY7fndM=
kmodules.xyz/custom-resources v0.0.0-20190808144301-114abf10dfe2 h1:u0zEFCvAttk09O64UzY1DVXNke9uAANmf4vllnVquS8=
kmodules.xyz/custom-resources v0.0.0-20190808144301-114abf10dfe2/go.mod h1:vlKyFcCXC+2Kfn3Fa5Z7RnBWyp4t46FSeEutNqpqMm8=
kmodules.xyz/custom-resources v0.0.0-20190927035424-65fe358bb045 h1:DuvD64ouPDbv3egAUUCy5rBqs/vc218DeVVivcqfa+U=
kmodules.xyz/custom-resources v0.0.0-20190927035424-65fe358bb045/go.mod h1:vlKyFcCXC+2Kfn3Fa5Z7RnBWyp4t46FSeEutNqpqMm8=
kmodules.xyz/monitoring-agent-api v0.0.0-20190808150221-601a4005b7f7 h1:2NexswbEqyeI1bL0O7WZ3ZcQgXJ+kATJK++roRXfYDU=
kmodules.xyz/monitoring-agent-api v0.0.0-20190808150221-601a4005b7f7/go.mod h1:9v6LM+dmaAP3jjDiPOPOLPfsvD7jNjBJsi37JNCiFho=
kmodules.xyz/objectstore-api v0.0.0-20190808153322-733e8798e8de h1:Z/z3SSS+mvRGzLT5HXLazogjnOYIfbYTYWrKBsiLtp8=
kmodules.xyz/objectstore-api v0.0.0-20190808153322-733e8798e8de/go.mod h1:Wx+Ffc7weI6zv7NQvq0GWXMGGQFn6LqVb0KcXQFwRFs=
kmodules.xyz/offshoot-api v0.0.0-20190808152534-e3dc715f844b h1:VZUtg4L9Qm2C7PBwa4sp/SvHckKidZSpkA33GoB24SA=
kmodules.xyz/objectstore-api v0.0.0-20191006080053-fc8b57fadcf0 h1:DaHMvYoSHHVexAc+7NhyUE/H22xiI2PCMmDRUqpkV1o=
kmodules.xyz/objectstore-api v0.0.0-20191006080053-fc8b57fadcf0/go.mod h1:mT7lEi2IehAi64DomCPMPtlsWXOD5Fr3/mPqLIzU7T8=
kmodules.xyz/offshoot-api v0.0.0-20190808152534-e3dc715f844b/go.mod h1:AzvHBjJvhFwUEiWrEKfdsgoqt5Ulio44Beo1vPoq7ww=
kmodules.xyz/offshoot-api v0.0.0-20190901210649-de049192326c h1:y54FqF02HNs2d4eJh6w+7Q2sfVLORzvZd/ueGm/t7Fg=
kmodules.xyz/offshoot-api v0.0.0-20190901210649-de049192326c/go.mod h1:AzvHBjJvhFwUEiWrEKfdsgoqt5Ulio44Beo1vPoq7ww=
kmodules.xyz/openshift v0.0.0-20190808144841-c8f9a927f1d1/go.mod h1:+E8HHcxBx6ja4oKOXZ6DCoQ+NjujODTgFOfgOe+ejXw=
kmodules.xyz/webhook-runtime v0.0.0-20190808145328-4186c470d56b h1:yd/uzBgLgsir3X4kGoznJY7CdrkgfznsNKvD4p2xUaQ=
kmodules.xyz/webhook-runtime v0.0.0-20190808145328-4186c470d56b/go.mod h1:X8J6YJvk3NqufXEDqcl2oFuL8T6+mV+AN30/miV4iJU=
Expand Down
20 changes: 20 additions & 0 deletions vendor/github.com/appscode/go/os/lib.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions vendor/gomodules.xyz/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,3 +392,27 @@ func (v *Version) Clone() *Version {
func (v *Version) ToMutator() *Mutator {
return &Mutator{Version: v}
}

// Major returns major version number of this Version object
func (v *Version) Major() int64 {
if len(v.segments) >= 1 {
return v.segments[0]
}
return 0
}

// Minor returns minor version number of this Version object
func (v *Version) Minor() int64 {
if len(v.segments) >= 2 {
return v.segments[1]
}
return 0
}

// Patch returns patch version number of this Version object
func (v *Version) Patch() int64 {
if len(v.segments) >= 3 {
return v.segments[2]
}
return 0
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ type ClientConfig struct {
// If the webhook is running within the cluster, then you should use `service`.
//
// +optional
Service *ServiceReference `json:"service"`
Service *ServiceReference `json:"service,omitempty"`

// InsecureSkipTLSVerify disables TLS certificate verification when communicating with this app.
// This is strongly discouraged. You should use the CABundle instead.
Expand Down
204 changes: 181 additions & 23 deletions vendor/kmodules.xyz/objectstore-api/api/v1/helpers.go
Original file line number Diff line number Diff line change
@@ -1,40 +1,64 @@
package v1

import (
"io/ioutil"
"log"
"net/url"

"github.com/appscode/go/os"
"github.com/pkg/errors"
core "k8s.io/api/core/v1"
)

func (s Backend) Container() (string, error) {
if s.S3 != nil {
return s.S3.Bucket, nil
} else if s.GCS != nil {
return s.GCS.Bucket, nil
} else if s.Azure != nil {
return s.Azure.Container, nil
} else if s.Local != nil {
return s.Local.MountPath, nil
} else if s.Swift != nil {
return s.Swift.Container, nil
const (
ProviderLocal = "local"
ProviderS3 = "s3"
ProviderGCS = "gcs"
ProviderAzure = "azure"
ProviderSwift = "swift"
ProviderB2 = "b2"
ProviderRest = "rest"
)

// Container returns name of the bucket
func (backend Backend) Container() (string, error) {
if backend.Local != nil {
return backend.Local.MountPath, nil
} else if backend.S3 != nil {
return backend.S3.Bucket, nil
} else if backend.GCS != nil {
return backend.GCS.Bucket, nil
} else if backend.Azure != nil {
return backend.Azure.Container, nil
} else if backend.Swift != nil {
return backend.Swift.Container, nil
} else if backend.Rest != nil {
u, err := url.Parse(backend.Rest.URL)
if err != nil {
return "", err
}
return u.Host, nil
}
return "", errors.New("no storage provider is configured")
return "", errors.New("failed to get container. Reason: Unknown backend type.")
}

func (s Backend) Location() (string, error) {
if s.S3 != nil {
return "s3:" + s.S3.Bucket, nil
} else if s.GCS != nil {
return "gs:" + s.GCS.Bucket, nil
} else if s.Azure != nil {
return "azure:" + s.Azure.Container, nil
} else if s.Local != nil {
return "local:" + s.Local.MountPath, nil
} else if s.Swift != nil {
return "swift:" + s.Swift.Container, nil
// Location returns the location of backend (<provider>:<bucket name>)
func (backend Backend) Location() (string, error) {
if backend.S3 != nil {
return "s3:" + backend.S3.Bucket, nil
} else if backend.GCS != nil {
return "gs:" + backend.GCS.Bucket, nil
} else if backend.Azure != nil {
return "azure:" + backend.Azure.Container, nil
} else if backend.Local != nil {
return "local:" + backend.Local.MountPath, nil
} else if backend.Swift != nil {
return "swift:" + backend.Swift.Container, nil
}
return "", errors.New("no storage provider is configured")
}

// ToVolumeAndMount returns volumes and mounts for local backend
func (l LocalSpec) ToVolumeAndMount(volName string) (core.Volume, core.VolumeMount) {
vol := core.Volume{
Name: volName,
Expand All @@ -47,3 +71,137 @@ func (l LocalSpec) ToVolumeAndMount(volName string) (core.Volume, core.VolumeMou
}
return vol, mnt
}

// Prefix returns the prefix used in the backend
func (backend Backend) Prefix() (string, error) {
if backend.Local != nil {
return "", nil
} else if backend.S3 != nil {
return backend.S3.Prefix, nil
} else if backend.GCS != nil {
return backend.GCS.Prefix, nil
} else if backend.Azure != nil {
return backend.Azure.Prefix, nil
} else if backend.Swift != nil {
return backend.Swift.Prefix, nil
} else if backend.Rest != nil {
u, err := url.Parse(backend.Rest.URL)
if err != nil {
return "", err
}
return u.Path, nil
}
return "", errors.New("failed to get prefix. Reason: Unknown backend type.")
}

// Provider returns the provider of the backend
func (backend Backend) Provider() (string, error) {
if backend.Local != nil {
return ProviderLocal, nil
} else if backend.S3 != nil {
return ProviderS3, nil
} else if backend.GCS != nil {
return ProviderGCS, nil
} else if backend.Azure != nil {
return ProviderAzure, nil
} else if backend.Swift != nil {
return ProviderSwift, nil
} else if backend.B2 != nil {
return ProviderB2, nil
} else if backend.Rest != nil {
return ProviderRest, nil
}
return "", errors.New("unknown provider.")
}

// MaxConnections returns maximum parallel connection to use to connect with the backend
// returns 0 if not specified
func (backend Backend) MaxConnections() int {
if backend.GCS != nil {
return backend.GCS.MaxConnections
} else if backend.Azure != nil {
return backend.Azure.MaxConnections
} else if backend.B2 != nil {
return backend.B2.MaxConnections
}
return 0
}

// Endpoint returns endpoint of Restic rest server and S3/S3 compatible backend
func (backend Backend) Endpoint() (string, bool) {
if backend.S3 != nil {
return backend.S3.Endpoint, true
} else if backend.Rest != nil {
return backend.Rest.URL, true
}
return "", false
}

const (
GCPSACredentialJson = "sa.json"
)

func GoogleServiceAccountFromEnv() string {
if data := os.Getenv(GOOGLE_SERVICE_ACCOUNT_JSON_KEY); len(data) > 0 {
return data
}
if data, err := ioutil.ReadFile(os.Getenv(GOOGLE_APPLICATION_CREDENTIALS)); err == nil {
return string(data)
}
log.Println("GOOGLE_SERVICE_ACCOUNT_JSON_KEY and GOOGLE_APPLICATION_CREDENTIALS are empty")
return ""
}

func GoogleCredentialsFromEnv() map[string][]byte {
sa := GoogleServiceAccountFromEnv()
if len(sa) == 0 {
return map[string][]byte{}
}
return map[string][]byte{
GCPSACredentialJson: []byte(sa),
}
}

const (
AzureClientSecret = "client-secret"
AzureSubscriptionID = "subscription-id"
AzureTenantID = "tenant-id"
AzureClientID = "client-id"
)

func AzureCredentialsFromEnv() map[string][]byte {
subscriptionID := os.Getenv("AZURE_SUBSCRIPTION_ID")
tenantID := os.Getenv("AZURE_TENANT_ID")
clientID := os.Getenv("AZURE_CLIENT_ID")
clientSecret := os.Getenv("AZURE_CLIENT_SECRET")
if len(subscriptionID) == 0 || len(tenantID) == 0 || len(clientID) == 0 || len(clientSecret) == 0 {
log.Println("Azure credentials for empty")
return map[string][]byte{}
}

return map[string][]byte{
AzureSubscriptionID: []byte(subscriptionID),
AzureTenantID: []byte(tenantID),
AzureClientID: []byte(clientID),
AzureClientSecret: []byte(clientSecret),
}
}

const (
AWSCredentialAccessKeyKey = "access_key"
AWSCredentialSecretKeyKey = "secret_key"
)

func AWSCredentialsFromEnv() map[string][]byte {
awsAccessKeyId := os.Getenv("AWS_ACCESS_KEY_ID")
awsSecretAccessKey := os.Getenv("AWS_SECRET_ACCESS_KEY")
if len(awsAccessKeyId) == 0 || len(awsSecretAccessKey) == 0 {
log.Println("AWS credentials for empty")
return map[string][]byte{}
}

return map[string][]byte{
AWSCredentialAccessKeyKey: []byte(awsAccessKeyId),
AWSCredentialSecretKeyKey: []byte(awsSecretAccessKey),
}
}
1 change: 1 addition & 0 deletions vendor/kmodules.xyz/objectstore-api/api/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const (

GOOGLE_PROJECT_ID = "GOOGLE_PROJECT_ID"
GOOGLE_SERVICE_ACCOUNT_JSON_KEY = "GOOGLE_SERVICE_ACCOUNT_JSON_KEY"
GOOGLE_APPLICATION_CREDENTIALS = "GOOGLE_APPLICATION_CREDENTIALS"

AZURE_ACCOUNT_NAME = "AZURE_ACCOUNT_NAME"
AZURE_ACCOUNT_KEY = "AZURE_ACCOUNT_KEY"
Expand Down
8 changes: 7 additions & 1 deletion vendor/kmodules.xyz/offshoot-api/api/v1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions vendor/kmodules.xyz/offshoot-api/api/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ type ServiceSpec struct {
// and ExternalTrafficPolicy is set to Local.
// +optional
HealthCheckNodePort int32 `json:"healthCheckNodePort,omitempty"`

// sessionAffinityConfig contains the configurations of session affinity.
// +optional
SessionAffinityConfig *core.SessionAffinityConfig `json:"sessionAffinityConfig,omitempty"`
}

// ServicePort contains information on service's port.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8628953

Please sign in to comment.