Skip to content

Commit b29f8d5

Browse files
committed
use v1alpha2
1 parent 948f425 commit b29f8d5

26 files changed

Lines changed: 85 additions & 64 deletions

PROJECT

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ resources:
1515
domain: walnuts.dev
1616
group: cs
1717
kind: CodeServer
18-
path: github.com/walnuts1018/code-server-operator/api/v1alpha1
19-
version: v1alpha1
18+
path: github.com/walnuts1018/code-server-operator/api/v1alpha2
19+
version: v1alpha2
2020
webhooks:
2121
defaulting: true
2222
validation: true
@@ -28,6 +28,6 @@ resources:
2828
domain: walnuts.dev
2929
group: cs
3030
kind: CodeServerDeployment
31-
path: github.com/walnuts1018/code-server-operator/api/v1alpha1
32-
version: v1alpha1
31+
path: github.com/walnuts1018/code-server-operator/api/v1alpha2
32+
version: v1alpha2
3333
version: "3"

Tiltfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ docker_build_with_restart(
4343
)
4444

4545
local_resource(
46-
'Sample', 'kubectl apply -f ./config/samples/cs_v1alpha1_codeserver.yaml',
47-
deps=["./config/samples/cs_v1alpha1_codeserver.yaml"])
46+
'Sample', 'kubectl apply -f ./config/samples/cs_v1alpha2_codeserver.yaml',
47+
deps=["./config/samples/cs_v1alpha2_codeserver.yaml"])
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package v1alpha1
17+
package v1alpha2
1818

1919
import (
2020
corev1 "k8s.io/api/core/v1"
@@ -73,6 +73,9 @@ type CodeServerSpec struct {
7373

7474
// PublicProxyPorts specifies the public proxy ports for code server
7575
PublicProxyPorts []int32 `json:"publicProxyPorts,omitempty"`
76+
77+
//InitCommand specifies the init commands that will be running to finish before code server running.
78+
InitCommand string `json:"initCommands,omitempty"`
7679
}
7780

7881
// CodeServerStatus defines the observed state of CodeServer
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package v1alpha1
17+
package v1alpha2
1818

1919
import (
2020
"k8s.io/apimachinery/pkg/runtime"
@@ -36,7 +36,7 @@ func (r *CodeServer) SetupWebhookWithManager(mgr ctrl.Manager) error {
3636

3737
// TODO(user): EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
3838

39-
//+kubebuilder:webhook:path=/mutate-cs-walnuts-dev-v1alpha1-codeserver,mutating=true,failurePolicy=fail,sideEffects=None,groups=cs.walnuts.dev,resources=codeservers,verbs=create;update,versions=v1alpha1,name=mcodeserver.kb.io,admissionReviewVersions=v1
39+
//+kubebuilder:webhook:path=/mutate-cs-walnuts-dev-v1alpha2-codeserver,mutating=true,failurePolicy=fail,sideEffects=None,groups=cs.walnuts.dev,resources=codeservers,verbs=create;update,versions=v1alpha2,name=mcodeserver.kb.io,admissionReviewVersions=v1
4040

4141
var _ webhook.Defaulter = &CodeServer{}
4242

@@ -48,7 +48,7 @@ func (r *CodeServer) Default() {
4848
}
4949

5050
// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
51-
//+kubebuilder:webhook:path=/validate-cs-walnuts-dev-v1alpha1-codeserver,mutating=false,failurePolicy=fail,sideEffects=None,groups=cs.walnuts.dev,resources=codeservers,verbs=create;update,versions=v1alpha1,name=vcodeserver.kb.io,admissionReviewVersions=v1
51+
//+kubebuilder:webhook:path=/validate-cs-walnuts-dev-v1alpha2-codeserver,mutating=false,failurePolicy=fail,sideEffects=None,groups=cs.walnuts.dev,resources=codeservers,verbs=create;update,versions=v1alpha2,name=vcodeserver.kb.io,admissionReviewVersions=v1
5252

5353
var _ webhook.Validator = &CodeServer{}
5454

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package v1alpha1
17+
package v1alpha2
1818

1919
import (
2020
. "github.com/onsi/ginkgo/v2"

api/v1alpha1/codeserverdeployment_types.go renamed to api/v1alpha2/codeserverdeployment_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package v1alpha1
17+
package v1alpha2
1818

1919
import (
2020
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
// Package v1alpha1 contains API Schema definitions for the cs v1alpha1 API group
17+
// Package v1alpha2 contains API Schema definitions for the cs v1alpha2 API group
1818
// +kubebuilder:object:generate=true
1919
// +groupName=cs.walnuts.dev
20-
package v1alpha1
20+
package v1alpha2
2121

2222
import (
2323
"k8s.io/apimachinery/pkg/runtime/schema"
@@ -26,7 +26,7 @@ import (
2626

2727
var (
2828
// GroupVersion is group version used to register these objects
29-
GroupVersion = schema.GroupVersion{Group: "cs.walnuts.dev", Version: "v1alpha1"}
29+
GroupVersion = schema.GroupVersion{Group: "cs.walnuts.dev", Version: "v1alpha2"}
3030

3131
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
3232
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package v1alpha1
17+
package v1alpha2
1818

1919
import (
2020
"context"
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/code-server-operator/crds/codeserver-crd.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ spec:
3333
jsonPath: .spec.storageSize
3434
name: STORAGE
3535
type: string
36-
name: v1alpha1
36+
name: v1alpha2
3737
schema:
3838
openAPIV3Schema:
3939
description: CodeServer is the Schema for the codeservers API
@@ -203,6 +203,10 @@ spec:
203203
type: array
204204
ingressClassName:
205205
type: string
206+
initCommands:
207+
description: InitCommand specifies the init commands that will be
208+
running to finish before code server running.
209+
type: string
206210
initPlugins:
207211
additionalProperties:
208212
additionalProperties:

0 commit comments

Comments
 (0)