Skip to content

Commit f9de167

Browse files
authored
Merge pull request #44 from github/bdehamer/convert-sigstorekeys-to-protobuf
Fixes for CI checks
2 parents d28ef98 + 6efe74e commit f9de167

File tree

25 files changed

+483
-47
lines changed

25 files changed

+483
-47
lines changed

.github/workflows/build.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
check-latest: true
4444

4545
# will use the latest release available for ko
46-
- uses: imjasonh/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6
46+
- uses: ko-build/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6
4747

4848
- uses: chainguard-dev/actions/goimports@dacf41f3472c33979cfd49bca5b503236be57de0 # main
4949

.github/workflows/kind-cluster-image-policy-no-tuf.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
check-latest: true
101101

102102
# will use the latest release available for ko
103-
- uses: imjasonh/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6
103+
- uses: ko-build/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6
104104

105105
- uses: imranismail/setup-kustomize@2ba527d4d055ab63514ba50a99456fc35684947f # v2.1.0
106106

.github/workflows/kind-cluster-image-policy-resync-period.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
check-latest: true
101101

102102
# will use the latest release available for ko
103-
- uses: imjasonh/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6
103+
- uses: ko-build/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6
104104

105105
- uses: imranismail/setup-kustomize@2ba527d4d055ab63514ba50a99456fc35684947f # v2.1.0
106106

.github/workflows/kind-cluster-image-policy-trustroot.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ jobs:
105105
check-latest: true
106106

107107
# will use the latest release available for ko
108-
- uses: imjasonh/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6
108+
- uses: ko-build/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6
109109

110110
- uses: imranismail/setup-kustomize@2ba527d4d055ab63514ba50a99456fc35684947f # v2.1.0
111111

.github/workflows/kind-cluster-image-policy-tsa.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
check-latest: true
101101

102102
# will use the latest release available for ko
103-
- uses: imjasonh/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6
103+
- uses: ko-build/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6
104104

105105
- uses: imranismail/setup-kustomize@2ba527d4d055ab63514ba50a99456fc35684947f # v2.1.0
106106

.github/workflows/kind-cluster-image-policy.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ jobs:
114114
check-latest: true
115115

116116
# will use the latest release available for ko
117-
- uses: imjasonh/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6
117+
- uses: ko-build/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6
118118

119119
- uses: imranismail/setup-kustomize@2ba527d4d055ab63514ba50a99456fc35684947f # v2.1.0
120120

.github/workflows/kind-e2e-cosigned.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
go-version-file: './go.mod'
9999
check-latest: true
100100

101-
- uses: imjasonh/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6
101+
- uses: ko-build/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6
102102

103103
- uses: imranismail/setup-kustomize@2ba527d4d055ab63514ba50a99456fc35684947f # v2.1.0
104104

.github/workflows/kind-e2e-trustroot-crd.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
go-version-file: './go.mod'
9999
check-latest: true
100100

101-
- uses: imjasonh/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6
101+
- uses: ko-build/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6
102102

103103
- uses: imranismail/setup-kustomize@2ba527d4d055ab63514ba50a99456fc35684947f # v2.1.0
104104

go.mod

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ module github.com/sigstore/policy-controller
22

33
go 1.21
44

5-
toolchain go1.21.1
6-
75
require (
86
github.com/aws/aws-sdk-go v1.51.1
97
github.com/aws/aws-sdk-go-v2 v1.25.2 // indirect

hack/gentestdata/gentestdata.go

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
// Copyright 2022 The Sigstore Authors.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
115
package main
216

317
// This is a simple program to convert the testdata.SigstoreKeys map into a

pkg/apis/config/sigstore_keys.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ type SigstoreKeys = pbtrustroot.TrustedRoot
5151
type CertificateAuthority = pbtrustroot.CertificateAuthority
5252
type TransparencyLogInstance = pbtrustroot.TransparencyLogInstance
5353
type DistinguishedName = pbcommon.DistinguishedName
54-
type LogId = pbcommon.LogId
54+
type LogID = pbcommon.LogId
5555
type TimeRange = pbcommon.TimeRange
5656
type Timestamp = timestamppb.Timestamp
5757

pkg/client/injection/informers/factory/filtered/fake/fake_filtered_factory.go

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/client/injection/informers/factory/filtered/filtered_factory.go

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/client/injection/reconciler/policy/v1alpha1/clusterimagepolicy/reconciler.go

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/client/injection/reconciler/policy/v1alpha1/trustroot/reconciler.go

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/client/injection/reconciler/policy/v1beta1/clusterimagepolicy/reconciler.go

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/reconciler/trustroot/testdata/testdata.go

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
// Copyright 2022 The Sigstore Authors.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
115
package testdata
216

317
import (

pkg/reconciler/trustroot/trustroot.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ func (r *Reconciler) ReconcileKind(ctx context.Context, trustroot *v1alpha1.Trus
9696
if !ok {
9797
return fmt.Errorf("public key %d is not ecdsa.PublicKey", i)
9898
}
99-
sigstoreKeys.Tlogs[i].LogId = &config.LogId{KeyId: []byte(logID)}
99+
sigstoreKeys.Tlogs[i].LogId = &config.LogID{KeyId: []byte(logID)}
100100
}
101101
for i, ctlog := range sigstoreKeys.Ctlogs {
102102
_, logID, err := pemToKeyAndID(config.SerializePublicKey(ctlog.PublicKey))
103103
if err != nil {
104104
return fmt.Errorf("invalid ctlog public key %d: %w", i, err)
105105
}
106-
sigstoreKeys.Ctlogs[i].LogId = &config.LogId{KeyId: []byte(logID)}
106+
sigstoreKeys.Ctlogs[i].LogId = &config.LogID{KeyId: []byte(logID)}
107107
}
108108

109109
// See if the CM holding configs exists

pkg/reconciler/trustroot/trustroot_test.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -376,11 +376,10 @@ func makeConfigMapWithSigstoreKeys() *corev1.ConfigMap {
376376
source := NewTrustRoot(trName, WithSigstoreKeys(testdata.SigstoreKeys))
377377
c := config.ConvertSigstoreKeys(context.Background(), source.Spec.SigstoreKeys)
378378
for i := range c.Tlogs {
379-
c.Tlogs[i].LogId = &config.LogId{KeyId: []byte(rekorLogID)}
380-
379+
c.Tlogs[i].LogId = &config.LogID{KeyId: []byte(rekorLogID)}
381380
}
382381
for i := range c.Ctlogs {
383-
c.Ctlogs[i].LogId = &config.LogId{KeyId: []byte(ctfeLogID)}
382+
c.Ctlogs[i].LogId = &config.LogID{KeyId: []byte(ctfeLogID)}
384383
}
385384
marshalled, err := resources.Marshal(c)
386385
if err != nil {

pkg/webhook/validator_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -2963,7 +2963,7 @@ func TestFulcioCertsFromAuthority(t *testing.T) {
29632963
CertChain: config.DeserializeCertChain([]byte(certChain)),
29642964
}},
29652965
Ctlogs: []*config.TransparencyLogInstance{{
2966-
LogId: &config.LogId{KeyId: []byte(ctfeLogID)},
2966+
LogId: &config.LogID{KeyId: []byte(ctfeLogID)},
29672967
PublicKey: pbpk,
29682968
}},
29692969
}
@@ -3071,7 +3071,7 @@ func TestRekorClientAndKeysFromAuthority(t *testing.T) {
30713071
sk := config.SigstoreKeys{
30723072
Tlogs: []*config.TransparencyLogInstance{{
30733073
PublicKey: pbpk,
3074-
LogId: &config.LogId{KeyId: []byte(rekorLogID)},
3074+
LogId: &config.LogID{KeyId: []byte(rekorLogID)},
30753075
BaseUrl: "rekor.example.com",
30763076
}},
30773077
}
@@ -3214,7 +3214,7 @@ func TestCheckOptsFromAuthority(t *testing.T) {
32143214
skRekor := config.SigstoreKeys{
32153215
Tlogs: []*config.TransparencyLogInstance{{
32163216
PublicKey: pbpkRekor,
3217-
LogId: &config.LogId{KeyId: []byte("rekor-logid")},
3217+
LogId: &config.LogID{KeyId: []byte("rekor-logid")},
32183218
BaseUrl: "rekor.example.com",
32193219
}},
32203220
}
@@ -3227,14 +3227,14 @@ func TestCheckOptsFromAuthority(t *testing.T) {
32273227
CertChain: config.DeserializeCertChain([]byte(certChain)),
32283228
}},
32293229
Ctlogs: []*config.TransparencyLogInstance{{
3230-
LogId: &config.LogId{KeyId: []byte(ctfeLogID)},
3230+
LogId: &config.LogID{KeyId: []byte(ctfeLogID)},
32313231
PublicKey: pbpkCTFE,
32323232
}},
32333233
}
32343234
skCombined := config.SigstoreKeys{
32353235
Tlogs: []*config.TransparencyLogInstance{{
32363236
PublicKey: pbpkRekor,
3237-
LogId: &config.LogId{KeyId: []byte("rekor-logid")},
3237+
LogId: &config.LogID{KeyId: []byte("rekor-logid")},
32383238
BaseUrl: "rekor.example.com",
32393239
}},
32403240
CertificateAuthorities: []*config.CertificateAuthority{{
@@ -3245,7 +3245,7 @@ func TestCheckOptsFromAuthority(t *testing.T) {
32453245
CertChain: config.DeserializeCertChain([]byte(certChain)),
32463246
}},
32473247
Ctlogs: []*config.TransparencyLogInstance{{
3248-
LogId: &config.LogId{KeyId: []byte(ctfeLogID)},
3248+
LogId: &config.LogID{KeyId: []byte(ctfeLogID)},
32493249
PublicKey: pbpkCTFE,
32503250
}},
32513251
}

0 commit comments

Comments
 (0)