Skip to content

Commit

Permalink
Merge pull request #265 from securesign/tdalton/pushpipelineFix
Browse files Browse the repository at this point in the history
Fix for the push pipeline
  • Loading branch information
tommyd450 authored Sep 24, 2024
2 parents 104807a + c9cd349 commit 673f9e1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 41 deletions.
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

0 comments on commit 673f9e1

Please sign in to comment.