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

Split CI/CD pipeline logic into multiple files. #84

Merged
merged 10 commits into from
Oct 25, 2020

Conversation

HarikrishnanBalagopal
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Oct 18, 2020

Codecov Report

Merging #84 into master will decrease coverage by 1.86%.
The diff coverage is 1.04%.

Impacted file tree graph

@@            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              
Impacted Files Coverage Δ
internal/apiresource/deployment.go 0.00% <0.00%> (ø)
internal/apiresource/eventlistener.go 0.00% <0.00%> (ø)
internal/apiresource/pipeline.go 0.00% <0.00%> (ø)
internal/apiresource/role.go 0.00% <0.00%> (ø)
internal/apiresource/rolebinding.go 0.00% <0.00%> (ø)
internal/apiresource/service.go 0.00% <0.00%> (ø)
internal/apiresource/serviceaccount.go 0.00% <0.00%> (ø)
internal/apiresource/storage.go 0.00% <0.00%> (ø)
internal/apiresource/triggerbinding.go 0.00% <0.00%> (ø)
internal/apiresource/triggertemplate.go 0.00% <0.00%> (ø)
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1110288...b572694. Read the comment docs.

Comment on lines 43 to 53
irresources := ir.TektonResources.EventListeners
objs := []runtime.Object{}
for _, irresource := range irresources {
objs = append(objs, el.createNewResource(irresource))
}
return objs
Copy link
Member

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?

Comment on lines 52 to 61
irresources := ir.TektonResources.Pipelines
objs := []runtime.Object{}
for _, irresource := range irresources {
objs = append(objs, p.createNewResource(irresource, ir))
}
return objs
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines +141 to +151
} 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)
}
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@HarikrishnanBalagopal HarikrishnanBalagopal Oct 21, 2020

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.


// CreateNewResources creates the runtime objects from the intermediate representation.
func (r *Role) CreateNewResources(ir irtypes.IR, supportedKinds []string) []runtime.Object {
irresources := ir.Roles
Copy link
Member

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

Copy link
Contributor Author

@HarikrishnanBalagopal HarikrishnanBalagopal Oct 20, 2020

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 (rb *RoleBinding) CreateNewResources(ir irtypes.IR, supportedKinds []string) []runtime.Object {
irresources := ir.RoleBindings
Copy link
Member

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

Copy link
Contributor Author

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
Copy link
Member

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

Copy link
Contributor Author

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
Copy link
Member

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

Copy link
Contributor Author

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
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -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.")
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -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.")
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@ashokponkumar
Copy link
Member

Lets add a collected cluster with tekton, and we are good to go.

@ashokponkumar
Copy link
Member

@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>
…ress name being the same as the backend service name.

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>
Signed-off-by: Harikrishnan Balagopal <Harikrishnan.Balagopal@ibm.com>
Signed-off-by: Harikrishnan Balagopal <Harikrishnan.Balagopal@ibm.com>
@ashokponkumar ashokponkumar merged commit ebdd1ee into konveyor:master Oct 25, 2020
@HarikrishnanBalagopal HarikrishnanBalagopal deleted the splittekton branch October 25, 2020 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Split the CI/CD pipeline resource set into multiple apiresources
2 participants