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

Upgrade knative -> 0.18 #3319

Merged
merged 8 commits into from
Oct 6, 2020
Merged
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
  •  
  •  
  •  
26 changes: 14 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ module github.com/tektoncd/pipeline
go 1.13

require (
cloud.google.com/go/storage v1.11.0 // indirect
github.com/GoogleCloudPlatform/cloud-builders/gcs-fetcher v0.0.0-20191203181535-308b93ad1f39
github.com/cloudevents/sdk-go/v2 v2.1.0
github.com/ghodss/yaml v1.0.0
github.com/google/go-cmp v0.5.2
github.com/google/go-containerregistry v0.1.2
github.com/google/go-containerregistry v0.1.3
github.com/google/uuid v1.1.1
github.com/hashicorp/go-multierror v1.1.0
github.com/hashicorp/golang-lru v0.5.4
Expand All @@ -17,30 +18,31 @@ require (
github.com/tektoncd/plumbing v0.0.0-20200430135134-e53521e1d887
go.opencensus.io v0.22.4
go.uber.org/zap v1.15.0
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a // indirect
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
gomodules.xyz/jsonpatch/v2 v2.1.0
k8s.io/api v0.18.7-rc.0
k8s.io/api v0.18.8
k8s.io/apimachinery v0.19.0
k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible
k8s.io/code-generator v0.18.6
k8s.io/code-generator v0.18.8
k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29
knative.dev/pkg v0.0.0-20200831162708-14fb2347fb77
knative.dev/pkg v0.0.0-20200922164940-4bf40ad82aab
)

// Knative deps (release-0.16)
// Knative deps (release-0.18)
replace (
contrib.go.opencensus.io/exporter/stackdriver => contrib.go.opencensus.io/exporter/stackdriver v0.12.9-0.20191108183826-59d068f8d8ff
github.com/Azure/azure-sdk-for-go => github.com/Azure/azure-sdk-for-go v38.2.0+incompatible
github.com/Azure/go-autorest => github.com/Azure/go-autorest v13.4.0+incompatible
)

// Pin k8s deps to 1.17.6
// Pin k8s deps to v0.18.8
replace (
k8s.io/api => k8s.io/api v0.17.6
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.17.6
k8s.io/apimachinery => k8s.io/apimachinery v0.17.6
k8s.io/apiserver => k8s.io/apiserver v0.17.6
k8s.io/client-go => k8s.io/client-go v0.17.6
k8s.io/code-generator => k8s.io/code-generator v0.17.6
k8s.io/api => k8s.io/api v0.18.8
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.18.8
k8s.io/apimachinery => k8s.io/apimachinery v0.18.8
k8s.io/apiserver => k8s.io/apiserver v0.18.8
k8s.io/client-go => k8s.io/client-go v0.18.8
k8s.io/code-generator => k8s.io/code-generator v0.18.8
k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29
)
97 changes: 55 additions & 42 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion hack/update-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ source $(git rev-parse --show-toplevel)/vendor/github.com/tektoncd/plumbing/scri

cd ${REPO_ROOT_DIR}

VERSION="release-0.17"
VERSION="release-0.18"

# The list of dependencies that we track at HEAD and periodically
# float forward in this repository.
Expand Down
6 changes: 3 additions & 3 deletions pkg/artifacts/artifact_storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ func TestInitializeArtifactStorage(t *testing.T) {
}
// If the expected storage type is PVC, make sure we're actually creating that PVC.
if c.storagetype == "pvc" {
_, err := fakekubeclient.CoreV1().PersistentVolumeClaims(pipelinerun.Namespace).Get(GetPVCName(pipelinerun), metav1.GetOptions{})
_, err := fakekubeclient.CoreV1().PersistentVolumeClaims(pipelinerun.Namespace).Get(ctx, GetPVCName(pipelinerun), metav1.GetOptions{})
if err != nil {
t.Fatalf("Error getting expected PVC %s for PipelineRun %s: %s", GetPVCName(pipelinerun), pipelinerun.Name, err)
}
Expand Down Expand Up @@ -456,14 +456,14 @@ func TestCleanupArtifactStorage(t *testing.T) {
ArtifactBucket: ab,
}
ctx := config.ToContext(context.Background(), &configs)
_, err = fakekubeclient.CoreV1().PersistentVolumeClaims(pipelinerun.Namespace).Get(GetPVCName(pipelinerun), metav1.GetOptions{})
_, err = fakekubeclient.CoreV1().PersistentVolumeClaims(pipelinerun.Namespace).Get(ctx, GetPVCName(pipelinerun), metav1.GetOptions{})
if err != nil {
t.Fatalf("Error getting expected PVC %s for PipelineRun %s: %s", GetPVCName(pipelinerun), pipelinerun.Name, err)
}
if err := CleanupArtifactStorage(ctx, pipelinerun, fakekubeclient); err != nil {
t.Fatalf("Error cleaning up artifact storage: %s", err)
}
_, err = fakekubeclient.CoreV1().PersistentVolumeClaims(pipelinerun.Namespace).Get(GetPVCName(pipelinerun), metav1.GetOptions{})
_, err = fakekubeclient.CoreV1().PersistentVolumeClaims(pipelinerun.Namespace).Get(ctx, GetPVCName(pipelinerun), metav1.GetOptions{})
if err == nil {
t.Fatalf("Found PVC %s for PipelineRun %s after it should have been cleaned up", GetPVCName(pipelinerun), pipelinerun.Name)
} else if !errors.IsNotFound(err) {
Expand Down
12 changes: 6 additions & 6 deletions pkg/artifacts/artifacts_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func InitializeArtifactStorage(ctx context.Context, images pipeline.Images, pr *
func CleanupArtifactStorage(ctx context.Context, pr *v1beta1.PipelineRun, c kubernetes.Interface) error {

if NeedsPVC(ctx) {
err := deletePVC(pr, c)
err := deletePVC(ctx, pr, c)
if err != nil {
return err
}
Expand Down Expand Up @@ -171,7 +171,7 @@ func NewArtifactBucketFromConfig(ctx context.Context, images pipeline.Images) *s
}

func createPVC(ctx context.Context, pr *v1beta1.PipelineRun, c kubernetes.Interface) (*corev1.PersistentVolumeClaim, error) {
if _, err := c.CoreV1().PersistentVolumeClaims(pr.Namespace).Get(GetPVCName(pr), metav1.GetOptions{}); err != nil {
if _, err := c.CoreV1().PersistentVolumeClaims(pr.Namespace).Get(ctx, GetPVCName(pr), metav1.GetOptions{}); err != nil {
if errors.IsNotFound(err) {
pvcConfig := config.FromContextOrDefaults(ctx).ArtifactPVC
pvcSize, err := resource.ParseQuantity(pvcConfig.Size)
Expand All @@ -192,7 +192,7 @@ func createPVC(ctx context.Context, pr *v1beta1.PipelineRun, c kubernetes.Interf
}

pvcSpec := GetPVCSpec(pr, pvcSize, pvcStorageClassName)
pvc, err := c.CoreV1().PersistentVolumeClaims(pr.Namespace).Create(pvcSpec)
pvc, err := c.CoreV1().PersistentVolumeClaims(pr.Namespace).Create(ctx, pvcSpec, metav1.CreateOptions{})
if err != nil {
return nil, fmt.Errorf("failed to claim Persistent Volume %q due to error: %w", pr.Name, err)
}
Expand All @@ -203,12 +203,12 @@ func createPVC(ctx context.Context, pr *v1beta1.PipelineRun, c kubernetes.Interf
return nil, nil
}

func deletePVC(pr *v1beta1.PipelineRun, c kubernetes.Interface) error {
if _, err := c.CoreV1().PersistentVolumeClaims(pr.Namespace).Get(GetPVCName(pr), metav1.GetOptions{}); err != nil {
func deletePVC(ctx context.Context, pr *v1beta1.PipelineRun, c kubernetes.Interface) error {
if _, err := c.CoreV1().PersistentVolumeClaims(pr.Namespace).Get(ctx, GetPVCName(pr), metav1.GetOptions{}); err != nil {
if !errors.IsNotFound(err) {
return fmt.Errorf("failed to get Persistent Volume %q due to error: %w", GetPVCName(pr), err)
}
} else if err := c.CoreV1().PersistentVolumeClaims(pr.Namespace).Delete(GetPVCName(pr), &metav1.DeleteOptions{}); err != nil {
} else if err := c.CoreV1().PersistentVolumeClaims(pr.Namespace).Delete(ctx, GetPVCName(pr), metav1.DeleteOptions{}); err != nil {
return fmt.Errorf("failed to delete Persistent Volume %q due to error: %w", pr.Name, err)
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/clientset/versioned/clientset.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading