Skip to content

Commit

Permalink
Deprecate current resolution framework
Browse files Browse the repository at this point in the history
This PR updates the Godoc to declare the existing resolution as
deprecated. The upgraded framework was made available in
`pkg/remoteresolution` in a prior PR.
  • Loading branch information
chitrangpatel committed May 15, 2024
1 parent 981c034 commit f77516e
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 6 deletions.
8 changes: 4 additions & 4 deletions docs/how-to-write-a-resolver.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ type resolver struct {}
```
{{% /tab %}}

{{% tab "Previous Framework" %}}
{{% tab "Previous Framework (Deprecated)" %}}
```go
package main

Expand Down Expand Up @@ -232,7 +232,7 @@ import (
```
{{% /tab %}}

{{% tab "Previous Framework" %}}
{{% tab "Previous Framework (Deprecated)" %}}

```go
import (
Expand Down Expand Up @@ -273,7 +273,7 @@ func (r *resolver) Validate(ctx context.Context, req *v1beta1.ResolutionRequestS
```
{{% /tab %}}

{{% tab "Previous Framework" %}}
{{% tab "Previous Framework (Deprecated)" %}}

```go
// ValidateParams ensures that the params from a request are as expected.
Expand Down Expand Up @@ -354,7 +354,7 @@ func (*myResolvedResource) RefSource() *pipelinev1.RefSource {

{{% /tab %}}

{{% tab "Previous Framework" %}}
{{% tab "Previous Framework (Deprecated)" %}}


```go
Expand Down
2 changes: 1 addition & 1 deletion docs/resolver-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ configuration for the framework to get a resolver running.

{{% /tab %}}

{{% tab "Previous Framework" %}}
{{% tab "Previous Framework (Deprecated)" %}}

| Method to Implement | Description |
|----------------------|-------------|
Expand Down
2 changes: 1 addition & 1 deletion docs/resolver-template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The entire program for the `latest` framework is defined in
implementations of all the methods defined by the [`framework.Resolver`
interface](../../pkg/remoteresolution/resolver/framework/interface.go).

If you choose to use the previous framework (soon to be deprecated) is defined in
If you choose to use the previous framework (deprecated) is defined in
[`./cmd/demoresolver/main.go`](./cmd/demoresolver/main.go) and provides stub
implementations of all the methods defined by the [`framework.Resolver`
interface](../../pkg/resolution/resolver/framework/interface.go).
Expand Down
1 change: 1 addition & 0 deletions docs/resolver-template/cmd/demoresolver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func main() {
)
}

// Deprecated
type resolver struct{}

// Initialize sets up any dependencies needed by the resolver. None atm.
Expand Down
4 changes: 4 additions & 0 deletions pkg/resolution/common/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ type ResolverName string

// Requester is the interface implemented by a type that knows how to
// submit requests for remote resources.
//
// Deprecated: Use [github.com/tektoncd/pipeline/pkg/remoteresolution/resource.Requester].
type Requester interface {
// Submit accepts the name of a resolver to submit a request to
// along with the request itself.
Expand All @@ -41,6 +43,8 @@ type Requester interface {
// type an opportunity to control properties such as whether the name of
// a request has particular properties, whether the request should be made
// to a specific namespace, and precisely which parameters should be included.
//
// Deprecated: Use [github.com/tektoncd/pipeline/pkg/remoteresolution/resource.Request].
type Request interface {
Name() string
Namespace() string
Expand Down
2 changes: 2 additions & 0 deletions pkg/resolution/resolver/bundle/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ const (
)

// Resolver implements a framework.Resolver that can fetch files from OCI bundles.
//
// Deprecated: Use [github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/bundle.Resolver] instead.
type Resolver struct {
kubeClientSet kubernetes.Interface
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/resolution/resolver/cluster/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ const (
var _ framework.Resolver = &Resolver{}

// Resolver implements a framework.Resolver that can fetch resources from other namespaces.
//
// Deprecated: Use [github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/cluster.Resolver] instead.
type Resolver struct {
pipelineClientSet clientset.Interface
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/resolution/resolver/framework/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import (
// Resolver is the interface to implement for type-specific resource
// resolution. It fetches resources from a given type of remote location
// and returns their content along with any associated annotations.
//
// Deprecated: Use [github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/framework.Resolver] instead.
type Resolver interface {
// Initialize is called at the moment the resolver controller is
// instantiated and is a good place to setup things like
Expand Down
2 changes: 2 additions & 0 deletions pkg/resolution/resolver/framework/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ import (
// Reconciler handles ResolutionRequest objects, performs functionality
// common to all resolvers and delegates resolver-specific actions
// to its embedded type-specific Resolver object.
//
// Deprecated: Use [github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/framework.Reconciler] instead.
type Reconciler struct {
// Implements reconciler.LeaderAware
reconciler.LeaderAwareFuncs
Expand Down
2 changes: 2 additions & 0 deletions pkg/resolution/resolver/git/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ const (
var _ framework.Resolver = &Resolver{}

// Resolver implements a framework.Resolver that can fetch files from git.
//
// Deprecated: Use [github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/git.Resolver] instead.
type Resolver struct {
kubeClient kubernetes.Interface
logger *zap.SugaredLogger
Expand Down
2 changes: 2 additions & 0 deletions pkg/resolution/resolver/http/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ const (
)

// Resolver implements a framework.Resolver that can fetch files from an HTTP URL
//
// Deprecated: Use [github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/http.Resolver] instead.
type Resolver struct {
kubeClient kubernetes.Interface
logger *zap.SugaredLogger
Expand Down
2 changes: 2 additions & 0 deletions pkg/resolution/resolver/hub/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ const (
)

// Resolver implements a framework.Resolver that can fetch files from OCI bundles.
//
// Deprecated: Use [github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/hub.Resolver] instead.
type Resolver struct {
// TektonHubURL is the URL for hub resolver with type tekton
TektonHubURL string
Expand Down
4 changes: 4 additions & 0 deletions pkg/resolution/resource/crd_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import (

// CRDRequester implements the Requester interface using
// ResolutionRequest CRDs.
//
// Deprecated: Use [github.com/tektoncd/pipeline/pkg/remoteresolution/resource.CRDRequester] instead.
type CRDRequester struct {
clientset rrclient.Interface
lister rrlisters.ResolutionRequestLister
Expand All @@ -43,6 +45,8 @@ type CRDRequester struct {
// ResolutionRequest CRD objects to mediate between the caller who wants a
// resource (e.g. Tekton Pipelines) and the responder who can fetch
// it (e.g. the gitresolver)
//
// Deprecated: Use [github.com/tektoncd/pipeline/pkg/remoteresolution/resource.NewCRDRequester] instead.
func NewCRDRequester(clientset rrclient.Interface, lister rrlisters.ResolutionRequestLister) *CRDRequester {
return &CRDRequester{clientset, lister}
}
Expand Down
4 changes: 4 additions & 0 deletions pkg/resolution/resource/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1"
var _ Request = &BasicRequest{}

// BasicRequest holds the fields needed to submit a new resource request.
//
// Deprecated: Use [github.com/tektoncd/pipeline/pkg/remoteresolution/resource.BasicRequest] instead.
type BasicRequest struct {
name string
namespace string
Expand All @@ -29,6 +31,8 @@ type BasicRequest struct {

// NewRequest returns an instance of a BasicRequest with the given name,
// namespace and params.
//
// Deprecated: Use [github.com/tektoncd/pipeline/pkg/remoteresolution/resource.NewRequest] instead.
func NewRequest(name, namespace string, params v1.Params) Request {
return &BasicRequest{name, namespace, params}
}
Expand Down

0 comments on commit f77516e

Please sign in to comment.