Context: google/gnostic#195
gnostic upgrade from yaml.v2 to yaml.v3 breaks some clients
Can we use apiserver with the latest github.com/googleapis/gnostic (0.5.0 or later)?
There is an incompatibility between yaml v2 used by apiserver and yaml v3 used by gnostic since version 0.5.0
Without this fix, it is impossible to import this library and controller-runtime v0.8.3
error log:
# k8s.io/apiserver/pkg/util/openapi
../../../pkg/mod/k8s.io/apiserver@v0.20.2/pkg/util/openapi/proto.go:43:36: cannot use info (type "gopkg.in/yaml.v2".MapSlice) as type *"gopkg.in/yaml.v3".Node in argument to openapi_v2.NewDocument
To fix this, as suggested in google/gnostic#195, we could replace this line with the ParseDocument functions defined in openapiv2/document.go and openapiv3/document.go. That would make the calling code look like this:
document, err := openapi_v2.ParseDocument(b)
where b is a []byte of the JSON or YAML file to be parsed.
Context: google/gnostic#195 gnostic upgrade from yaml.v2 to yaml.v3 breaks some clients
Can we use apiserver with the latest github.com/googleapis/gnostic (0.5.0 or later)? There is an incompatibility between yaml v2 used by apiserver and yaml v3 used by gnostic since version 0.5.0
Without this fix, it is impossible to import this library and controller-runtime v0.8.3 error log:
To fix this, as suggested in google/gnostic#195, we could replace this line with the ParseDocument functions defined in openapiv2/document.go and openapiv3/document.go. That would make the calling code look like this:
where b is a []byte of the JSON or YAML file to be parsed.