Skip to content

Commit

Permalink
upgrade to latest dependencies (#95)
Browse files Browse the repository at this point in the history
bumping knative.dev/client db3bcbc...09d48d5:
  > 09d48d5 Create a default config file if not exists (# 1472)
  > 7f0bc78 upgrade to latest dependencies (# 1501)
  > 48fedfd Removing deprecated flags (# 1498)
  > e7e5372 Mark deprecated options as 'hidden' (# 1500)
  > 5197287 Reword missing API error to mention client update (# 1497)
bumping knative.dev/pkg 5d9d300...96c0204:
  > 96c0204 upgrade to latest dependencies (# 2337)
bumping knative.dev/serving 44128f9...f1e419a:
  > f1e419a upgrade to latest dependencies (# 12205)
  > bc99775 upgrade to latest dependencies (# 12204)
  > 4317e47 Update net-kourier nightly (# 12202)
bumping knative.dev/eventing 4de0da0...1e4fa35:
  > 1e4fa35 upgrade to latest dependencies (# 5865)
  > 5263765 upgrade to latest dependencies (# 5864)
bumping knative.dev/hack b96d65a...11d193b:
  > 11d193b 1.0 Backports (# 99)

Signed-off-by: Knative Automation <[email protected]>
  • Loading branch information
knative-automation authored Nov 2, 2021
1 parent 4d616cb commit 5932ec4
Show file tree
Hide file tree
Showing 8 changed files with 110 additions and 38 deletions.
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ require (
k8s.io/apimachinery v0.21.4
k8s.io/cli-runtime v0.21.4
k8s.io/client-go v0.21.4
knative.dev/client v0.26.1-0.20211101113922-db3bcbc6b04d
knative.dev/eventing v0.26.1-0.20211029100351-4de0da062efa
knative.dev/hack v0.0.0-20211028194650-b96d65a5ff5e
knative.dev/pkg v0.0.0-20211028235650-5d9d300c2e40
knative.dev/serving v0.26.1-0.20211101130423-44128f957caf
knative.dev/client v0.26.1-0.20211102100340-09d48d5f4c2f
knative.dev/eventing v0.27.0
knative.dev/hack v0.0.0-20211101195839-11d193bf617b
knative.dev/pkg v0.0.0-20211101212339-96c0204a70dc
knative.dev/serving v0.27.0
)
25 changes: 16 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1678,21 +1678,28 @@ k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/
k8s.io/utils v0.0.0-20210111153108-fddb29f9d009 h1:0T5IaWHO3sJTEmCP6mUlBvMukxPKUQWqiI/YuiBNMiQ=
k8s.io/utils v0.0.0-20210111153108-fddb29f9d009/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
knative.dev/caching v0.0.0-20211029072651-f2af269b6d90/go.mod h1:5lh1DR0ZI/mCx7SRwbH5K8Vy1b0AIbxOaJlcLVx9E3o=
knative.dev/client v0.26.1-0.20211101113922-db3bcbc6b04d h1:EVszWFlNrEQwdQeHtyTJVGyC+PRQ7IAtuppm2M4tM1o=
knative.dev/client v0.26.1-0.20211101113922-db3bcbc6b04d/go.mod h1:YKDAlqKAXPqk6pRyiorLELRH994MrLb0qRHjn5IGxjY=
knative.dev/eventing v0.26.1-0.20211029100351-4de0da062efa h1:RnAtkRA1UMP+NgZkorDvY5iQhJRRDEcS9Mme7WCd2Wg=
knative.dev/caching v0.0.0-20211101215439-72577a3c0ce1/go.mod h1:hz6tnVAmRLvPoprw+0wsA9IrZC3MF5l2Hn/2JT28Yk0=
knative.dev/client v0.26.1-0.20211102100340-09d48d5f4c2f h1:G0WwxABLhyMYNrDLTScbLcSt/4fAi0OT8v8rT0J3VR0=
knative.dev/client v0.26.1-0.20211102100340-09d48d5f4c2f/go.mod h1:NVN+hzUIcqnEv9HCLvWj+tqiW0aT5txGFuWsXwdRjq4=
knative.dev/eventing v0.26.1-0.20211029100351-4de0da062efa/go.mod h1:n0CQNBQIeUqNfjgnywUykDXVKWDSlUVG3cUoK7WHxhk=
knative.dev/hack v0.0.0-20211028194650-b96d65a5ff5e h1:0Hw2xdWYbcs2JRJnOLzAVh7APOtgro7gSno0228mnDg=
knative.dev/eventing v0.27.0 h1:P9rqKvsCeFb8sEhfK32WFTG7awdOAa7XO6p3umSq/wU=
knative.dev/eventing v0.27.0/go.mod h1:4ppWQEQ/2B66/YFENDmV1Gjxs4meLpz6UTUgLkkINt4=
knative.dev/hack v0.0.0-20211028194650-b96d65a5ff5e/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/hack v0.0.0-20211101195839-11d193bf617b h1:DaW1iliZlBAwq/I8gTqVu8UnfGxyb5yR7CDsJi5jyWk=
knative.dev/hack v0.0.0-20211101195839-11d193bf617b/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/hack/schema v0.0.0-20211028194650-b96d65a5ff5e/go.mod h1:ffjwmdcrH5vN3mPhO8RrF2KfNnbHeCE2C60A+2cv3U0=
knative.dev/networking v0.0.0-20211029072251-c3606d9f7b38 h1:QC9p++h3mIo8BKohO1KV1PvLLtAKxgRNUDoTZwOdMWc=
knative.dev/hack/schema v0.0.0-20211101195839-11d193bf617b/go.mod h1:ffjwmdcrH5vN3mPhO8RrF2KfNnbHeCE2C60A+2cv3U0=
knative.dev/networking v0.0.0-20211029072251-c3606d9f7b38/go.mod h1:Ehgk5lhjcXSngdOv0fQu0vPXRivhx4JtS9uEhlm4fug=
knative.dev/pkg v0.0.0-20211028235650-5d9d300c2e40 h1:eOOOqcj+IHIp5te9GGZsrq6vCXUv2y5JItRT3nXHs20=
knative.dev/networking v0.0.0-20211101215640-8c71a2708e7d h1:nCnuNfcLWuyAdZYgVfwSooa3+p2ebx+V+qhGXXF/FIk=
knative.dev/networking v0.0.0-20211101215640-8c71a2708e7d/go.mod h1:7SKKM4MsBANrXNRZhb/zMkNjTdxYbNjwQDWgu+Fyye4=
knative.dev/pkg v0.0.0-20211028235650-5d9d300c2e40/go.mod h1:HyEqMTLzT2hGCisGaRMGzEE8b4Ym+7mhmVx5ygiX+fY=
knative.dev/pkg v0.0.0-20211101212339-96c0204a70dc h1:ldjbTpoMXUTgzw0IJsAFLdyA6/6QYRvz8IGPZOknEDg=
knative.dev/pkg v0.0.0-20211101212339-96c0204a70dc/go.mod h1:SkfDk9bWIiNZD7XtILGkG7AKVyF/M6M0bGxLgl0SYL8=
knative.dev/reconciler-test v0.0.0-20211029073051-cff9b538d33c/go.mod h1:PIwtS0at/rtnsNCxcZUAZUmWKKasTUYJ/w1Mk94bOdA=
knative.dev/serving v0.26.1-0.20211029121451-44358cc842c6/go.mod h1:1w3kpOAeaJTtnidzEbMvjtkwNm3/QlSQFZWN1bmM/FM=
knative.dev/serving v0.26.1-0.20211101130423-44128f957caf h1:sW97gOasttFZaadMausse2KbsuxsttfmcNZKAqZoJow=
knative.dev/serving v0.26.1-0.20211101130423-44128f957caf/go.mod h1:1w3kpOAeaJTtnidzEbMvjtkwNm3/QlSQFZWN1bmM/FM=
knative.dev/reconciler-test v0.0.0-20211101214439-9839937c9b13/go.mod h1:gTsbLk496j/M9xqMpx/liyCQ0X3bwDpRtcs2Zzws364=
knative.dev/serving v0.26.1-0.20211101141423-4317e47d4207/go.mod h1:1w3kpOAeaJTtnidzEbMvjtkwNm3/QlSQFZWN1bmM/FM=
knative.dev/serving v0.27.0 h1:pstGHQ8aSJsIwdofkjJV6TrmPN09u/2qN1Mgfc92LQs=
knative.dev/serving v0.27.0/go.mod h1:Lcqv3K/DeDt6ZoeWTgpjxc/0teS7uMebnnU+gXIw99c=
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
15 changes: 13 additions & 2 deletions vendor/knative.dev/client/pkg/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@ package errors
import (
"fmt"
"strings"
"unicode"
"unicode/utf8"
)

func newInvalidCRD(apiGroup string) *KNError {
func NewInvalidCRD(apiGroup string) *KNError {
parts := strings.Split(apiGroup, ".")
name := parts[0]
msg := fmt.Sprintf("no Knative %s API found on the backend, please verify the installation", name)
msg := fmt.Sprintf("no or newer Knative %s API found on the backend, please verify the installation or "+
"update the 'kn' client", firstCharToUpper(name))
return NewKNError(msg)
}

Expand All @@ -37,3 +40,11 @@ func newNoRouteToHost(errString string) *KNError {
func newNoKubeConfig(errString string) *KNError {
return NewKNError("no kubeconfig has been provided, please use a valid configuration to connect to the cluster")
}

func firstCharToUpper(s string) string {
if len(s) == 0 {
return s
}
r, n := utf8.DecodeRuneInString(s)
return string(unicode.ToUpper(r)) + s[n:]
}
2 changes: 1 addition & 1 deletion vendor/knative.dev/client/pkg/errors/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func newStatusError(err error) error {
}
var knerr *KNError
if isCRDError(errAPIStatus) {
knerr = newInvalidCRD(errAPIStatus.Status().Details.Group)
knerr = NewInvalidCRD(errAPIStatus.Status().Details.Group)
knerr.Status = errAPIStatus
return knerr
}
Expand Down
33 changes: 27 additions & 6 deletions vendor/knative.dev/client/pkg/kn/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,24 @@ type defaultConfig struct {
// Initialize defaults
var bootstrapDefaults = initDefaults()

const configContentDefaults = `# Taken from https://github.com/knative/client/blob/main/docs/README.md#options
#
#plugins:
# path-lookup: true
# directory: ~/.config/kn/plugins
#eventing:
# sink-mappings:
# - prefix: svc
# group: core
# version: v1
# resource: services
# channel-type-mappings:
# - alias: Kafka
# group: messaging.knative.dev
# version: v1alpha1
# kind: KafkaChannel
`

// config contains the variables for the Kn config
type config struct {
// configFile is the config file location
Expand Down Expand Up @@ -119,18 +137,21 @@ func BootstrapConfig() error {
return err
}

// Check if configfile exists. If not, just return
viper.SetConfigFile(GlobalConfig.ConfigFile())
configFile := GlobalConfig.ConfigFile()
_, err = os.Lstat(configFile)
if err != nil {
if os.IsNotExist(err) {
// No config file to read
return nil
if !os.IsNotExist(err) {
return fmt.Errorf("cannot stat configfile %s: %w", configFile, err)
}
if err := os.MkdirAll(filepath.Dir(viper.ConfigFileUsed()), 0775); err != nil {
return err
}
if err := os.WriteFile(viper.ConfigFileUsed(), []byte(configContentDefaults), 0600); err != nil {
fmt.Fprintf(os.Stderr, "WARNING: failed writing config file to %q: %s\n", configFile, err)
}
return fmt.Errorf("cannot stat configfile %s: %w", configFile, err)
}

viper.SetConfigFile(GlobalConfig.ConfigFile())
viper.AutomaticEnv() // read in environment variables that match

// Defaults are taken from the parsed flags, which in turn have bootstrap defaults
Expand Down
1 change: 1 addition & 0 deletions vendor/knative.dev/client/pkg/kn/flags/podspec.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ func (p *PodSpecFlags) AddFlags(flagset *pflag.FlagSet) []string {
// DEPRECATED since 1.0
flagset.StringVarP(&p.ExtraContainers, "extra-containers", "", "",
"Deprecated, use --containers instead.")
flagset.MarkHidden("extra-containers")
flagNames = append(flagNames, "containers")

flagset.StringVarP(&p.ExtraContainers, "containers", "", "",
Expand Down
50 changes: 41 additions & 9 deletions vendor/knative.dev/hack/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,18 @@ function master_version() {
echo "${tokens[0]}.${tokens[1]}"
}

# Return the minor version of a release.
# For example, "v0.2.1" returns "2"
# Parameters: $1 - release version label.
function minor_version() {
local tokens=(${1//\./ })
echo "${tokens[1]}"
}

# Return the release build number of a release.
# For example, "v0.2.1" returns "1".
# Parameters: $1 - release version label.
function release_build_number() {
function patch_version() {
local tokens=(${1//\./ })
echo "${tokens[2]}"
}
Expand Down Expand Up @@ -171,7 +179,10 @@ function prepare_auto_release() {
PUBLISH_RELEASE=1

git fetch --all || abort "error fetching branches/tags from remote"
local tags="$(git tag | cut -d 'v' -f2 | cut -d '.' -f1-2 | sort -V | uniq)"
# Support two different formats for tags
# - knative-v1.0.0
# - v1.0.0
local tags="$(git tag | cut -d '-' -f2 | cut -d 'v' -f2 | cut -d '.' -f1-2 | sort -V | uniq)"
local branches="$( { (git branch -r | grep upstream/release-) ; (git branch | grep release-); } | cut -d '-' -f2 | sort -V | uniq)"

echo "Versions released (from tags): [" "${tags}" "]"
Expand Down Expand Up @@ -210,7 +221,10 @@ function prepare_dot_release() {
git fetch --all || abort "error fetching branches/tags from remote"
# List latest release
local releases # don't combine with the line below, or $? will be 0
releases="$(hub_tool release)"
# Support tags in two formats
# - knative-v1.0.0
# - v1.0.0
releases="$(hub_tool release | cut -d '-' -f2)"
echo "Current releases are: ${releases}"
[[ $? -eq 0 ]] || abort "cannot list releases"
# If --release-branch passed, restrict to that release
Expand All @@ -234,7 +248,9 @@ function prepare_dot_release() {
[[ -n "${major_minor_version}" ]] || abort "cannot get release major/minor version"
# Ensure there are new commits in the branch, otherwise we don't create a new release
setup_branch
local last_release_commit="$(git rev-list -n 1 "${last_version}")"
# Use the original tag (ie. potentially with a knative- prefix) when determining the last version commit sha
local github_tag="$(hub_tool release | grep "${last_version}")"
local last_release_commit="$(git rev-list -n 1 "${github_tag}")"
local release_branch_commit="$(git rev-list -n 1 upstream/"${RELEASE_BRANCH}")"
[[ -n "${last_release_commit}" ]] || abort "cannot get last release commit"
[[ -n "${release_branch_commit}" ]] || abort "cannot get release branch last commit"
Expand All @@ -246,13 +262,13 @@ function prepare_dot_release() {
exit 0
fi
# Create new release version number
local last_build="$(release_build_number "${last_version}")"
local last_build="$(patch_version "${last_version}")"
RELEASE_VERSION="${major_minor_version}.$(( last_build + 1 ))"
echo "Will create release ${RELEASE_VERSION} at commit ${release_branch_commit}"
# If --release-notes not used, copy from the latest release
if [[ -z "${RELEASE_NOTES}" ]]; then
RELEASE_NOTES="$(mktemp)"
hub_tool release show -f "%b" "${last_version}" > "${RELEASE_NOTES}"
hub_tool release show -f "%b" "${github_tag}" > "${RELEASE_NOTES}"
echo "Release notes from ${last_version} copied to ${RELEASE_NOTES}"
fi
}
Expand Down Expand Up @@ -595,6 +611,8 @@ function publish_to_github() {
local description="$(mktemp)"
local attachments_dir="$(mktemp -d)"
local commitish=""
local github_tag="knative-${TAG}"

# Copy files to a separate dir
for artifact in $@; do
cp ${artifact} "${attachments_dir}"/
Expand All @@ -604,16 +622,30 @@ function publish_to_github() {
if [[ -n "${RELEASE_NOTES}" ]]; then
cat "${RELEASE_NOTES}" >> "${description}"
fi
git tag -a "${TAG}" -m "${title}"
git_push tag "${TAG}"
git tag -a "${github_tag}" -m "${title}"
git_push tag "${github_tag}"

# Include a tag for the go module version
#
# v1.0.0 = v0.27.0
# v1.0.1 = v0.27.1
# v1.1.1 = v0.28.1
#
# See: https://github.com/knative/hack/pull/97
if [[ "$TAG" == "v1"* ]]; then
local release_minor=$(minor_version $TAG)
local go_module_version="v0.$(( release_minor + 27 )).$(patch_version $TAG)"
git tag -a "${go_module_version}" -m "${title}"
git_push tag "${go_module_version}"
fi

[[ -n "${RELEASE_BRANCH}" ]] && commitish="--commitish=${RELEASE_BRANCH}"
for i in {2..0}; do
hub_tool release create \
${attachments[@]} \
--file="${description}" \
"${commitish}" \
"${TAG}" && return 0
"${github_tag}" && return 0
if [[ "${i}" -gt 0 ]]; then
echo "Error publishing the release, retrying in 15s..."
sleep 15
Expand Down
12 changes: 6 additions & 6 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ k8s.io/utils/buffer
k8s.io/utils/integer
k8s.io/utils/pointer
k8s.io/utils/trace
# knative.dev/client v0.26.1-0.20211101113922-db3bcbc6b04d
# knative.dev/client v0.26.1-0.20211102100340-09d48d5f4c2f
## explicit
knative.dev/client/pkg/config
knative.dev/client/pkg/dynamic
Expand All @@ -659,7 +659,7 @@ knative.dev/client/pkg/sources/v1beta2
knative.dev/client/pkg/util
knative.dev/client/pkg/util/mock
knative.dev/client/pkg/wait
# knative.dev/eventing v0.26.1-0.20211029100351-4de0da062efa
# knative.dev/eventing v0.27.0
## explicit
knative.dev/eventing/pkg/apis/config
knative.dev/eventing/pkg/apis/duck
Expand All @@ -683,14 +683,14 @@ knative.dev/eventing/pkg/client/clientset/versioned/typed/messaging/v1
knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1
knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1/fake
knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1beta2
# knative.dev/hack v0.0.0-20211028194650-b96d65a5ff5e
# knative.dev/hack v0.0.0-20211101195839-11d193bf617b
## explicit
knative.dev/hack
# knative.dev/networking v0.0.0-20211029072251-c3606d9f7b38
# knative.dev/networking v0.0.0-20211101215640-8c71a2708e7d
knative.dev/networking/pkg
knative.dev/networking/pkg/apis/networking
knative.dev/networking/pkg/apis/networking/v1alpha1
# knative.dev/pkg v0.0.0-20211028235650-5d9d300c2e40
# knative.dev/pkg v0.0.0-20211101212339-96c0204a70dc
## explicit
knative.dev/pkg/apis
knative.dev/pkg/apis/duck
Expand Down Expand Up @@ -721,7 +721,7 @@ knative.dev/pkg/resolver
knative.dev/pkg/signals
knative.dev/pkg/system
knative.dev/pkg/tracker
# knative.dev/serving v0.26.1-0.20211101130423-44128f957caf
# knative.dev/serving v0.27.0
## explicit
knative.dev/serving/pkg/apis/autoscaling
knative.dev/serving/pkg/apis/autoscaling/v1alpha1
Expand Down

0 comments on commit 5932ec4

Please sign in to comment.