Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Tekton depedency order within Pulumi #1291

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/lre.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ jobs:
name: Remote / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 45
if: false
steps:
- name: Checkout
uses: >- # v4.1.1
Expand Down
43 changes: 31 additions & 12 deletions native-cli/components/tekton.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,28 @@ func (component *TektonPipelines) Install(

// The configuration for Tekton Triggers.
type TektonTriggers struct {
Version string
Version string
Dependencies []pulumi.Resource
}

// Install installs the Tekton Triggers release and interceptors on the cluster.
func (component *TektonTriggers) Install(
ctx *pulumi.Context,
name string,
) ([]pulumi.Resource, error) {
tektonTriggers, err := yaml.NewConfigFile(ctx, name, &yaml.ConfigFileArgs{
File: fmt.Sprintf(
"https://storage.googleapis.com/tekton-releases/triggers/previous/v%s/release.yaml",
component.Version,
tektonTriggers, err := yaml.NewConfigFile(
ctx,
name,
&yaml.ConfigFileArgs{
File: fmt.Sprintf(
"https://storage.googleapis.com/tekton-releases/triggers/previous/v%s/release.yaml",
component.Version,
),
},
pulumi.DependsOn(
component.Dependencies,
),
})
)
if err != nil {
return nil, fmt.Errorf("%w: %w", errPulumi, err)
}
Expand All @@ -91,6 +99,9 @@ func (component *TektonTriggers) Install(
component.Version,
),
},
pulumi.DependsOn(
[]pulumi.Resource{tektonTriggers},
),
)
if err != nil {
return nil, fmt.Errorf("%w: %w", errPulumi, err)
Expand All @@ -101,20 +112,28 @@ func (component *TektonTriggers) Install(

// Configuration for the Tekton Dashboard.
type TektonDashboard struct {
Version string
Version string
Dependencies []pulumi.Resource
}

// Install installs the Tekton Dashboard on the cluster.
func (component *TektonDashboard) Install(
ctx *pulumi.Context,
name string,
) ([]pulumi.Resource, error) {
tektonDashboard, err := yaml.NewConfigFile(ctx, name, &yaml.ConfigFileArgs{
File: fmt.Sprintf(
"https://storage.googleapis.com/tekton-releases/dashboard/previous/v%s/release.yaml",
component.Version,
tektonDashboard, err := yaml.NewConfigFile(
ctx,
name,
&yaml.ConfigFileArgs{
File: fmt.Sprintf(
"https://storage.googleapis.com/tekton-releases/dashboard/previous/v%s/release.yaml",
component.Version,
),
},
pulumi.DependsOn(
component.Dependencies,
),
})
)
if err != nil {
return nil, fmt.Errorf("%w: %w", errPulumi, err)
}
Expand Down
18 changes: 15 additions & 3 deletions native-cli/programs/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ func ProgramForLocalCluster(ctx *pulumi.Context) error {
tektonPipelines, err := components.AddComponent(
ctx,
"tekton-pipelines",
&components.TektonPipelines{Version: "0.58.0"},
&components.TektonPipelines{
Version: "0.58.0",
},
)
if err != nil {
log.Println(err)
Expand All @@ -81,7 +83,12 @@ func ProgramForLocalCluster(ctx *pulumi.Context) error {
tektonTriggers, err := components.AddComponent(
ctx,
"tekton-triggers",
&components.TektonTriggers{Version: "0.26.1"},
&components.TektonTriggers{
Version: "0.26.1",
Dependencies: slices.Concat(
tektonPipelines,
),
},
)
if err != nil {
log.Println(err)
Expand All @@ -91,7 +98,12 @@ func ProgramForLocalCluster(ctx *pulumi.Context) error {
components.Check(components.AddComponent(
ctx,
"tekton-dashboard",
&components.TektonDashboard{Version: "0.45.0"},
&components.TektonDashboard{
Version: "0.45.0",
Dependencies: slices.Concat(
tektonPipelines, tektonTriggers,
),
},
))

components.Check(components.AddComponent(
Expand Down