Skip to content

Commit

Permalink
upgrade to latest dependencies
Browse files Browse the repository at this point in the history
bumping knative.dev/hack 0456e8b...a8ef7b6:
  > a8ef7b6 Skip presubmit tests for .github updates (# 154)
bumping knative.dev/eventing 7a48f42...2a69eec:
  > 2a69eec Clearing out old state info for new placements (# 6172)
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)

Signed-off-by: Knative Automation <[email protected]>
  • Loading branch information
knative-automation committed Feb 22, 2022
1 parent 13cbadb commit 7a9530b
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 13 deletions.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ require (
k8s.io/client-go v0.22.5
k8s.io/code-generator v0.22.5
k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c
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/eventing v0.29.1-0.20220221175003-2a69eec1e358
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
sigs.k8s.io/controller-runtime v0.9.6
)
Expand Down
10 changes: 6 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2240,17 +2240,19 @@ k8s.io/utils v0.0.0-20210722164352-7f3ee0f31471/go.mod h1:jPW/WVKK9YHAvNhRxK0md/
k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
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/eventing v0.29.1-0.20220217054812-7a48f4269b6f h1:hcX3eV41PawEWk45B7tb14+qIPvRa3qgXUIPwsJECv0=
knative.dev/eventing v0.29.1-0.20220217054812-7a48f4269b6f/go.mod h1:Q6l5svQIhulsqkTQco38HKGCM54Imx7GSIRBASXINAM=
knative.dev/eventing v0.29.1-0.20220221175003-2a69eec1e358 h1:ze96GfPEwFkegFUtZyhJpl1glk6oGi6KfHCxsbV6RwE=
knative.dev/eventing v0.29.1-0.20220221175003-2a69eec1e358/go.mod h1:Q6l5svQIhulsqkTQco38HKGCM54Imx7GSIRBASXINAM=
knative.dev/hack v0.0.0-20220118141833-9b2ed8471e30/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/pkg v0.0.0-20220118160532-77555ea48cd4/go.mod h1:etVT7Tm8pSDf4RKhGk4r7j/hj3dNBpvT7bO6a6wpahs=
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=
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)
}
6 changes: 3 additions & 3 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,7 @@ k8s.io/utils/buffer
k8s.io/utils/integer
k8s.io/utils/pointer
k8s.io/utils/trace
# knative.dev/eventing v0.29.1-0.20220217054812-7a48f4269b6f
# knative.dev/eventing v0.29.1-0.20220221175003-2a69eec1e358
## explicit; go 1.16
knative.dev/eventing/pkg/adapter/v2
knative.dev/eventing/pkg/adapter/v2/util/crstatusevent
Expand Down Expand Up @@ -1247,10 +1247,10 @@ knative.dev/eventing/test/test_images/event-sender
knative.dev/eventing/test/test_images/heartbeats
knative.dev/eventing/test/test_images/performance
knative.dev/eventing/test/test_images/print
# knative.dev/hack v0.0.0-20220216040439-0456e8bf6547
# knative.dev/hack v0.0.0-20220218190734-a8ef7b67feec
## explicit; go 1.14
knative.dev/hack
# knative.dev/pkg v0.0.0-20220215153400-3c00bb0157b9
# knative.dev/pkg v0.0.0-20220217155112-d48172451966
## explicit; go 1.17
knative.dev/pkg/apis
knative.dev/pkg/apis/duck
Expand Down

0 comments on commit 7a9530b

Please sign in to comment.