Skip to content

Commit

Permalink
make sha nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
zreigz committed Jul 26, 2024
1 parent 8ea5ed6 commit 00a3fe5
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
github.com/open-policy-agent/gatekeeper/v3 v3.15.1
github.com/orcaman/concurrent-map/v2 v2.0.1
github.com/pkg/errors v0.9.1
github.com/pluralsh/console/go/client v1.3.0
github.com/pluralsh/console/go/client v1.4.0
github.com/pluralsh/controller-reconcile-helper v0.0.4
github.com/pluralsh/gophoenix v0.1.3-0.20231201014135-dff1b4309e34
github.com/pluralsh/polly v0.1.10
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,8 @@ github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5/go.mod h1:iIss55rK
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pluralsh/console/go/client v1.3.0 h1:uBX7SF8Qc4zYDv0kaHV24fvsh7Vh7j2cPeig8Vy5TdU=
github.com/pluralsh/console/go/client v1.3.0/go.mod h1:lpoWASYsM9keNePS3dpFiEisUHEfObIVlSL3tzpKn8k=
github.com/pluralsh/console/go/client v1.4.0 h1:Mr/gyU20jrLZZ9diEznv3aU/CJ5wk13qLes/4O9unwM=
github.com/pluralsh/console/go/client v1.4.0/go.mod h1:lpoWASYsM9keNePS3dpFiEisUHEfObIVlSL3tzpKn8k=
github.com/pluralsh/controller-reconcile-helper v0.0.4 h1:1o+7qYSyoeqKFjx+WgQTxDz4Q2VMpzprJIIKShxqG0E=
github.com/pluralsh/controller-reconcile-helper v0.0.4/go.mod h1:AfY0gtteD6veBjmB6jiRx/aR4yevEf6K0M13/pGan/s=
github.com/pluralsh/gophoenix v0.1.3-0.20231201014135-dff1b4309e34 h1:ab2PN+6if/Aq3/sJM0AVdy1SYuMAnq4g20VaKhTm/Bw=
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ type Client interface {
GetClusterBackup(clusterID, namespace, name string) (*console.ClusterBackupFragment, error)
GetServices(after *string, first *int64) (*console.PagedClusterServices, error)
GetService(id string) (*console.GetServiceDeploymentForAgent_ServiceDeployment, error)
UpdateComponents(id, revisionID, sha string, components []*console.ComponentAttributes, errs []*console.ServiceErrorAttributes) error
UpdateComponents(id, revisionID string, sha *string, components []*console.ComponentAttributes, errs []*console.ServiceErrorAttributes) error
AddServiceErrors(id string, errs []*console.ServiceErrorAttributes) error
ParsePipelineGateCR(pgFragment *console.PipelineGateFragment, operatorNamespace string) (*v1alpha1.PipelineGate, error)
GateExists(id string) bool
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (c *client) GetService(id string) (*console.GetServiceDeploymentForAgent_Se
return resp.ServiceDeployment, nil
}

func (c *client) UpdateComponents(id, revisionID, sha string, components []*console.ComponentAttributes, errs []*console.ServiceErrorAttributes) error {
func (c *client) UpdateComponents(id, revisionID string, sha *string, components []*console.ComponentAttributes, errs []*console.ServiceErrorAttributes) error {
_, err := c.consoleClient.UpdateServiceComponents(c.ctx, id, components, revisionID, sha, errs)
return err
}
Expand Down
4 changes: 1 addition & 3 deletions pkg/controller/service/reconciler_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import (
"strings"
"time"

"github.com/samber/lo"

console "github.com/pluralsh/console/go/client"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/klog/v2"
Expand Down Expand Up @@ -224,7 +222,7 @@ func (s *ServiceReconciler) UpdateStatus(id, revisionID string, sha *string, com
errs = append(errs, err)
}

return s.ConsoleClient.UpdateComponents(id, revisionID, lo.FromPtr(sha), components, errs)
return s.ConsoleClient.UpdateComponents(id, revisionID, sha, components, errs)
}

func (s *ServiceReconciler) AddErrors(id string, err *console.ServiceErrorAttributes) error {
Expand Down
12 changes: 6 additions & 6 deletions pkg/test/mocks/Client_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 00a3fe5

Please sign in to comment.