Skip to content

Commit

Permalink
Merge pull request #30 from halvards/main
Browse files Browse the repository at this point in the history
chore: Bump dependencies
  • Loading branch information
halvards authored Aug 12, 2024
2 parents d7c54fa + daf9a03 commit a893c8e
Show file tree
Hide file tree
Showing 8 changed files with 376 additions and 856 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ jobs:

env:
CGO_ENABLED: "0"
COSIGN_VERSION: v2.0.2
GGCR_VERSION: v0.14.0
COSIGN_VERSION: v2.4.0
GGCR_VERSION: v0.20.2
KUBEBUILDER_VERSION: "2.3.2"
KUBECTL_VERSION: v1.26.5
KUBECTL_VERSION: v1.30.3
REGISTRY: ghcr.io
SKAFFOLD_VERSION: v2.3.1
SKAFFOLD_VERSION: v2.13.1
SKAFFOLD_CACHE_ARTIFACTS: "false"
SKAFFOLD_DETECT_MINIKUBE: "false"
SKAFFOLD_INTERACTIVE: "false"
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
- name: Install kube-apiserver and etcd
run: |
mkdir -p ${HOME}/.local/bin
curl -sSL "https://github.com/kubernetes-sigs/kubebuilder/releases/download/v${KUBEBUILDER_VERSION}/kubebuilder_${KUBEBUILDER_VERSION}_linux_amd64.tar.gz" | tar --strip-components 2 -xzC ${HOME}/.local/bin
curl -sSL "https://github.com/kubernetes-sigs/kubebuilder/releases/download/v${KUBEBUILDER_VERSION}/kubebuilder_${KUBEBUILDER_VERSION}_linux_amd64.tar.gz" | tar --strip-components 2 -xzC ${HOME}/.local/bin kubebuilder_${KUBEBUILDER_VERSION}_linux_amd64/bin/etcd kubebuilder_${KUBEBUILDER_VERSION}_linux_amd64/bin/kube-apiserver kubebuilder_${KUBEBUILDER_VERSION}_linux_amd64/bin/kubebuilder
echo "KUBEBUILDER_ASSETS=${HOME}/.local/bin" >> $GITHUB_ENV
- name: Run integration tests
Expand Down Expand Up @@ -161,7 +161,7 @@ jobs:
cosign-release: ${{ env.COSIGN_VERSION }}

- name: Sign the images with GitHub OIDC Token
run: cosign sign --yes --k8s-keychain --recursive --upload $IMAGE_NAME
run: cosign sign --k8s-keychain --recursive --upload --yes $IMAGE_NAME
env:
GITHUB_TOKEN: ${{ github.token }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Install kube-apiserver and etcd
run: |
mkdir -p ${HOME}/.local/bin
curl -sSL "https://github.com/kubernetes-sigs/kubebuilder/releases/download/v${KUBEBUILDER_VERSION}/kubebuilder_${KUBEBUILDER_VERSION}_linux_amd64.tar.gz" | tar --strip-components 2 -xzC ${HOME}/.local/bin
curl -sSL "https://github.com/kubernetes-sigs/kubebuilder/releases/download/v${KUBEBUILDER_VERSION}/kubebuilder_${KUBEBUILDER_VERSION}_linux_amd64.tar.gz" | tar --strip-components 2 -xzC ${HOME}/.local/bin kubebuilder_${KUBEBUILDER_VERSION}_linux_amd64/bin/etcd kubebuilder_${KUBEBUILDER_VERSION}_linux_amd64/bin/kube-apiserver kubebuilder_${KUBEBUILDER_VERSION}_linux_amd64/bin/kubebuilder
echo "KUBEBUILDER_ASSETS=${HOME}/.local/bin" >> $GITHUB_ENV
env:
KUBEBUILDER_VERSION: "2.3.2"
Expand Down
2 changes: 1 addition & 1 deletion .ko.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

defaultBaseImage: gcr.io/distroless/static-debian11:nonroot
defaultBaseImage: gcr.io/distroless/static-debian12:nonroot
28 changes: 18 additions & 10 deletions cmd/webhook/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client/config"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/manager"
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
"sigs.k8s.io/controller-runtime/pkg/webhook"
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"

"github.com/google/k8s-digester/pkg/handler"
Expand Down Expand Up @@ -107,15 +109,21 @@ func run(ctx context.Context) error {
return fmt.Errorf("unable to get kubeconfig: %w", err)
}
scheme := runtime.NewScheme()
corev1.AddToScheme(scheme)
if err := corev1.AddToScheme(scheme); err != nil {
return fmt.Errorf("could not add core/v1 Kubernetes resources to scheme: %w", err)
}
mgr, err := manager.New(cfg, manager.Options{
Scheme: scheme,
Logger: log,
LeaderElection: false,
Port: port,
CertDir: certDir,
MetricsBindAddress: metricsAddr,
Scheme: scheme,
Logger: log,
LeaderElection: false,
Metrics: metricsserver.Options{
BindAddress: metricsAddr,
},
HealthProbeBindAddress: healthAddr,
WebhookServer: webhook.NewServer(webhook.Options{
Port: port,
CertDir: certDir,
}),
})
if err != nil {
return fmt.Errorf("unable to set up manager: %w", err)
Expand Down Expand Up @@ -161,15 +169,15 @@ func setupControllers(mgr manager.Manager, log logr.Logger, dryRun bool, ignoreE
log.Info("waiting for cert rotation setup")
<-certSetupFinished
log.Info("done waiting for cert rotation setup")
var config *rest.Config
var k8sClientConfig *rest.Config
if !offline {
config = mgr.GetConfig()
k8sClientConfig = mgr.GetConfig()
}
whh := &handler.Handler{
Log: log.WithName("webhook"),
DryRun: dryRun,
IgnoreErrors: ignoreErrors,
Config: config,
Config: k8sClientConfig,
SkipPrefixes: skipPrefixes,
}
mwh := &admission.Webhook{Handler: whh}
Expand Down
14 changes: 9 additions & 5 deletions cmd/webhook/webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,16 @@ import (
func Test_ResolvePublicGCRImage(t *testing.T) {
ctx := ctrl.SetupSignalHandler()
scheme := runtime.NewScheme()
corev1.AddToScheme(scheme)
if err := corev1.AddToScheme(scheme); err != nil {
t.Fatalf("could not add core v1 Kubernetes resources to scheme")
}
mgr, err := ctrl.NewManager(testEnv.Config, ctrl.Options{
CertDir: testEnv.WebhookInstallOptions.LocalServingCertDir,
Host: testEnv.WebhookInstallOptions.LocalServingHost,
Port: testEnv.WebhookInstallOptions.LocalServingPort,
Scheme: scheme,
Scheme: scheme,
WebhookServer: webhook.NewServer(webhook.Options{
Host: testEnv.WebhookInstallOptions.LocalServingHost,
Port: testEnv.WebhookInstallOptions.LocalServingPort,
CertDir: testEnv.WebhookInstallOptions.LocalServingCertDir,
}),
})
if err != nil {
t.Fatalf("could not create test controller manager: %+v", err)
Expand Down
189 changes: 94 additions & 95 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,135 +14,134 @@

module github.com/google/k8s-digester

go 1.20
go 1.22.0

require (
github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20221004211355-a250ad2ca1e3
github.com/chrismellard/docker-credential-acr-env v0.0.0-20221002210726-e883f69e0206
github.com/go-logr/logr v1.2.4
github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20240809155957-ac94a3401898
github.com/chrismellard/docker-credential-acr-env v0.0.0-20230304212654-82a0ddb27589
github.com/go-logr/logr v1.4.2
github.com/go-logr/stdr v1.2.2
github.com/go-logr/zapr v1.2.4
github.com/google/go-cmp v0.5.9
github.com/google/go-containerregistry v0.14.0
github.com/google/go-containerregistry/pkg/authn/k8schain v0.0.0-20221019221123-02f47e132cf5
github.com/open-policy-agent/cert-controller v0.7.0
github.com/spf13/cobra v1.7.0
github.com/go-logr/zapr v1.3.0
github.com/google/go-cmp v0.6.0
github.com/google/go-containerregistry v0.20.2
github.com/google/go-containerregistry/pkg/authn/k8schain v0.0.0-20240810014151-b8e87ed57b80
github.com/open-policy-agent/cert-controller v0.11.0
github.com/spf13/cobra v1.8.1
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.16.0
go.uber.org/zap v1.24.0
gomodules.xyz/jsonpatch/v2 v2.3.0
k8s.io/api v0.26.5
k8s.io/apimachinery v0.26.5
k8s.io/client-go v0.26.5
k8s.io/klog/v2 v2.100.1
sigs.k8s.io/controller-runtime v0.14.6
sigs.k8s.io/kustomize/kyaml v0.14.2
github.com/spf13/viper v1.19.0
go.uber.org/zap v1.27.0
gomodules.xyz/jsonpatch/v2 v2.4.0
k8s.io/api v0.30.3
k8s.io/apimachinery v0.30.3
k8s.io/client-go v0.30.3
k8s.io/klog/v2 v2.130.1
sigs.k8s.io/controller-runtime v0.18.4
sigs.k8s.io/kustomize/kyaml v0.17.2
)

require (
cloud.google.com/go/compute v1.19.0 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
github.com/Azure/azure-sdk-for-go v67.0.0+incompatible // indirect
cloud.google.com/go/compute/metadata v0.5.0 // indirect
github.com/Azure/azure-sdk-for-go v68.0.0+incompatible // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.11.28 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.21 // indirect
github.com/Azure/go-autorest/autorest/azure/auth v0.5.11 // indirect
github.com/Azure/go-autorest/autorest v0.11.29 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.24 // indirect
github.com/Azure/go-autorest/autorest/azure/auth v0.5.13 // indirect
github.com/Azure/go-autorest/autorest/azure/cli v0.4.6 // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
github.com/aws/aws-sdk-go-v2 v1.16.16 // indirect
github.com/aws/aws-sdk-go-v2/config v1.17.8 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.12.21 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.17 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.23 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.17 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.24 // indirect
github.com/aws/aws-sdk-go-v2/service/ecr v1.17.18 // indirect
github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.13.17 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.17 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.11.23 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.6 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.16.19 // indirect
github.com/aws/smithy-go v1.13.3 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/aws/aws-sdk-go-v2 v1.30.3 // indirect
github.com/aws/aws-sdk-go-v2/config v1.27.27 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.17.27 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect
github.com/aws/aws-sdk-go-v2/service/ecr v1.32.0 // indirect
github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.25.3 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.22.4 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.30.3 // indirect
github.com/aws/smithy-go v1.20.3 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.15.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/dimchansky/utfbom v1.1.1 // indirect
github.com/docker/cli v23.0.1+incompatible // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect
github.com/docker/docker v23.0.1+incompatible // indirect
github.com/docker/docker-credential-helpers v0.7.0 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-errors/errors v1.4.2 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.1 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/docker/cli v27.1.1+incompatible // indirect
github.com/docker/distribution v2.8.3+incompatible // indirect
github.com/docker/docker-credential-helpers v0.8.2 // indirect
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
github.com/evanphx/json-patch v5.9.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-errors/errors v1.5.1 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.4.2 // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic v0.6.9 // indirect
github.com/google/go-containerregistry/pkg/authn/kubernetes v0.0.0-20221017135236-9b4fdd506cdd // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect
github.com/google/go-containerregistry/pkg/authn/kubernetes v0.0.0-20240810014151-b8e87ed57b80 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.2.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.16.0 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0-rc2 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/vbatts/tar-split v0.11.2 // indirect
github.com/xlab/treeprint v1.1.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/oauth2 v0.7.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/term v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.30.0 // indirect
github.com/prometheus/client_golang v1.19.1 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/sagikazarmark/locafero v0.6.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.7.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/vbatts/tar-split v0.11.5 // indirect
github.com/xlab/treeprint v1.2.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/oauth2 v0.22.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/term v0.23.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/time v0.6.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.26.1 // indirect
k8s.io/component-base v0.26.1 // indirect
k8s.io/kube-openapi v0.0.0-20230109183929-3758b55a6596 // indirect
k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
k8s.io/apiextensions-apiserver v0.30.3 // indirect
k8s.io/kube-openapi v0.0.0-20240808142205-8e686545bdb8 // indirect
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
Loading

0 comments on commit a893c8e

Please sign in to comment.