Skip to content

Commit

Permalink
upgrade to latest dependencies (#162)
Browse files Browse the repository at this point in the history
bumping knative.dev/serving 70fa638...b28062c:
  > b28062c Fix example to immediately collect any inactive revision (# 12422) (# 12517)
  > 47e9f68 fix ytt package name (# 12644)
  > 0cd25ac upgrade to latest dependencies (# 12633)
  > aae1fff Updates val webhook selector to reduce invocations (# 12612)
bumping knative.dev/pkg 3c00bb0...d481724:
  > d481724 Update community files (# 2428)
  > 9ea8176 Update actions (# 2430)
  > 0caafcb upgrade to latest dependencies (# 2429)
  > 3b550af changeset: Look in packed-refs file if ref file not found. (# 2425)
  > 5e98acd Make URL compatible with controller-gen (# 2431)
bumping knative.dev/hack 0456e8b...a8ef7b6:
  > a8ef7b6 Skip presubmit tests for .github updates (# 154)

Signed-off-by: Knative Automation <[email protected]>
  • Loading branch information
knative-automation authored Feb 21, 2022
1 parent 8ceeddf commit b9f7f43
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 15 deletions.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ require (
k8s.io/client-go v0.22.5
knative.dev/client v0.29.1-0.20220217100713-af052088caa5
knative.dev/eventing v0.29.1-0.20220217054812-7a48f4269b6f
knative.dev/hack v0.0.0-20220216040439-0456e8bf6547
knative.dev/pkg v0.0.0-20220215153400-3c00bb0157b9
knative.dev/hack v0.0.0-20220218190734-a8ef7b67feec
knative.dev/pkg v0.0.0-20220217155112-d48172451966
knative.dev/reconciler-test v0.0.0-20220216192840-2c3291f210ce
knative.dev/serving v0.29.1-0.20220217133511-70fa63844aca
knative.dev/serving v0.29.1-0.20220217223834-b28062cdc4c7
sigs.k8s.io/yaml v1.3.0
)
14 changes: 9 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1927,6 +1927,7 @@ k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/
k8s.io/utils v0.0.0-20211208161948-7d6a63dca704 h1:ZKMMxTvduyf5WUtREOqg5LiXaN1KO/+0oOQPRFrClpo=
k8s.io/utils v0.0.0-20211208161948-7d6a63dca704/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
knative.dev/caching v0.0.0-20220210201907-0f9d7ce342fd/go.mod h1:BjBFTZc6CSCxC3FnMOW7RfuN2znfOFLVtGyuV8O9ygs=
knative.dev/caching v0.0.0-20220215153300-f572f6e62996/go.mod h1:BjBFTZc6CSCxC3FnMOW7RfuN2znfOFLVtGyuV8O9ygs=
knative.dev/client v0.29.1-0.20220217100713-af052088caa5 h1:qufe2pIc8LsmLECUD5pr9TJjvi6BzlYGLzLDBT0Rg0c=
knative.dev/client v0.29.1-0.20220217100713-af052088caa5/go.mod h1:Y4PQliif6DXXhKks3jYACcKR/IQL+2AkY4vWa6sVbe0=
knative.dev/eventing v0.29.1-0.20220216064840-13c0ce85277b/go.mod h1:Q6l5svQIhulsqkTQco38HKGCM54Imx7GSIRBASXINAM=
Expand All @@ -1936,23 +1937,26 @@ knative.dev/hack v0.0.0-20220118141833-9b2ed8471e30/go.mod h1:PHt8x8yX5Z9pPquBEf
knative.dev/hack v0.0.0-20220128200847-51a42b2eb63e/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/hack v0.0.0-20220209225905-7331bb16ba00/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/hack v0.0.0-20220215185059-b9cb1983b600/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/hack v0.0.0-20220216040439-0456e8bf6547 h1:lEWsaG/yMLLp3onNushrawsHFXD4LXCXTo5FUUa2GiU=
knative.dev/hack v0.0.0-20220216040439-0456e8bf6547/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/hack v0.0.0-20220218190734-a8ef7b67feec h1:ihYrJkaAT6sJeBUQf0rwOO0//sXUAUG+m/B1t3zBNBI=
knative.dev/hack v0.0.0-20220218190734-a8ef7b67feec/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/hack/schema v0.0.0-20220215185059-b9cb1983b600/go.mod h1:ffjwmdcrH5vN3mPhO8RrF2KfNnbHeCE2C60A+2cv3U0=
knative.dev/networking v0.0.0-20220215054657-a70f23cc46a5/go.mod h1:2eVOiwcJEuVV6ejtLEhLEpx92veKYthrt+15BN+Cl2w=
knative.dev/networking v0.0.0-20220216014839-4337f034f4ca h1:1uIKIvGtVIXZD5Om5F78vF6QSD8W7eNLYpSeiwrD5eo=
knative.dev/networking v0.0.0-20220216014839-4337f034f4ca/go.mod h1:3/iXbjjHxxHyo5F0oBo4NDcKMbbsXADFBnLHMSxqD/o=
knative.dev/networking v0.0.0-20220217013411-48ac02ff5975 h1:I1cldxwme8yrdtiU5hURkVvPvuLqT1zKNEObuEQRFjw=
knative.dev/networking v0.0.0-20220217013411-48ac02ff5975/go.mod h1:3/iXbjjHxxHyo5F0oBo4NDcKMbbsXADFBnLHMSxqD/o=
knative.dev/pkg v0.0.0-20220118160532-77555ea48cd4/go.mod h1:etVT7Tm8pSDf4RKhGk4r7j/hj3dNBpvT7bO6a6wpahs=
knative.dev/pkg v0.0.0-20220203020920-51be315ed160/go.mod h1:bZMFTPDPHV3wXuiQ09UJuEGYYQnfpe81MCxNvsMAiJk=
knative.dev/pkg v0.0.0-20220210201907-fc93ac76d0b6/go.mod h1:6ZoCgi60jSUn/WrwTGNAZbsz5/kmwiZZD8EovSLzYZ4=
knative.dev/pkg v0.0.0-20220215153400-3c00bb0157b9 h1:u0vYuNe0BTFvbqN8euaauL/kN3jR7mjmxMc+QRnWsUw=
knative.dev/pkg v0.0.0-20220215153400-3c00bb0157b9/go.mod h1:6ZoCgi60jSUn/WrwTGNAZbsz5/kmwiZZD8EovSLzYZ4=
knative.dev/pkg v0.0.0-20220217155112-d48172451966 h1:4qXRfR/ZhanbOoJYQwJjmAoFEg3qi5x/KVTRp06HK1U=
knative.dev/pkg v0.0.0-20220217155112-d48172451966/go.mod h1:qymIihGpeunap7KEUhrKRcm0LjhkCjL+n7ryIx2kLH0=
knative.dev/reconciler-test v0.0.0-20220215020657-3f8092fb8739/go.mod h1:m2q6+mGqlPsJ6qP0ssMv3x2UBwIgTdTxgxJ6GK5kgu4=
knative.dev/reconciler-test v0.0.0-20220216192840-2c3291f210ce h1:EzRwv7mxqEbBE6dQlOXBUuMeq4f2SbM/CTi1pKiXraA=
knative.dev/reconciler-test v0.0.0-20220216192840-2c3291f210ce/go.mod h1:m2q6+mGqlPsJ6qP0ssMv3x2UBwIgTdTxgxJ6GK5kgu4=
knative.dev/serving v0.29.1-0.20220216160340-a1a728763819/go.mod h1:Yg+5htyZekyj3HHPUAzl5vaRM8O7ufuiVNugLwd2OoY=
knative.dev/serving v0.29.1-0.20220217133511-70fa63844aca h1:r22mJ1v/DTJHUn3n6KiSZFvHuOuyazEk5HKcb2WS0uU=
knative.dev/serving v0.29.1-0.20220217133511-70fa63844aca/go.mod h1:Yg+5htyZekyj3HHPUAzl5vaRM8O7ufuiVNugLwd2OoY=
knative.dev/serving v0.29.1-0.20220217223834-b28062cdc4c7 h1:oSE9pEue1bOngSrWQqE1mUR6bXAvWD2N8lqQz9Eciyk=
knative.dev/serving v0.29.1-0.20220217223834-b28062cdc4c7/go.mod h1:ayf5/V5vW393m5yUaOe0oiqvSibxOOzYIeOsHlnLqvk=
pgregory.net/rapid v0.3.3/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
Expand Down
2 changes: 1 addition & 1 deletion vendor/knative.dev/hack/presubmit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ source $(dirname "${BASH_SOURCE[0]}")/library.sh
readonly PRESUBMIT_TEST_FAIL_FAST=${PRESUBMIT_TEST_FAIL_FAST:-0}

# Extensions or file patterns that don't require presubmit tests.
readonly NO_PRESUBMIT_FILES=(\.png \.gitignore \.gitattributes ^OWNERS ^OWNERS_ALIASES ^AUTHORS)
readonly NO_PRESUBMIT_FILES=(\.png \.gitignore \.gitattributes ^OWNERS ^OWNERS_ALIASES ^AUTHORS \.github/*)

# Flag if this is a presubmit run or not.
(( IS_PROW )) && [[ ${JOB_TYPE} == "presubmit" ]] && IS_PRESUBMIT=1 || IS_PRESUBMIT=0
Expand Down
1 change: 1 addition & 0 deletions vendor/knative.dev/pkg/apis/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
// URL is an alias of url.URL.
// It has custom json marshal methods that enable it to be used in K8s CRDs
// such that the CRD resource will have the URL but operator code can can work with url.URL struct
// +kubebuilder:validation:Type=string
type URL url.URL

// ParseURL attempts to parse the given string as a URL.
Expand Down
67 changes: 65 additions & 2 deletions vendor/knative.dev/pkg/changeset/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package changeset

import (
"bufio"
"fmt"
"io/ioutil"
"os"
Expand All @@ -28,6 +29,10 @@ import (
const (
commitIDFile = "HEAD"
koDataPathEnvName = "KO_DATA_PATH"
// packedRefsFile is a file containing a list of refs, used to compact the
// list of refs instead of storing them on the filesystem directly.
// See https://git-scm.com/docs/git-pack-refs
packedRefsFile = "packed-refs"
)

var commitIDRE = regexp.MustCompile(`^[a-f0-9]{40}$`)
Expand All @@ -41,9 +46,27 @@ func Get() (string, error) {
}
commitID := strings.TrimSpace(string(data))
if rID := strings.TrimPrefix(commitID, "ref: "); rID != commitID {
// First try to read from the direct ref file - e.g. refs/heads/main
data, err := readFileFromKoData(rID)
if err != nil {
return "", err
if !os.IsNotExist(err) {
return "", err
}

// Ref file didn't exist - it might be contained in the packed-refs
// file.
var pferr error
data, pferr = findPackedRef(rID)
// Only return the sub-error if the packed-refs file exists, otherwise
// just let the original error return (e.g. treat it as if we didn't
// even attempt the operation). This is primarily to keep the error
// messages clean.
if pferr != nil {
if os.IsNotExist(pferr) {
return "", err
}
return "", pferr
}
}
commitID = strings.TrimSpace(string(data))
}
Expand All @@ -58,9 +81,49 @@ func Get() (string, error) {
// to be wrapped into the container from /kodata by ko. If it fails, returns
// the error it gets.
func readFileFromKoData(filename string) ([]byte, error) {
f, err := koDataFile(filename)
if err != nil {
return nil, err
}
defer f.Close()
return ioutil.ReadAll(f)
}

// readFileFromKoData tries to open the file with given name under KO_DATA_PATH.
// The file is expected to be wrapped into the container from /kodata by ko.
// If it fails, returns the error it gets.
func koDataFile(filename string) (*os.File, error) {
koDataPath := os.Getenv(koDataPathEnvName)
if koDataPath == "" {
return nil, fmt.Errorf("%q does not exist or is empty", koDataPathEnvName)
}
return ioutil.ReadFile(filepath.Join(koDataPath, filename))
return os.Open(filepath.Join(koDataPath, filename))
}

// findPackedRef searches the packed-ref file for ref values.
// This can happen if the # of refs in a repo grows too much - git will try
// and condense them into a file.
// See https://git-scm.com/docs/git-pack-refs
func findPackedRef(ref string) ([]byte, error) {
f, err := koDataFile(packedRefsFile)
if err != nil {
return nil, err
}
defer f.Close()

scanner := bufio.NewScanner(f)
for scanner.Scan() {
// We only care about lines with `<commit> <ref>` pairs.
// Why this might happen:
// 1. Lines starting with ^ refer to unpeeled tag SHAs
// (e.g. the commits pointed to by annotated tags)
s := strings.Split(scanner.Text(), " ")
if len(s) != 2 {
continue
}
if ref == s[1] {
return []byte(s[0]), nil
}
}
return nil, fmt.Errorf("%q ref not found in packed-refs", ref)
}
8 changes: 4 additions & 4 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1089,14 +1089,14 @@ knative.dev/eventing/test/upgrade/prober/wathola/config
knative.dev/eventing/test/upgrade/prober/wathola/event
knative.dev/eventing/test/upgrade/prober/wathola/forwarder
knative.dev/eventing/test/upgrade/prober/wathola/sender
# knative.dev/hack v0.0.0-20220216040439-0456e8bf6547
# knative.dev/hack v0.0.0-20220218190734-a8ef7b67feec
## explicit
knative.dev/hack
# knative.dev/networking v0.0.0-20220216014839-4337f034f4ca
# knative.dev/networking v0.0.0-20220217013411-48ac02ff5975
knative.dev/networking/pkg
knative.dev/networking/pkg/apis/networking
knative.dev/networking/pkg/apis/networking/v1alpha1
# knative.dev/pkg v0.0.0-20220215153400-3c00bb0157b9
# knative.dev/pkg v0.0.0-20220217155112-d48172451966
## explicit
knative.dev/pkg/apis
knative.dev/pkg/apis/duck
Expand Down Expand Up @@ -1161,7 +1161,7 @@ knative.dev/reconciler-test/pkg/manifest
knative.dev/reconciler-test/pkg/milestone
knative.dev/reconciler-test/pkg/state
knative.dev/reconciler-test/resources/svc
# knative.dev/serving v0.29.1-0.20220217133511-70fa63844aca
# knative.dev/serving v0.29.1-0.20220217223834-b28062cdc4c7
## explicit
knative.dev/serving/pkg/apis/autoscaling
knative.dev/serving/pkg/apis/autoscaling/v1alpha1
Expand Down

0 comments on commit b9f7f43

Please sign in to comment.