Skip to content

Commit

Permalink
WIP: Adding some TODOS on what we need to do for
Browse files Browse the repository at this point in the history
issue shipwright-io#463 .

Keep in mind this would be the second attempt to improve on this
topic, we previously tried it with:

- shipwright-io#483

Signed-off-by: Zoe <xigxjn@cn.ibm.com>
  • Loading branch information
qu1queee authored and xiujuan95 committed Dec 11, 2020
1 parent ae7a362 commit 4b69868
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions pkg/controller/build/build_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,21 @@ import (
buildmetrics "github.com/shipwright-io/build/pkg/metrics"
)

// TODO:
// - modify types for Build
// - regenerate CRDS for Build
// - We need to generate Constants for all types of errors
// - Also fix the distinction of secrets paths when defining the above constants
// - We need to deal with an error plus a message when validation fails
// - We need to update unit and integration tests

// succeedStatus default status for the Build CRD
const succeedStatus string = "Succeeded"
const namespace string = "namespace"
const name string = "name"
const (
succeedStatus string = "Succeeded"
clusterBuildStrategyMissing string = "ClusterBuildStrategyMissing"
namespace string = "namespace"
name string = "name"
)

type setOwnerReferenceFunc func(owner, object metav1.Object, scheme *runtime.Scheme) error

Expand Down Expand Up @@ -404,6 +415,10 @@ func (r *ReconcileBuild) validateSecrets(ctx context.Context, secretNames []stri
}
}

// secret from spec.source is missing
// secret from spec.output is missing
// secret from spec.builderimage is missing
// multiple secrets are missing
if len(missingSecrets) > 1 {
return fmt.Errorf("secrets %s do not exist", strings.Join(missingSecrets, ", "))
} else if len(missingSecrets) > 0 {
Expand Down

0 comments on commit 4b69868

Please sign in to comment.