-
Notifications
You must be signed in to change notification settings - Fork 119
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
Split CI/CD pipeline logic into multiple files. #84
Split CI/CD pipeline logic into multiple files. #84
Conversation
Codecov Report
@@ Coverage Diff @@
## master #84 +/- ##
==========================================
- Coverage 27.52% 25.66% -1.86%
==========================================
Files 52 59 +7
Lines 3408 3655 +247
==========================================
Hits 938 938
- Misses 2409 2656 +247
Partials 61 61
Continue to review full report at Codecov.
|
2bfb1fb
to
4cf02c1
Compare
irresources := ir.TektonResources.EventListeners | ||
objs := []runtime.Object{} | ||
for _, irresource := range irresources { | ||
objs = append(objs, el.createNewResource(irresource)) | ||
} | ||
return objs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we create this only if the eventlistener is in the supported kind?
internal/apiresource/pipeline.go
Outdated
irresources := ir.TektonResources.Pipelines | ||
objs := []runtime.Object{} | ||
for _, irresource := range irresources { | ||
objs = append(objs, p.createNewResource(irresource, ir)) | ||
} | ||
return objs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should check if it is a supported kind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
} else if container.ContainerBuildType == plantypes.S2IContainerBuildTypeValue { | ||
log.Errorf("TODO: Implement support for S2I") | ||
} else if container.ContainerBuildType == plantypes.CNBContainerBuildTypeValue { | ||
log.Errorf("TODO: Implement support for CNB") | ||
} else { | ||
log.Errorf("Unknown containerization method: %v", container.ContainerBuildType) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets make these as warnings rather than error. we have to think of supporting the reusedockerfile usecase too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reuse dockerfile is supported already
https://github.com/HarikrishnanBalagopal/move2kube/blob/splittekton/internal/apiresource/pipeline.go#L85
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought error is better since this is something that needs to be fixed.
Warning is something that may not need to be fixed.
internal/apiresource/role.go
Outdated
|
||
// CreateNewResources creates the runtime objects from the intermediate representation. | ||
func (r *Role) CreateNewResources(ir irtypes.IR, supportedKinds []string) []runtime.Object { | ||
irresources := ir.Roles |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check if role is supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
internal/apiresource/rolebinding.go
Outdated
|
||
// CreateNewResources creates the runtime objects from the intermediate representation. | ||
func (rb *RoleBinding) CreateNewResources(ir irtypes.IR, supportedKinds []string) []runtime.Object { | ||
irresources := ir.RoleBindings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check if it is supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
// CreateNewResources creates the runtime objects from the intermediate representation. | ||
func (sa *ServiceAccount) CreateNewResources(ir irtypes.IR, supportedKinds []string) []runtime.Object { | ||
irresources := ir.ServiceAccounts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check if it is supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
// CreateNewResources creates the runtime objects from the intermediate representation. | ||
func (tb *TriggerBinding) CreateNewResources(ir irtypes.IR, supportedKinds []string) []runtime.Object { | ||
irresources := ir.TektonResources.TriggerBindings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check if it is supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
// CreateNewResources creates the runtime objects from the intermediate representation. | ||
func (tt *TriggerTemplate) CreateNewResources(ir irtypes.IR, supportedKinds []string) []runtime.Object { | ||
irresources := ir.TektonResources.TriggerTemplates |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check if the kind is supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
2bcd79c
to
3b70441
Compare
internal/apiresource/deployment.go
Outdated
@@ -72,6 +72,7 @@ func (d *Deployment) CreateNewResources(ir irtypes.IR, supportedKinds []string) | |||
if common.IsStringPresent(supportedKinds, daemonSetKind) { | |||
obj = d.createDaemonSet(service) | |||
} | |||
log.Errorf("Could not find a valid resource type in cluster to create a daemon set.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be in else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
internal/apiresource/deployment.go
Outdated
@@ -80,6 +81,7 @@ func (d *Deployment) CreateNewResources(ir irtypes.IR, supportedKinds []string) | |||
pod.Spec.RestartPolicy = corev1.RestartPolicyOnFailure | |||
obj = pod | |||
} | |||
log.Errorf("Could not find a valid resource type in cluster to create a job/pod.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be in else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
f270898
to
fde3220
Compare
Lets add a collected cluster with tekton, and we are good to go. |
@HarikrishnanBalagopal once you are done with the changes, please rebase. Currently it has some merge conflicts with the master after the previous PR merge. |
Signed-off-by: Harikrishnan Balagopal <Harikrishnan.Balagopal@ibm.com>
Signed-off-by: Harikrishnan Balagopal <Harikrishnan.Balagopal@ibm.com>
… resources Signed-off-by: Harikrishnan Balagopal <Harikrishnan.Balagopal@ibm.com>
Signed-off-by: Harikrishnan Balagopal <Harikrishnan.Balagopal@ibm.com>
94232d9
to
f20dc9c
Compare
…ress name being the same as the backend service name. Signed-off-by: Harikrishnan Balagopal <Harikrishnan.Balagopal@ibm.com>
f20dc9c
to
8780a1e
Compare
Signed-off-by: Harikrishnan Balagopal <Harikrishnan.Balagopal@ibm.com>
Signed-off-by: Harikrishnan Balagopal <Harikrishnan.Balagopal@ibm.com>
Signed-off-by: Harikrishnan Balagopal <Harikrishnan.Balagopal@ibm.com>
Signed-off-by: Harikrishnan Balagopal <Harikrishnan.Balagopal@ibm.com>
40155b1
to
360481f
Compare
Signed-off-by: Harikrishnan Balagopal <Harikrishnan.Balagopal@ibm.com>
a2b31bc
to
b572694
Compare
No description provided.