Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove vendor folder and copy knative/hack contents to hack/upstream folder #3396

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ set -o errexit
set -o nounset
set -o pipefail

source $(dirname "${BASH_SOURCE[0]}")/../vendor/knative.dev/hack/library.sh
source $(dirname "${BASH_SOURCE[0]}")/../hack/upstream/library.sh

# Make sure our dependencies are up-to-date
"${REPO_ROOT_DIR}"/hack/update-deps.sh "$@"
Expand Down
2 changes: 1 addition & 1 deletion hack/update-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ set -o errexit
set -o nounset
set -o pipefail

source $(dirname "${BASH_SOURCE[0]}")/../vendor/knative.dev/hack/library.sh
source $(dirname "${BASH_SOURCE[0]}")/../hack/upstream/library.sh

go_update_deps "$@"
File renamed without changes.
8 changes: 8 additions & 0 deletions hack/upstream/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
approvers:
- technical-oversight-committee
- productivity-writers
- knative-release-leads

reviewers:
- productivity-writers
- productivity-reviewers
211 changes: 211 additions & 0 deletions hack/upstream/OWNERS_ALIASES
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
# This file is auto-generated from peribolos.
# Do not modify this file, instead modify peribolos/knative.yaml

aliases:
api-core-wg-leads:
- dprotaso
client-reviewers:
- itsmurugappan
client-wg-leads:
- dsimansk
- navidshaikh
- rhuss
client-writers:
- dsimansk
- maximilien
- navidshaikh
- rhuss
conformance-task-force-leads:
- omerbensaadon
- salaboy
conformance-writers:
- omerbensaadon
- salaboy
docs-reviewers:
- nainaz
- omerbensaadon
- pmbanugo
- snneji
docs-wg-leads:
- abrennan89
- csantanapr
- snneji
docs-writers:
- abrennan89
- csantanapr
- psschwei
- snneji
eventing-reviewers:
- aslom
- tayarani
- tommyreddad
eventing-triage:
- akashrv
- lberk
eventing-wg-leads:
- lionelvillard
- pierDipi
eventing-writers:
- akashrv
- aliok
- lberk
- lionelvillard
- matzew
- odacremolbap
- pierDipi
knative-admin:
- chizhg
- csantanapr
- dprotaso
- dsimansk
- evankanderson
- itsmurugappan
- knative-automation
- knative-prow-releaser-robot
- knative-prow-robot
- knative-prow-updater-robot
- knative-test-reporter-robot
- kvmware
- lance
- n3wscott
- pmorie
- psschwei
- smoser-ibm
- spencerdillard
- thisisnotapril
- upodroid
- vaikas
- zroubalik
knative-release-leads:
- evankanderson
- psschwei
knative-robots:
- knative-automation
- knative-prow-releaser-robot
- knative-prow-robot
- knative-prow-updater-robot
- knative-test-reporter-robot
networking-reviewers:
- JRBANCEL
- ZhiminXiang
- andrew-su
- arturenault
- carlisia
- nak3
- shashwathi
- tcnghia
- vagababov
- yanweiguo
networking-wg-leads:
- nak3
networking-writers:
- JRBANCEL
- nak3
- vagababov
operations-reviewers:
- Cynocracy
- aliok
- houshengbo
- jcrossley3
- matzew
- maximilien
- trshafer
operations-wg-leads:
- houshengbo
operations-writers:
- Cynocracy
- aliok
- houshengbo
- jcrossley3
- matzew
- maximilien
- trshafer
pkg-configmap-reviewers:
- dprotaso
- mattmoor
- vagababov
pkg-configmap-writers:
- dprotaso
- mattmoor
- vagababov
pkg-controller-reviewers:
- dprotaso
- mattmoor
- tcnghia
- vagababov
- whaught
pkg-controller-writers:
- dprotaso
- mattmoor
- tcnghia
- vagababov
productivity-reviewers:
- albertomilan
- evankanderson
- gerardo-lc
- mgencur
- shinigambit
productivity-wg-leads:
- chizhg
- kvmware
- upodroid
productivity-writers:
- cardil
- chaodaiG
- chizhg
- coryrc
- kvmware
- psschwei
- upodroid
security-wg-leads:
- evankanderson
- julz
security-writers:
- evankanderson
- julz
serving-observability-reviewers:
- skonto
- yanweiguo
serving-observability-writers:
- yanweiguo
serving-reviewers:
- carlisia
- julz
- nader-ziada
- nealhu
- psschwei
- skonto
- whaught
serving-wg-leads:
- dprotaso
serving-writers:
- dprotaso
- julz
- psschwei
- tcnghia
- vagababov
steering-committee:
- csantanapr
- itsmurugappan
- lance
- pmorie
- thisisnotapril
- vaikas
technical-oversight-committee:
- dprotaso
- dsimansk
- evankanderson
- n3wscott
- zroubalik
trademark-committee:
- evankanderson
- smoser-ibm
- spencerdillard
ux-wg-leads:
- abrennan89
- csantanapr
- snneji
ux-writers:
- abrennan89
- csantanapr
- snneji
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
Copyright 2015 The Kubernetes Authors.
Copyright 2020 The Knative Authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0
https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -14,5 +14,18 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Package errors implements various utility functions and types around errors.
package errors // import "k8s.io/apimachinery/pkg/util/errors"
package foo_test

import (
"errors"
"testing"

"knative.dev/hack/shell"
)

func TestCallerNotAllowed(t *testing.T) {
_, err := shell.NewProjectLocation("..")
if !errors.Is(err, shell.ErrCallerNotAllowed) {
t.Error("usage should be blocked")
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 1 addition & 19 deletions vendor/knative.dev/hack/library.sh → hack/upstream/library.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -632,31 +632,13 @@ function go_update_deps() {
fi
fi

group "Go mod tidy and vendor"
group "Go mod tidy"

# Prune modules.
local orig_pipefail_opt=$(shopt -p -o pipefail)
set -o pipefail
go mod tidy 2>&1 | grep -v "ignoring symlink" || true
go mod vendor 2>&1 | grep -v "ignoring symlink" || true
eval "$orig_pipefail_opt"

group "Removing unwanted vendor files"

# Remove unwanted vendor files
find vendor/ \( -name "OWNERS" \
-o -name "OWNERS_ALIASES" \
-o -name "BUILD" \
-o -name "BUILD.bazel" \
-o -name "*_test.go" \) -exec rm -f {} +

export GOFLAGS=-mod=vendor

group "Updating licenses"
update_licenses third_party/VENDOR-LICENSE "./..."

group "Removing broken symlinks"
remove_broken_symlinks ./vendor
}

# Return the go module name of the current module.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
44 changes: 44 additions & 0 deletions hack/upstream/schema/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Schema Tool

Schema is a seed of a CLI tool that a downstream can use to use reflection and go file inspection to
generate a base version of OpenAPI for a CRD. The resulting schema will be used by Kubernetes to
provide results from `kubectl explain <type>` calls, and type validation.

Knative does not currently support full CRD generation via tools like
[controller-gen][controller-gen], this tool is to be used to support managing CRD manifests
manually.

## Integration steps

### Demo

Register the type you wish to expose in the CLI,

```go
registry.Register(&example.LoremIpsum{})
```

Run the `schema dump` command for the <Kind> you wish to have schema for,

```
cd ./schema
go run ./ dump LoremIpsum | pbcopy
```

Paste this inside the CRD for LoremIpsum,

```yaml
...
schema:
openAPIV3Schema:
<**paste**>
additionalPrinterColumns:
...
```

### Downstream

Start with [example.go](./example.go), copy this into the downstream and modify which
kinds are registered via `registry.Register`. You can register more than one kind at a time. (TODO: support versions in the CLI.)

[controller-gen]: https://github.com/kubernetes-sigs/controller-tools/tree/master/cmd/controller-gen
Loading