Skip to content

Commit c0a7fc3

Browse files
authored
*: controller-tools bump to v0.2.2+ to include bugfix for crd generation (#1961)
Along with updating controller-tools, this also reverts to manually setting up the user and /etc/passwd for the ansible ci base images.
1 parent 3a85983 commit c0a7fc3

File tree

7 files changed

+102
-66
lines changed

7 files changed

+102
-66
lines changed

ci/dockerfiles/ansible-e2e-hybrid.Dockerfile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,15 @@ RUN yum clean all && rm -rf /var/cache/yum/* \
3939
# install operator binary
4040
COPY --from=builder /memcached-operator ${OPERATOR}
4141
COPY --from=builder /go/src/github.com/operator-framework/operator-sdk/library/k8s_status.py /usr/share/ansible/openshift/
42-
COPY --from=builder /go/src/github.com/operator-framework/operator-sdk/bin/ao-logs /usr/local/bin/ao-logs
42+
COPY --from=builder /go/src/github.com/operator-framework/operator-sdk/bin/* /usr/local/bin/
4343
COPY --from=builder /ansible/memcached-operator/watches.yaml ${HOME}/watches.yaml
4444
COPY --from=builder /ansible/memcached-operator/roles/ ${HOME}/roles/
4545

46-
# Ensure directory permissions are properly set
47-
RUN mkdir -p ${HOME}/.ansible/tmp \
48-
&& chown -R ${USER_UID}:0 ${HOME} \
49-
&& chmod -R ug+rwx ${HOME}
46+
RUN /usr/local/bin/user_setup
5047

5148
ADD https://github.com/krallin/tini/releases/latest/download/tini /tini
5249
RUN chmod +x /tini
5350

54-
ENTRYPOINT ["/tini", "--", "bash", "-c", "${OPERATOR} run ansible --watches-file=/opt/ansible/watches.yaml $@"]
51+
ENTRYPOINT ["/tini", "--", "/usr/local/bin/entrypoint"]
5552

5653
USER ${USER_UID}

ci/dockerfiles/ansible.Dockerfile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,13 @@ RUN yum clean all && rm -rf /var/cache/yum/* \
3636

3737
COPY --from=builder /go/src/github.com/operator-framework/operator-sdk/build/operator-sdk ${OPERATOR}
3838
COPY --from=builder /go/src/github.com/operator-framework/operator-sdk/library/k8s_status.py /usr/share/ansible/openshift/
39-
COPY --from=builder /go/src/github.com/operator-framework/operator-sdk/bin/ao-logs /usr/local/bin/ao-logs
39+
COPY --from=builder /go/src/github.com/operator-framework/operator-sdk/bin/* /usr/local/bin/
4040

41-
# Ensure directory permissions are properly set
42-
RUN mkdir -p ${HOME}/.ansible/tmp \
43-
&& chown -R ${USER_UID}:0 ${HOME} \
44-
&& chmod -R ug+rwx ${HOME}
41+
RUN /usr/local/bin/user_setup
4542

4643
ADD https://github.com/krallin/tini/releases/latest/download/tini /tini
4744
RUN chmod +x /tini
4845

49-
ENTRYPOINT ["/tini", "--", "bash", "-c", "${OPERATOR} run ansible --watches-file=/opt/ansible/watches.yaml $@"]
46+
ENTRYPOINT ["/tini", "--", "/usr/local/bin/entrypoint"]
5047

5148
USER ${USER_UID}

go.mod

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ require (
7878
gopkg.in/gorp.v1 v1.7.2 // indirect
7979
gopkg.in/square/go-jose.v2 v2.3.0 // indirect
8080
gopkg.in/yaml.v2 v2.2.2
81-
k8s.io/api v0.0.0-20190612125737-db0771252981
82-
k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8
83-
k8s.io/apimachinery v0.0.0-20190612125636-6a5db36e93ad
81+
k8s.io/api v0.0.0-20190918155943-95b840bb6a1f
82+
k8s.io/apiextensions-apiserver v0.0.0-20190918161926-8f644eb6e783
83+
k8s.io/apimachinery v0.0.0-20190913080033-27d36303b655
8484
k8s.io/cli-runtime v0.0.0-20181213153952-835b10687cb6
8585
k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible
8686
k8s.io/cloud-provider v0.0.0-00010101000000-000000000000 // indirect
@@ -113,3 +113,7 @@ replace (
113113
)
114114

115115
replace github.com/operator-framework/operator-lifecycle-manager => github.com/operator-framework/operator-lifecycle-manager v0.0.0-20190605231540-b8a4faf68e36
116+
117+
// Remove when controller-tools v0.2.2 is released
118+
// Required for the bugfix https://github.com/kubernetes-sigs/controller-tools/pull/322
119+
replace sigs.k8s.io/controller-tools => sigs.k8s.io/controller-tools v0.2.2-0.20190919011008-6ed4ff330711

go.sum

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,8 @@ github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
178178
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
179179
github.com/gogo/protobuf v0.0.0-20170330071051-c0656edd0d9e/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
180180
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
181+
github.com/gogo/protobuf v1.2.0 h1:xU6/SpYbvkNYiptHJYEDRseDLvYE7wSqhYYNy0QSUzI=
181182
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
182-
github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE=
183-
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
184183
github.com/golang/glog v0.0.0-20141105023935-44145f04b68c/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
185184
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
186185
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
@@ -275,7 +274,6 @@ github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV
275274
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
276275
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
277276
github.com/karrick/godirwalk v1.10.12/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA=
278-
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
279277
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
280278
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
281279
github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s=
@@ -504,9 +502,8 @@ golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73r
504502
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
505503
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
506504
golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
505+
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ=
507506
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
508-
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09 h1:KaQtG+aDELoNmXYas3TVkGNYRuq8JQ1aa7LJt8EXVyo=
509-
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
510507
golang.org/x/oauth2 v0.0.0-20170412232759-a6bd8cefa181/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
511508
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
512509
golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
@@ -539,21 +536,18 @@ golang.org/x/sys v0.0.0-20190318195719-6c81ef8f67ca/go.mod h1:h1NjWce9XRLGQEsW7w
539536
golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
540537
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
541538
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
542-
golang.org/x/sys v0.0.0-20190429190828-d89cdac9e872/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
543539
golang.org/x/sys v0.0.0-20190515120540-06a5c4944438 h1:khxRGsvPk4n2y8I/mLLjp7e5dMTJmH75wvqS6nMwUtY=
544540
golang.org/x/sys v0.0.0-20190515120540-06a5c4944438/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
545541
golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
546542
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
547543
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
544+
golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db h1:6/JqlYfC1CCaLnGceQTI+sDGhC9UBSPAsBqI0Gun6kU=
548545
golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
549-
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
550-
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
551546
golang.org/x/time v0.0.0-20161028155119-f51c12702a4d/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
552547
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
553548
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
554549
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ=
555550
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
556-
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
557551
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
558552
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
559553
golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@@ -564,7 +558,7 @@ golang.org/x/tools v0.0.0-20190221204921-83362c3779f5/go.mod h1:9Yl7xja0Znq3iFh3
564558
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
565559
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
566560
golang.org/x/tools v0.0.0-20190320215829-36c10c0a621f/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
567-
golang.org/x/tools v0.0.0-20190501045030-23463209683d/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
561+
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
568562
golang.org/x/tools v0.0.0-20190624180213-70d37148ca0c h1:KfpJVdWhuRqNk4XVXzjXf2KAV4TBEP77SYdFGjeGuIE=
569563
golang.org/x/tools v0.0.0-20190624180213-70d37148ca0c/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
570564
gomodules.xyz/jsonpatch/v2 v2.0.1 h1:xyiBuvkD2g5n7cYzx6u2sxQvsAy4QJsZFCzGVdzOXZ0=
@@ -618,6 +612,7 @@ gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bl
618612
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
619613
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
620614
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
615+
gopkg.in/yaml.v3 v3.0.0-20190905181640-827449938966/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
621616
gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=
622617
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
623618
grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o=
@@ -665,8 +660,8 @@ k8s.io/utils v0.0.0-20190506122338-8fab8cb257d5/go.mod h1:sZAwmy6armz5eXlNoLmJcl
665660
sigs.k8s.io/controller-runtime v0.1.10/go.mod h1:HFAYoOh6XMV+jKF1UjFwrknPbowfyHEHHRdJMf2jMX8=
666661
sigs.k8s.io/controller-runtime v0.2.0 h1:5gL30PXOisGZl+Osi4CmLhvMUj77BO3wJeouKF2va50=
667662
sigs.k8s.io/controller-runtime v0.2.0/go.mod h1:ZHqrRDZi3f6BzONcvlUxkqCKgwasGk5FZrnSv9TVZF4=
668-
sigs.k8s.io/controller-tools v0.2.0 h1:AmQ/0JKBJAjyAiPAkrAf9QW06jkx2lc5hpxMjamsFpw=
669-
sigs.k8s.io/controller-tools v0.2.0/go.mod h1:8t/X+FVWvk6TaBcsa+UKUBbn7GMtvyBKX30SGl4em6Y=
663+
sigs.k8s.io/controller-tools v0.2.2-0.20190919011008-6ed4ff330711 h1:7XTIepp4OPWIHbSl8hFCR/YhYgk2TEs/an/8j4gYpmQ=
664+
sigs.k8s.io/controller-tools v0.2.2-0.20190919011008-6ed4ff330711/go.mod h1:8SNGuj163x/sMwydREj7ld5mIMJu1cDanIfnx6xsU70=
670665
sigs.k8s.io/kustomize v2.0.3+incompatible h1:JUufWFNlI44MdtnjUqVnvh29rR37PQFzPbLXqhyOyX0=
671666
sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU=
672667
sigs.k8s.io/structured-merge-diff v0.0.0-20190426204423-ea680f03cc65/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI=

hack/tests/scaffolding/scaffold-memcached.go

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,12 @@ import (
2626
"strings"
2727

2828
"github.com/operator-framework/operator-sdk/internal/util/fileutil"
29-
"github.com/pkg/errors"
29+
"github.com/operator-framework/operator-sdk/internal/util/k8sutil"
3030

31+
"github.com/ghodss/yaml"
32+
"github.com/pkg/errors"
3133
log "github.com/sirupsen/logrus"
34+
apiextv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
3235
)
3336

3437
// TODO: Migrate most/all of the cli commands to the bash script instead of keeping them here
@@ -168,6 +171,15 @@ func main() {
168171
log.Fatalf("Error: %v\nCommand Output: %s\n", err, string(cmdOut))
169172
}
170173

174+
log.Print("Generating openapi")
175+
cmdOut, err = exec.Command("operator-sdk", "generate", "openapi").CombinedOutput()
176+
if err != nil {
177+
log.Fatalf("Error: %v\nCommand Output: %s\n", err, string(cmdOut))
178+
}
179+
180+
// TODO(haseeb): Remove this when this test no longer runs on a k8s v1.11 cluster in CI
181+
removeTypeFromCRDValidation()
182+
171183
log.Print("Pulling new dependencies with go mod")
172184
cmdOut, err = exec.Command("go", "build", "./...").CombinedOutput()
173185
if err != nil {
@@ -191,6 +203,36 @@ func main() {
191203
}
192204
}
193205

206+
// TODO(haseeb): Remove this when this test no longer runs on a k8s v1.11 cluster in CI
207+
// removeTypeFromCRDValidation will edit the memcached CRD manifest to remove
208+
// the "type: object" field from root of the CRD validation block.
209+
// This serves as a workaround for the following bug on a k8s 1.11 cluster:
210+
// https://github.com/kubernetes/kubernetes/issues/65293
211+
func removeTypeFromCRDValidation() {
212+
crdPath := "deploy/crds/cache.example.com_memcacheds_crd.yaml"
213+
b, err := ioutil.ReadFile(crdPath)
214+
if err != nil {
215+
log.Fatalf("Failed to read CRD manifest %s: %v", crdPath, err)
216+
}
217+
218+
crd := &apiextv1beta1.CustomResourceDefinition{}
219+
if err = yaml.Unmarshal(b, crd); err != nil {
220+
log.Fatalf("Failed to unmarshal CRD: %v", err)
221+
}
222+
223+
crd.Spec.Validation.OpenAPIV3Schema.Type = ""
224+
225+
crdYaml, err := k8sutil.GetObjectBytes(crd, yaml.Marshal)
226+
if err != nil {
227+
log.Fatalf("Failed to marshal CRD: %v", err)
228+
}
229+
230+
err = ioutil.WriteFile(crdPath, crdYaml, fileutil.DefaultFileMode)
231+
if err != nil {
232+
log.Fatalf("Failed to write out CRD manifest %s: %v", crdPath, err)
233+
}
234+
}
235+
194236
func insertGoModReplaceDir(repo, path string) ([]byte, error) {
195237
modBytes, err := ioutil.ReadFile("go.mod")
196238
if err != nil {

internal/pkg/scaffold/ansible/go_mod.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ replace (
5454
k8s.io/client-go => k8s.io/client-go kubernetes-1.14.1
5555
k8s.io/cloud-provider => k8s.io/cloud-provider kubernetes-1.14.1
5656
k8s.io/kubernetes => k8s.io/kubernetes v1.14.1
57+
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver kubernetes-1.14.1
5758
)
5859
5960
// Pinned to v2.10.0 (kubernetes-1.14.1) so https://proxy.golang.org can

internal/pkg/scaffold/crd_test.go

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -65,49 +65,49 @@ spec:
6565
plural: memcacheds
6666
singular: memcached
6767
scope: Namespaced
68+
subresources:
69+
status: {}
70+
validation:
71+
openAPIV3Schema:
72+
description: Memcached is the Schema for the memcacheds API
73+
properties:
74+
apiVersion:
75+
description: 'APIVersion defines the versioned schema of this representation
76+
of an object. Servers should convert recognized schemas to the latest
77+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
78+
type: string
79+
kind:
80+
description: 'Kind is a string value representing the REST resource this
81+
object represents. Servers may infer this from the endpoint the client
82+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
83+
type: string
84+
metadata:
85+
type: object
86+
spec:
87+
properties:
88+
size:
89+
description: Size is the size of the memcached deployment
90+
format: int32
91+
type: integer
92+
required:
93+
- size
94+
type: object
95+
status:
96+
properties:
97+
nodes:
98+
description: Nodes are the names of the memcached pods
99+
items:
100+
type: string
101+
type: array
102+
required:
103+
- nodes
104+
type: object
105+
type: object
68106
version: v1alpha1
69107
versions:
70108
- name: v1alpha1
71-
schema:
72-
openAPIV3Schema:
73-
description: Memcached is the Schema for the memcacheds API
74-
properties:
75-
apiVersion:
76-
description: 'APIVersion defines the versioned schema of this representation
77-
of an object. Servers should convert recognized schemas to the latest
78-
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
79-
type: string
80-
kind:
81-
description: 'Kind is a string value representing the REST resource this
82-
object represents. Servers may infer this from the endpoint the client
83-
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
84-
type: string
85-
metadata:
86-
type: object
87-
spec:
88-
properties:
89-
size:
90-
description: Size is the size of the memcached deployment
91-
format: int32
92-
type: integer
93-
required:
94-
- size
95-
type: object
96-
status:
97-
properties:
98-
nodes:
99-
description: Nodes are the names of the memcached pods
100-
items:
101-
type: string
102-
type: array
103-
required:
104-
- nodes
105-
type: object
106-
type: object
107109
served: true
108110
storage: true
109-
subresources:
110-
status: {}
111111
`
112112

113113
func TestCRDNonGoProject(t *testing.T) {

0 commit comments

Comments
 (0)