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

Fix for the push pipeline #265

Merged
merged 1 commit into from
Sep 24, 2024
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .tekton/cosign-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ spec:
value: quay.io/redhat-appstudio-tekton-catalog/task-prefetch-dependencies-oci-ta:0.1@sha256:57979e1c289bfe09acb70401f35558a9032e749b398a43fea049c044f9d96afe
- name: kind
value: task
resolver: bundles<<<<<<< unit_tests_on_tas_pipeline_v2
resolver: bundles
- name: build-container
params:
- name: IMAGE
Expand Down
47 changes: 7 additions & 40 deletions test/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ import (
"bytes"
"context"
"crypto"
"crypto/rand"
"crypto/sha256"
"crypto/x509"
"encoding/base64"
"encoding/json"
"encoding/pem"
"fmt"
"io"
"net/http"
Expand Down Expand Up @@ -55,6 +60,8 @@ import (
"github.com/sigstore/cosign/v2/cmd/cosign/cli/sign"
cliverify "github.com/sigstore/cosign/v2/cmd/cosign/cli/verify"
"github.com/sigstore/cosign/v2/internal/pkg/cosign/fulcio/fulcioroots"
"github.com/sigstore/cosign/v2/internal/pkg/cosign/tsa"
"github.com/sigstore/cosign/v2/internal/pkg/cosign/tsa/client"
"github.com/sigstore/cosign/v2/pkg/cosign"
"github.com/sigstore/cosign/v2/pkg/cosign/bundle"
"github.com/sigstore/cosign/v2/pkg/cosign/env"
Expand Down Expand Up @@ -2548,43 +2555,3 @@ func getOIDCToken() (string, error) {
}
return string(body), nil
}
<<<<<<< HEAD

func setLocalEnv(t *testing.T, dir string) error {
// fulcio repo is downloaded to the user's home directory by e2e_test.sh
home, err := os.UserHomeDir()
if err != nil {
return fmt.Errorf("error getting home directory: %w", err)
}
t.Setenv(env.VariableSigstoreCTLogPublicKeyFile.String(), path.Join(home, "fulcio/config/ctfe/pubkey.pem"))
err = downloadAndSetEnv(t, fulcioURL+"/api/v1/rootCert", env.VariableSigstoreRootFile.String(), dir)
if err != nil {
return fmt.Errorf("error setting %s env var: %w", env.VariableSigstoreRootFile.String(), err)
}
err = downloadAndSetEnv(t, rekorURL+"/api/v1/log/publicKey", env.VariableSigstoreRekorPublicKey.String(), dir)
if err != nil {
return fmt.Errorf("error setting %s env var: %w", env.VariableSigstoreRekorPublicKey.String(), err)
}
return nil
}

func downloadAndSetEnv(t *testing.T, url, envVar, dir string) error {
resp, err := http.Get(url)
if err != nil {
return fmt.Errorf("error downloading file: %w", err)
}
defer resp.Body.Close()
f, err := os.CreateTemp(dir, "")
if err != nil {
return fmt.Errorf("error creating temp file: %w", err)
}
defer f.Close()
_, err = io.Copy(f, resp.Body)
if err != nil {
return fmt.Errorf("error writing to file: %w", err)
}
t.Setenv(envVar, f.Name())
return nil
}
=======
>>>>>>> v2.4.0
Loading