mirror of
https://github.com/coredns/coredns.git
synced 2025-10-31 18:23:13 -04:00
Update k8s client-go to v6.0.0 (#1340)
* Update k8s client-go to v6.0.0 This fix updates k8s client-go to v6.0.0 as CoreDNS is supported in 1.9 and v6.0.0 is the recommended version. There are quite some massive changes that need to be made: 1. k8s.io/client-go/pkg/api/v1 has been changed to k8s.io/api/v1 (repo changed from `client-go` to `api`) 2. kubernetes.Clientset adds one extra layer, so that `kubernetes.Clientset.Services()` and like has been changed to `kubernetes.Clientset.CoreV1().Services()` Also, we have to stick with specific commits of `k8s.io/apimachinery` and the newly introduced `k8s.io/api` because go dep still could not figure out the right version to fetch. Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Update vendor with `dep ensure --update` and `dep prune` Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
25
vendor/github.com/go-openapi/spec/expander.go
generated
vendored
25
vendor/github.com/go-openapi/spec/expander.go
generated
vendored
@@ -91,7 +91,7 @@ func ResolveRefWithBase(root interface{}, ref *Ref, opts *ExpandOptions) (*Schem
|
||||
return nil, err
|
||||
}
|
||||
specBasePath := ""
|
||||
if opts != nil {
|
||||
if opts != nil && opts.RelativeBase != "" {
|
||||
specBasePath, _ = absPath(opts.RelativeBase)
|
||||
}
|
||||
|
||||
@@ -466,7 +466,7 @@ func ExpandSpec(spec *Swagger, options *ExpandOptions) error {
|
||||
|
||||
// getting the base path of the spec to adjust all subsequent reference resolutions
|
||||
specBasePath := ""
|
||||
if options != nil {
|
||||
if options != nil && options.RelativeBase != "" {
|
||||
specBasePath, _ = absPath(options.RelativeBase)
|
||||
}
|
||||
|
||||
@@ -535,6 +535,7 @@ func ExpandSchema(schema *Schema, root interface{}, cache ResolutionCache) error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer os.Remove(file.Name())
|
||||
|
||||
switch r := root.(type) {
|
||||
case *Schema:
|
||||
@@ -561,8 +562,12 @@ func ExpandSchemaWithBasePath(schema *Schema, cache ResolutionCache, opts *Expan
|
||||
}
|
||||
|
||||
if opts == nil {
|
||||
return errors.New("cannot expand schema without a basPath")
|
||||
return errors.New("cannot expand schema without a base path")
|
||||
}
|
||||
if opts.RelativeBase == "" {
|
||||
return errors.New("cannot expand schema with empty base path")
|
||||
}
|
||||
|
||||
basePath, _ := absPath(opts.RelativeBase)
|
||||
|
||||
resolver, err := defaultSchemaLoader(nil, opts, cache)
|
||||
@@ -647,14 +652,16 @@ func expandSchema(target Schema, parentRefs []string, resolver *schemaLoader, ba
|
||||
/* Ref also changes the resolution scope of children expandSchema */
|
||||
if target.Ref.String() != "" {
|
||||
/* Here the resolution scope is changed because a $ref was encountered */
|
||||
newRef := normalizeFileRef(&target.Ref, basePath)
|
||||
newBasePath := newRef.RemoteURI()
|
||||
normalizedRef := normalizeFileRef(&target.Ref, basePath)
|
||||
normalizedBasePath := normalizedRef.RemoteURI()
|
||||
|
||||
/* this means there is a circle in the recursion tree */
|
||||
/* return the Ref */
|
||||
if swag.ContainsStringsCI(parentRefs, newRef.String()) {
|
||||
target.Ref = *newRef
|
||||
if basePath != "" && swag.ContainsStringsCI(parentRefs, normalizedRef.String()) {
|
||||
target.Ref = *normalizedRef
|
||||
return &target, nil
|
||||
}
|
||||
|
||||
debugLog("\nbasePath: %s", basePath)
|
||||
b, _ := json.Marshal(target)
|
||||
debugLog("calling Resolve with target: %s", string(b))
|
||||
@@ -663,8 +670,8 @@ func expandSchema(target Schema, parentRefs []string, resolver *schemaLoader, ba
|
||||
}
|
||||
|
||||
if t != nil {
|
||||
parentRefs = append(parentRefs, newRef.String())
|
||||
return expandSchema(*t, parentRefs, resolver, newBasePath)
|
||||
parentRefs = append(parentRefs, normalizedRef.String())
|
||||
return expandSchema(*t, parentRefs, resolver, normalizedBasePath)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user