Comments (3)
Unfortunately, while it is possible to terraform apply
the TriggerTemplate after changing the capitalization, Terraform subsequently emits an error, and the resource is tainted. So there isn't a clean workaround at the moment.
╷
│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to
│ module.tekton_pipelines.module.trigger_templates.kubernetes_manifest.trigger_template_github_image_pr,
│ provider "provider[\"registry.terraform.io/hashicorp/kubernetes\"]"
│ produced an unexpected new value: .object: wrong final value type:
│ attribute "spec": attribute "resourceTemplates" is required.
│
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.
╵
Performing terraform plan
after this shows a persistent diff in the state.
# module.tekton_pipelines.module.trigger_templates.kubernetes_manifest.trigger_template_github_image_pr is tainted, so must be replaced
-/+ resource "kubernetes_manifest" "trigger_template_github_image_pr" {
~ object = {
~ spec = {
+ resourceTemplates = [
+ {
+ apiVersion = "tekton.dev/v1"
+ kind = "PipelineRun"
+ metadata = {
+ generateName = "github-image-pr-"
}
+ spec = {
+ params = [
+ {
+ name = "github-status-url"
+ value = "$(tt.params.github-status-url)"
},
+ {
+ name = "pr-number"
+ value = "$(tt.params.pr-number)"
},
+ {
+ name = "repo-name"
+ value = "$(tt.params.repo-name)"
},
+ {
+ name = "repo-url"
+ value = "$(tt.params.repo-url)"
},
]
+ pipelineRef = {
+ name = "github-image-pr"
}
+ taskRunTemplate = {
+ serviceAccountName = "cicd-bot"
}
+ workspaces = [
+ {
+ name = "default"
+ volumeClaimTemplate = {
+ spec = {
+ accessModes = [
+ "ReadWriteOnce",
]
+ resources = {
+ requests = {
+ storage = "512Mi"
}
}
}
}
},
]
}
},
]
- resourcetemplates = [
- {
- apiVersion = "tekton.dev/v1"
- kind = "PipelineRun"
- metadata = {
- generateName = "github-image-pr-"
}
- spec = {
- params = [
- {
- name = "github-status-url"
- value = "$(tt.params.github-status-url)"
},
- {
- name = "pr-number"
- value = "$(tt.params.pr-number)"
},
- {
- name = "repo-name"
- value = "$(tt.params.repo-name)"
},
- {
- name = "repo-url"
- value = "$(tt.params.repo-url)"
},
]
- pipelineRef = {
- name = "github-image-pr"
}
- taskRunTemplate = {
- serviceAccountName = "cicd-bot"
}
- workspaces = [
- {
- name = "default"
- volumeClaimTemplate = {
- spec = {
- accessModes = [
- "ReadWriteOnce",
]
- resources = {
- requests = {
- storage = "512Mi"
}
}
}
}
},
]
}
},
]
# (1 unchanged attribute hidden)
}
# (3 unchanged attributes hidden)
}
# (1 unchanged attribute hidden)
}
from triggers.
Hi @CameronHudson8 👋
I followed the steps which you have provided but i did not see any issue
- Created terraform code which you have provided
- did
terraform apply
- Below is the output of terraform apply
$ terraform apply
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# kubernetes_manifest.trigger_template_github_image_pr will be created
+ resource "kubernetes_manifest" "trigger_template_github_image_pr" {
+ manifest = {
+ apiVersion = "triggers.tekton.dev/v1beta1"
+ kind = "TriggerTemplate"
+ metadata = {
+ name = "github-image-pr"
+ namespace = "tekton-pipelines"
}
+ spec = {
+ params = [
+ {
+ name = "github-status-url"
},
+ {
+ name = "pr-number"
},
+ {
+ name = "repo-name"
},
+ {
+ name = "repo-url"
},
]
+ resourcetemplates = [
+ {
+ apiVersion = "tekton.dev/v1"
+ kind = "PipelineRun"
+ metadata = {
+ generateName = "github-image-pr-"
}
+ spec = {
+ params = [
+ {
+ name = "github-status-url"
+ value = "$(tt.params.github-status-url)"
},
+ {
+ name = "pr-number"
+ value = "$(tt.params.pr-number)"
},
+ {
+ name = "repo-name"
+ value = "$(tt.params.repo-name)"
},
+ {
+ name = "repo-url"
+ value = "$(tt.params.repo-url)"
},
]
+ pipelineRef = {
+ name = "github-image-pr"
}
+ taskRunTemplate = {
+ serviceAccountName = "tekton-triggers-example-sa"
}
+ workspaces = [
+ {
+ name = "default"
+ volumeClaimTemplate = {
+ spec = {
+ accessModes = [
+ "ReadWriteOnce",
]
+ resources = {
+ requests = {
+ storage = "512Mi"
}
}
}
}
},
]
}
},
]
}
}
+ object = {
+ apiVersion = "triggers.tekton.dev/v1beta1"
+ kind = "TriggerTemplate"
+ metadata = {
+ name = "github-image-pr"
+ namespace = "tekton-pipelines"
}
+ spec = {
+ params = [
+ {
+ name = "github-status-url"
},
+ {
+ name = "pr-number"
},
+ {
+ name = "repo-name"
},
+ {
+ name = "repo-url"
},
]
+ resourcetemplates = [
+ {
+ apiVersion = "tekton.dev/v1"
+ kind = "PipelineRun"
+ metadata = {
+ generateName = "github-image-pr-"
}
+ spec = {
+ params = [
+ {
+ name = "github-status-url"
+ value = "$(tt.params.github-status-url)"
},
+ {
+ name = "pr-number"
+ value = "$(tt.params.pr-number)"
},
+ {
+ name = "repo-name"
+ value = "$(tt.params.repo-name)"
},
+ {
+ name = "repo-url"
+ value = "$(tt.params.repo-url)"
},
]
+ pipelineRef = {
+ name = "github-image-pr"
}
+ taskRunTemplate = {
+ serviceAccountName = "tekton-triggers-example-sa"
}
+ workspaces = [
+ {
+ name = "default"
+ volumeClaimTemplate = {
+ spec = {
+ accessModes = [
+ "ReadWriteOnce",
]
+ resources = {
+ requests = {
+ storage = "512Mi"
}
}
}
}
},
]
}
},
]
}
}
}
Plan: 1 to add, 0 to change, 0 to destroy.
╷
│ Warning: This custom resource does not have an associated OpenAPI schema.
│
│ with kubernetes_manifest.trigger_template_github_image_pr,
│ on main.tf line 1, in resource "kubernetes_manifest" "trigger_template_github_image_pr":
│ 1: resource "kubernetes_manifest" "trigger_template_github_image_pr" {
│
│ We could not find an OpenAPI schema for this custom resource. Updates to this resource will cause a forced replacement.
╵
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
kubernetes_manifest.trigger_template_github_image_pr: Creating...
kubernetes_manifest.trigger_template_github_image_pr: Creation complete after 0s
╷
│ Warning: This custom resource does not have an associated OpenAPI schema.
│
│ with kubernetes_manifest.trigger_template_github_image_pr,
│ on main.tf line 1, in resource "kubernetes_manifest" "trigger_template_github_image_pr":
│ 1: resource "kubernetes_manifest" "trigger_template_github_image_pr" {
│
│ We could not find an OpenAPI schema for this custom resource. Updates to this resource will cause a forced replacement.
╵
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
- `TriggerTemplate created successfully
$ kubectl get tt -n tekton-pipelines
NAME AGE
github-image-pr 7s
- Kubectl version
$ kubectl version
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short. Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.6", GitCommit:"11902a838028edef305dfe2f96be929bc4d114d8", GitTreeState:"archive", BuildDate:"2023-06-15T00:00:00Z", GoVersion:"go1.20.4", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.7
Server Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.3", GitCommit:"9e644106593f3f4aa98f8a84b23db5fa378900bd", GitTreeState:"clean", BuildDate:"2023-03-15T13:33:12Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
- Terraform version
$ terraform version
Terraform v1.5.7
on linux_amd64
+ provider registry.terraform.io/hashicorp/kubernetes v2.17.0
Let me know if i misunderstand your question
from triggers.
I started from scratch, this time with a cluster of kubernetes version 1.27, and I'm no longer able to reproduce it. Weird, but works for me!
from triggers.
Related Issues (20)
- Triggers called multiple times by EventListener or never called at all HOT 6
- Event listener restarts when under minimal stress HOT 78
- CEL overlay from headers error: couldn't unmarshal json from the TriggerTemplate: invalid character "X" after object key:value pair HOT 2
- Change Leader Election Configmap for Controllers and Webhook
- Event listener failing to run in OKD HOT 3
- getting started example error HOT 3
- Knative undefined: injection.Dynamic HOT 5
- Cant't creating EventListener HOT 3
- Allow Event Listener to Filter on Ingress URL HOT 2
- Trigger interceptor updated the certificate on every restart
- Knative undefined: injection.Dynamic HOT 6
- Example doesn't work well with both SSH and HTTPS enabled in Bitbucket HOT 4
- False negative during integration testing HOT 2
- webhook触发成功。没有生成流水线运行 HOT 4
- Unable to run pipeline after webhook is triggered HOT 4
- `namespaceSelector` under `tiggerGroups` will not set `--is-multi-ns=true` on `EventListener` `Pod`. HOT 4
- EventListener loglevel would be more specific HOT 1
- Move Event version to metadata instead of having hard coded version on event type HOT 1
- Support for Default Values in Tekton TriggerBinding Parameters HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from triggers.