-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added namespacedTasks to tektonconfig to support ecosystem tasks
- Loading branch information
1 parent
2f4fc77
commit 41c5b65
Showing
13 changed files
with
121 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package tektonaddon | ||
|
||
import ( | ||
"context" | ||
|
||
mf "github.com/manifestival/manifestival" | ||
"github.com/tektoncd/operator/pkg/apis/operator/v1alpha1" | ||
"github.com/tektoncd/operator/pkg/reconciler/common" | ||
"github.com/tektoncd/operator/pkg/reconciler/kubernetes/tektoninstallerset/client" | ||
) | ||
|
||
func (r *Reconciler) EnsureNamespacedTask(ctx context.Context, enable string, ta *v1alpha1.TektonAddon) error { | ||
manifest := *r.namespacedTaskManifest | ||
if enable == "true" { | ||
if err := r.installerSetClient.CustomSet(ctx, ta, NamespacedTaskInstallerSet, &manifest, filterAndTransformNamespacedTask(), nil); err != nil { | ||
return err | ||
} | ||
} else { | ||
if err := r.installerSetClient.CleanupCustomSet(ctx, NamespacedTaskInstallerSet); err != nil { | ||
return err | ||
} | ||
} | ||
return nil | ||
} | ||
|
||
func filterAndTransformNamespacedTask() client.FilterAndTransform { | ||
return func(ctx context.Context, manifest *mf.Manifest, comp v1alpha1.TektonComponent) (*mf.Manifest, error) { | ||
addon := comp.(*v1alpha1.TektonAddon) | ||
addonImages := common.ToLowerCaseKeys(common.ImagesFromEnv(common.AddonsImagePrefix)) | ||
tfs := []mf.Transformer{ | ||
// replaceKind(KindTask, KindClusterTask), | ||
injectLabel(labelProviderType, providerTypeRedHat, overwrite, "Task"), | ||
common.TaskImages(addonImages), | ||
} | ||
if err := transformers(ctx, manifest, addon, tfs...); err != nil { | ||
return nil, err | ||
} | ||
return manifest, nil | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters