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

Add new DevOps agent for Golang 1.16 #32

Merged
merged 1 commit into from
Oct 27, 2021

Conversation

JohnNiang
Copy link
Contributor

What this PR dose?

Add a new pod template for Golang 1.16.

Why we need it?

Please see #28.

Which issue dose this PR fix?

Fix #28

How to test?

  1. Install ks-devops via helm charts
make install-chart
  1. Create a test Pipeline

Pipeline script example:

pipeline {
  agent {
    node {
      label 'go16'
    }
  }
  stages {
    stage('Greet') {
      steps {
        container('go') {
          sh '''go version'''
        }
      }
    }
  }
}

Signed-off-by: John Niang <johnniang@fastmail.com>
@JohnNiang
Copy link
Contributor Author

/kind feature

@JohnNiang
Copy link
Contributor Author

/cc @kubesphere-sigs/sig-devops

Copy link
Member

@AbdelouahabMbarki AbdelouahabMbarki left a comment

Choose a reason for hiding this comment

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

I've left some comments here, nice Job

@@ -427,6 +427,9 @@ Agent:
Golang:
Image: builder-go
Tag: v3.1.0
golang16:
Copy link
Member

Choose a reason for hiding this comment

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

golang16 --> Golang16

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for you patient review!

In fact, helm recommends that variable name should begin with a lowercase letter, and words should be separated with camelcase, please see https://helm.sh/docs/chart_best_practices/values/.

Meanwhile, we have plan to refine other variable names in Jenkins charts, please see issue #26 I've submitted before.


But now, I agree with you to keep the naming style of variable name same with others. I will change them later, and thank you for pointing out this again.

idleMinutes: 0
containers:
- name: "go"
image: "{{ .Values.Agent.Builder.Registry }}/{{ .Values.Agent.Builder.golang16.image }}:{{ .Values.Agent.Builder.golang16.tag }}{{ template "jenkins.agent.variant" . }}"
Copy link
Member

Choose a reason for hiding this comment

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

golang16 -- > Golang16

Copy link
Contributor

@LinuxSuRen LinuxSuRen left a comment

Choose a reason for hiding this comment

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

/lgtm

I have tested manually. The Jenkinsfile is:

pipeline {
  agent {
    label 'go16'
  }
  
  stages{
    stage('test'){
      steps{
        container('go') {
          sh 'go version'
        }
      }
    }
  }
}

Test output:

Running on go16-3w3t7 in /home/jenkins/agent/workspace/my-devops-projectwgvcm/test
[Pipeline] {
[Pipeline] stage
[Pipeline] { (test)
[Pipeline] container
[Pipeline] {
[Pipeline] sh
+ go version
go version go1.16.8 linux/amd64
[Pipeline] }
[Pipeline] // container
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS

@LinuxSuRen LinuxSuRen merged commit 2e8e98d into kubesphere-sigs:master Oct 27, 2021
@JohnNiang JohnNiang deleted the feat/go16 branch October 27, 2021 03:07
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.

Request to add more pod template for newer DevOps agents
3 participants