Skip to content

Commit

Permalink
Merge branch 'main' into SECURESIGN-1044
Browse files Browse the repository at this point in the history
  • Loading branch information
osmman authored Jul 25, 2024
2 parents 5ed84a6 + ad9da1d commit 05897d3
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 94 deletions.
14 changes: 5 additions & 9 deletions .tekton/rhtas-operator-bundle-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ spec:
- name: name
value: init
- name: bundle
value: quay.io/redhat-appstudio-tekton-catalog/task-init:0.2@sha256:61f1202766cd66242c8472b16aa7fa1a20f8d9a5d674cbad27ffd4b3d067e936
value: quay.io/redhat-appstudio-tekton-catalog/task-init:0.2@sha256:596b7c11572bb94eb67d9ffb4375068426e2a8249ff2792ce04ad2a4bc593a63
- name: kind
value: task
resolver: bundles
Expand Down Expand Up @@ -190,7 +190,7 @@ spec:
- name: name
value: prefetch-dependencies
- name: bundle
value: quay.io/redhat-appstudio-tekton-catalog/task-prefetch-dependencies:0.1@sha256:fc03e91c047948f1e4906a82a7ad43c3ca35e66c9468c180f405e08affa73bbf
value: quay.io/redhat-appstudio-tekton-catalog/task-prefetch-dependencies:0.1@sha256:66f0dd9f20f4dc1ab9374523d5e8acd721c622edc241153f0e79cf6d8c122d98
- name: kind
value: task
resolver: bundles
Expand Down Expand Up @@ -225,7 +225,7 @@ spec:
- name: name
value: buildah
- name: bundle
value: quay.io/redhat-appstudio-tekton-catalog/task-buildah:0.1@sha256:231d49db42729dece0fae11180b619cca55540d5b9f1679d06eb4416c199238c
value: quay.io/redhat-appstudio-tekton-catalog/task-buildah:0.2@sha256:24f21fdeaf9651abdcd8a49206b0e7fe4015b5216e5cfa7762f2185ed2edda32
- name: kind
value: task
resolver: bundles
Expand All @@ -241,16 +241,14 @@ spec:
params:
- name: BINARY_IMAGE
value: $(params.output-image)
- name: BASE_IMAGES
value: $(tasks.build-container.results.BASE_IMAGES_DIGESTS)
runAfter:
- build-container
taskRef:
params:
- name: name
value: source-build
- name: bundle
value: quay.io/redhat-appstudio-tekton-catalog/task-source-build:0.1@sha256:6e738fbec2ff670b98e2442cde19c8b1234efd96eca557c0b0103ff2021708e8
value: quay.io/redhat-appstudio-tekton-catalog/task-source-build:0.1@sha256:929bf55a5e364c957a5f907a5516fb8f8893c389ae5985767de7311736eb904a
- name: kind
value: task
resolver: bundles
Expand All @@ -268,8 +266,6 @@ spec:
workspace: workspace
- name: deprecated-base-image-check
params:
- name: BASE_IMAGES_DIGESTS
value: $(tasks.build-container.results.BASE_IMAGES_DIGESTS)
- name: IMAGE_URL
value: $(tasks.build-container.results.IMAGE_URL)
- name: IMAGE_DIGEST
Expand Down Expand Up @@ -344,7 +340,7 @@ spec:
- name: name
value: ecosystem-cert-preflight-checks
- name: bundle
value: quay.io/konflux-ci/tekton-catalog/task-ecosystem-cert-preflight-checks:0.1@sha256:8838d3e1628dbe61f4851b3640d2e3a9a3079d3ff3da955f4a3e4c2c95a013df
value: quay.io/konflux-ci/tekton-catalog/task-ecosystem-cert-preflight-checks:0.1@sha256:f0b2ee5d02fdff0ea32af13e26f481f6b66bddfc1357cf171b8e7525a38f09d4
- name: kind
value: task
resolver: bundles
Expand Down
14 changes: 5 additions & 9 deletions .tekton/rhtas-operator-bundle-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ spec:
- name: name
value: init
- name: bundle
value: quay.io/redhat-appstudio-tekton-catalog/task-init:0.2@sha256:61f1202766cd66242c8472b16aa7fa1a20f8d9a5d674cbad27ffd4b3d067e936
value: quay.io/redhat-appstudio-tekton-catalog/task-init:0.2@sha256:596b7c11572bb94eb67d9ffb4375068426e2a8249ff2792ce04ad2a4bc593a63
- name: kind
value: task
resolver: bundles
Expand Down Expand Up @@ -188,7 +188,7 @@ spec:
- name: name
value: prefetch-dependencies
- name: bundle
value: quay.io/redhat-appstudio-tekton-catalog/task-prefetch-dependencies:0.1@sha256:fc03e91c047948f1e4906a82a7ad43c3ca35e66c9468c180f405e08affa73bbf
value: quay.io/redhat-appstudio-tekton-catalog/task-prefetch-dependencies:0.1@sha256:66f0dd9f20f4dc1ab9374523d5e8acd721c622edc241153f0e79cf6d8c122d98
- name: kind
value: task
resolver: bundles
Expand Down Expand Up @@ -223,7 +223,7 @@ spec:
- name: name
value: buildah
- name: bundle
value: quay.io/redhat-appstudio-tekton-catalog/task-buildah:0.1@sha256:231d49db42729dece0fae11180b619cca55540d5b9f1679d06eb4416c199238c
value: quay.io/redhat-appstudio-tekton-catalog/task-buildah:0.2@sha256:24f21fdeaf9651abdcd8a49206b0e7fe4015b5216e5cfa7762f2185ed2edda32
- name: kind
value: task
resolver: bundles
Expand All @@ -239,16 +239,14 @@ spec:
params:
- name: BINARY_IMAGE
value: $(params.output-image)
- name: BASE_IMAGES
value: $(tasks.build-container.results.BASE_IMAGES_DIGESTS)
runAfter:
- build-container
taskRef:
params:
- name: name
value: source-build
- name: bundle
value: quay.io/redhat-appstudio-tekton-catalog/task-source-build:0.1@sha256:6e738fbec2ff670b98e2442cde19c8b1234efd96eca557c0b0103ff2021708e8
value: quay.io/redhat-appstudio-tekton-catalog/task-source-build:0.1@sha256:929bf55a5e364c957a5f907a5516fb8f8893c389ae5985767de7311736eb904a
- name: kind
value: task
resolver: bundles
Expand All @@ -266,8 +264,6 @@ spec:
workspace: workspace
- name: deprecated-base-image-check
params:
- name: BASE_IMAGES_DIGESTS
value: $(tasks.build-container.results.BASE_IMAGES_DIGESTS)
- name: IMAGE_URL
value: $(tasks.build-container.results.IMAGE_URL)
- name: IMAGE_DIGEST
Expand Down Expand Up @@ -342,7 +338,7 @@ spec:
- name: name
value: ecosystem-cert-preflight-checks
- name: bundle
value: quay.io/konflux-ci/tekton-catalog/task-ecosystem-cert-preflight-checks:0.1@sha256:8838d3e1628dbe61f4851b3640d2e3a9a3079d3ff3da955f4a3e4c2c95a013df
value: quay.io/konflux-ci/tekton-catalog/task-ecosystem-cert-preflight-checks:0.1@sha256:f0b2ee5d02fdff0ea32af13e26f481f6b66bddfc1357cf171b8e7525a38f09d4
- name: kind
value: task
resolver: bundles
Expand Down
14 changes: 5 additions & 9 deletions .tekton/rhtas-operator-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ spec:
- name: name
value: init
- name: bundle
value: quay.io/redhat-appstudio-tekton-catalog/task-init:0.2@sha256:61f1202766cd66242c8472b16aa7fa1a20f8d9a5d674cbad27ffd4b3d067e936
value: quay.io/redhat-appstudio-tekton-catalog/task-init:0.2@sha256:596b7c11572bb94eb67d9ffb4375068426e2a8249ff2792ce04ad2a4bc593a63
- name: kind
value: task
resolver: bundles
Expand Down Expand Up @@ -191,7 +191,7 @@ spec:
- name: name
value: prefetch-dependencies
- name: bundle
value: quay.io/redhat-appstudio-tekton-catalog/task-prefetch-dependencies:0.1@sha256:fc03e91c047948f1e4906a82a7ad43c3ca35e66c9468c180f405e08affa73bbf
value: quay.io/redhat-appstudio-tekton-catalog/task-prefetch-dependencies:0.1@sha256:66f0dd9f20f4dc1ab9374523d5e8acd721c622edc241153f0e79cf6d8c122d98
- name: kind
value: task
resolver: bundles
Expand Down Expand Up @@ -226,7 +226,7 @@ spec:
- name: name
value: buildah
- name: bundle
value: quay.io/redhat-appstudio-tekton-catalog/task-buildah:0.1@sha256:231d49db42729dece0fae11180b619cca55540d5b9f1679d06eb4416c199238c
value: quay.io/redhat-appstudio-tekton-catalog/task-buildah:0.2@sha256:24f21fdeaf9651abdcd8a49206b0e7fe4015b5216e5cfa7762f2185ed2edda32
- name: kind
value: task
resolver: bundles
Expand All @@ -242,16 +242,14 @@ spec:
params:
- name: BINARY_IMAGE
value: $(params.output-image)
- name: BASE_IMAGES
value: $(tasks.build-container.results.BASE_IMAGES_DIGESTS)
runAfter:
- build-container
taskRef:
params:
- name: name
value: source-build
- name: bundle
value: quay.io/redhat-appstudio-tekton-catalog/task-source-build:0.1@sha256:6e738fbec2ff670b98e2442cde19c8b1234efd96eca557c0b0103ff2021708e8
value: quay.io/redhat-appstudio-tekton-catalog/task-source-build:0.1@sha256:929bf55a5e364c957a5f907a5516fb8f8893c389ae5985767de7311736eb904a
- name: kind
value: task
resolver: bundles
Expand All @@ -269,8 +267,6 @@ spec:
workspace: workspace
- name: deprecated-base-image-check
params:
- name: BASE_IMAGES_DIGESTS
value: $(tasks.build-container.results.BASE_IMAGES_DIGESTS)
- name: IMAGE_URL
value: $(tasks.build-container.results.IMAGE_URL)
- name: IMAGE_DIGEST
Expand Down Expand Up @@ -345,7 +341,7 @@ spec:
- name: name
value: ecosystem-cert-preflight-checks
- name: bundle
value: quay.io/konflux-ci/tekton-catalog/task-ecosystem-cert-preflight-checks:0.1@sha256:8838d3e1628dbe61f4851b3640d2e3a9a3079d3ff3da955f4a3e4c2c95a013df
value: quay.io/konflux-ci/tekton-catalog/task-ecosystem-cert-preflight-checks:0.1@sha256:f0b2ee5d02fdff0ea32af13e26f481f6b66bddfc1357cf171b8e7525a38f09d4
- name: kind
value: task
resolver: bundles
Expand Down
14 changes: 5 additions & 9 deletions .tekton/rhtas-operator-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ spec:
- name: name
value: init
- name: bundle
value: quay.io/redhat-appstudio-tekton-catalog/task-init:0.2@sha256:61f1202766cd66242c8472b16aa7fa1a20f8d9a5d674cbad27ffd4b3d067e936
value: quay.io/redhat-appstudio-tekton-catalog/task-init:0.2@sha256:596b7c11572bb94eb67d9ffb4375068426e2a8249ff2792ce04ad2a4bc593a63
- name: kind
value: task
resolver: bundles
Expand Down Expand Up @@ -189,7 +189,7 @@ spec:
- name: name
value: prefetch-dependencies
- name: bundle
value: quay.io/redhat-appstudio-tekton-catalog/task-prefetch-dependencies:0.1@sha256:fc03e91c047948f1e4906a82a7ad43c3ca35e66c9468c180f405e08affa73bbf
value: quay.io/redhat-appstudio-tekton-catalog/task-prefetch-dependencies:0.1@sha256:66f0dd9f20f4dc1ab9374523d5e8acd721c622edc241153f0e79cf6d8c122d98
- name: kind
value: task
resolver: bundles
Expand Down Expand Up @@ -224,7 +224,7 @@ spec:
- name: name
value: buildah
- name: bundle
value: quay.io/redhat-appstudio-tekton-catalog/task-buildah:0.1@sha256:231d49db42729dece0fae11180b619cca55540d5b9f1679d06eb4416c199238c
value: quay.io/redhat-appstudio-tekton-catalog/task-buildah:0.2@sha256:24f21fdeaf9651abdcd8a49206b0e7fe4015b5216e5cfa7762f2185ed2edda32
- name: kind
value: task
resolver: bundles
Expand All @@ -240,16 +240,14 @@ spec:
params:
- name: BINARY_IMAGE
value: $(params.output-image)
- name: BASE_IMAGES
value: $(tasks.build-container.results.BASE_IMAGES_DIGESTS)
runAfter:
- build-container
taskRef:
params:
- name: name
value: source-build
- name: bundle
value: quay.io/redhat-appstudio-tekton-catalog/task-source-build:0.1@sha256:6e738fbec2ff670b98e2442cde19c8b1234efd96eca557c0b0103ff2021708e8
value: quay.io/redhat-appstudio-tekton-catalog/task-source-build:0.1@sha256:929bf55a5e364c957a5f907a5516fb8f8893c389ae5985767de7311736eb904a
- name: kind
value: task
resolver: bundles
Expand All @@ -267,8 +265,6 @@ spec:
workspace: workspace
- name: deprecated-base-image-check
params:
- name: BASE_IMAGES_DIGESTS
value: $(tasks.build-container.results.BASE_IMAGES_DIGESTS)
- name: IMAGE_URL
value: $(tasks.build-container.results.IMAGE_URL)
- name: IMAGE_DIGEST
Expand Down Expand Up @@ -343,7 +339,7 @@ spec:
- name: name
value: ecosystem-cert-preflight-checks
- name: bundle
value: quay.io/konflux-ci/tekton-catalog/task-ecosystem-cert-preflight-checks:0.1@sha256:8838d3e1628dbe61f4851b3640d2e3a9a3079d3ff3da955f4a3e4c2c95a013df
value: quay.io/konflux-ci/tekton-catalog/task-ecosystem-cert-preflight-checks:0.1@sha256:f0b2ee5d02fdff0ea32af13e26f481f6b66bddfc1357cf171b8e7525a38f09d4
- name: kind
value: task
resolver: bundles
Expand Down
6 changes: 1 addition & 5 deletions internal/controller/rekor/actions/initialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ func (i initializeAction) Name() string {
}

func (i initializeAction) CanHandle(_ context.Context, instance *rhtasv1alpha1.Rekor) bool {
c := meta.FindStatusCondition(instance.Status.Conditions, constants.Ready)
if c == nil {
return false
}
return c.Reason == constants.Initialize
return meta.IsStatusConditionFalse(instance.Status.Conditions, constants.Ready)
}

func (i initializeAction) Handle(ctx context.Context, instance *rhtasv1alpha1.Rekor) *action.Result {
Expand Down
3 changes: 1 addition & 2 deletions internal/controller/rekor/actions/redis/initialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ func (i initializeAction) Name() string {
}

func (i initializeAction) CanHandle(_ context.Context, instance *rhtasv1alpha1.Rekor) bool {
c := meta.FindStatusCondition(instance.Status.Conditions, constants.Ready)
return c.Reason == constants.Initialize && !meta.IsStatusConditionTrue(instance.Status.Conditions, actions.RedisCondition)
return meta.IsStatusConditionFalse(instance.Status.Conditions, actions.RedisCondition)
}

func (i initializeAction) Handle(ctx context.Context, instance *rhtasv1alpha1.Rekor) *action.Result {
Expand Down
10 changes: 4 additions & 6 deletions internal/controller/rekor/actions/server/initialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@ func (i initializeAction) Name() string {
return "initialize"
}

// CanHandle check if ServerAvailable condition status is false. It is sign that some previous server action make some change.
func (i initializeAction) CanHandle(_ context.Context, instance *rhtasv1alpha1.Rekor) bool {
c := meta.FindStatusCondition(instance.Status.Conditions, constants.Ready)
if c == nil {
return false
}
return c.Reason == constants.Initialize && !meta.IsStatusConditionTrue(instance.Status.Conditions, actions.ServerCondition)
return meta.IsStatusConditionFalse(instance.Status.Conditions, actions.ServerCondition)
}

// Handle set ServerAvailable status to true if server's deployment is available.
func (i initializeAction) Handle(ctx context.Context, instance *rhtasv1alpha1.Rekor) *action.Result {
var (
ok bool
Expand All @@ -57,7 +55,7 @@ func (i initializeAction) Handle(ctx context.Context, instance *rhtasv1alpha1.Re
Status: metav1.ConditionTrue,
Reason: constants.Ready,
})
return i.Continue()
return i.StatusUpdate(ctx, instance)
}

func (i initializeAction) CanHandleError(_ context.Context, _ *rhtasv1alpha1.Rekor) bool {
Expand Down
11 changes: 2 additions & 9 deletions internal/controller/rekor/actions/server/resolve_pub_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,8 @@ func (i resolvePubKeyAction) Name() string {
}

func (i resolvePubKeyAction) CanHandle(_ context.Context, instance *rhtasv1alpha1.Rekor) bool {
c := meta.FindStatusCondition(instance.Status.Conditions, actions.ServerCondition)
if c == nil {
return false
}
if c.Reason != constants.Initialize && c.Reason != constants.Ready {
return false
}

return instance.Status.PublicKeyRef == nil
return meta.IsStatusConditionTrue(instance.Status.Conditions, actions.ServerCondition) &&
instance.Status.PublicKeyRef == nil
}

func (i resolvePubKeyAction) Handle(ctx context.Context, instance *rhtasv1alpha1.Rekor) *action.Result {
Expand Down
Loading

0 comments on commit 05897d3

Please sign in to comment.