Skip to content

Commit

Permalink
add replace for invalid doc link
Browse files Browse the repository at this point in the history
  • Loading branch information
estroz committed Nov 18, 2019
1 parent c467813 commit 77153b8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
7 changes: 3 additions & 4 deletions hack/generate/gen-test-framework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ set -ex

source hack/lib/test_lib.sh

# Define vars
DOCKERFILE="build/Dockerfile"

# Go inside of the mock data test project
cd test/test-framework

Expand All @@ -20,4 +17,6 @@ cd test/test-framework

# TODO(camilamacedo86): remove this when the openapi gen be set to false and it no longer is generated
# The following file is gen by openapi but it has not been committed in order to allow we clone and call the test locally in any path.
trap_add 'rm pkg/apis/cache/v1alpha1/zz_generated.openapi.go' EXIT
rm pkg/apis/cache/v1alpha1/zz_generated.openapi.go

go mod tidy
10 changes: 10 additions & 0 deletions internal/scaffold/crd.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package scaffold

import (
"bytes"
"fmt"
"io"
"os"
Expand Down Expand Up @@ -112,6 +113,15 @@ func (s *CRD) CustomRender() ([]byte, error) {
}
return nil, err
}
// Until we bump dependencies to Kubernetes v1.16, generated validation
// descriptions for kind and apiVersion will contain an invalid link.
// Manually replace them here.
//
// TODO(estroz): remove on k8s v1.16 bump.
b = bytes.ReplaceAll(b,
[]byte("https://git.k8s.io/community/contributors/devel/api-conventions.md"),
[]byte("https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md"),
)
if err = yaml.Unmarshal(b, crd); err != nil {
return nil, err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ spec:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ spec:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
Expand Down

0 comments on commit 77153b8

Please sign in to comment.