Skip to content

Instantly share code, notes, and snippets.

@nmathew
Created August 10, 2022 04:59
Show Gist options
  • Select an option

  • Save nmathew/8116c0cc21d8fcde4badf0dc22b14f4b to your computer and use it in GitHub Desktop.

Select an option

Save nmathew/8116c0cc21d8fcde4badf0dc22b14f4b to your computer and use it in GitHub Desktop.
/home/ubuntu/go/pkg/mod/k8s.io/[email protected]/generate-groups.sh all pkg/client apis "v1" -o ./ -h hack/boilerplate.go.txt -v 10
Generating deepcopy funcs
I0810 04:51:53.617759 26809 main.go:82] Completed successfully.
Generating clientset for v1 at pkg/client/clientset
I0810 04:51:53.645477 26829 execute.go:217] Processing package "versioned", disk location "pkg/client/clientset/versioned"
I0810 04:51:53.645708 26829 execute.go:67] Assembling file "pkg/client/clientset/versioned/doc.go"
I0810 04:51:53.646813 26829 execute.go:67] Assembling file "pkg/client/clientset/versioned/clientset.go"
I0810 04:51:53.647095 26829 execute.go:217] Processing package "scheme", disk location "pkg/client/clientset/versioned/scheme"
I0810 04:51:53.647315 26829 execute.go:67] Assembling file "pkg/client/clientset/versioned/scheme/doc.go"
I0810 04:51:53.647636 26829 execute.go:67] Assembling file "pkg/client/clientset/versioned/scheme/register.go"
I0810 04:51:53.647934 26829 execute.go:217] Processing package "fake", disk location "pkg/client/clientset/versioned/fake"
I0810 04:51:53.648112 26829 execute.go:67] Assembling file "pkg/client/clientset/versioned/fake/register.go"
I0810 04:51:53.648425 26829 execute.go:67] Assembling file "pkg/client/clientset/versioned/fake/doc.go"
I0810 04:51:53.648701 26829 execute.go:67] Assembling file "pkg/client/clientset/versioned/fake/clientset_generated.go"
Generating listers for v1 at pkg/client/listers
I0810 04:51:53.682926 26850 main.go:57] Completed successfully.
Generating informers for v1 at pkg/client/informers
I0810 04:51:53.717289 26871 main.go:60] Completed successfully.
ubuntu in ubuntuvmlarge in ~/mnt1/ptp-clientset via 🐹 v1.17.6
❯ ls
api boilerplate.go.txt go.mod go.sum hack pkg
ubuntu in ubuntuvmlarge in ~/mnt1/ptp-clientset via 🐹 v1.17.6
ubuntu in ubuntuvmlarge in ~/mnt1/ptp-clientset via 🐹 v1.17.6
❯ tree
.
├── api
│   └── v1
│   ├── groupversion_info.go
│   ├── nodeptpdevice_types.go
│   ├── ptpconfig_types.go
│   └── ptpoperatorconfig_types.go
├── boilerplate.go.txt
├── go.mod
├── go.sum
├── hack
│   └── boilerplate.go.txt
└── pkg
└── client
└── clientset
└── versioned
├── clientset.go
├── doc.go
├── fake
│   ├── clientset_generated.go
│   ├── doc.go
│   └── register.go
└── scheme
├── doc.go
└── register.go
9 directories, 15 files
ubuntu in ubuntuvmlarge in ~/mnt1/ptp-clientset via 🐹 v1.17.6
ubuntu in ubuntuvmlarge in ~/mnt1/ptp-clientset via 🐹 v1.17.6
❯ cat pkg/client/clientset/versioned/clientset.go
/*
Copyright 2021.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package versioned
ubuntu in ubuntuvmlarge in ~/mnt1/ptp-clientset via 🐹 v1.17.6
##Type Files
ubuntu in ubuntuvmlarge in ~/mnt1/ptp-clientset via 🐹 v1.17.6
❯ cat api/v1/groupversion_info.go
/*
Copyright 2022.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Package v1 contains API Schema definitions for the ccd v1 API group
// +groupName=ccd.aws.com
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
package v1
import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)
var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "ccd.aws.com", Version: "v1"}
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
)
ubuntu in ubuntuvmlarge in ~/mnt1/ptp-clientset via 🐹 v1.17.6
ubuntu in ubuntuvmlarge in ~/mnt1/ptp-clientset via 🐹 v1.17.6
❯ cat api/v1/ptpconfig_types.go
/*
Copyright 2022.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// PtpConfigSpec defines the desired state of PtpConfig
type PtpConfigSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
Profile []PtpProfile `json:"profile"`
Recommend []PtpRecommend `json:"recommend"`
}
// PtpConfigStatus defines the observed state of PtpConfig
type PtpConfigStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
MatchList []NodeMatchList `json:"matchList,omitempty"`
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// PtpConfig is the Schema for the ptpconfigs API
type PtpConfig struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec PtpConfigSpec `json:"spec,omitempty"`
Status PtpConfigStatus `json:"status,omitempty"`
}
// PtpConfigList contains a list of PtpConfig
type PtpConfigList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []PtpConfig `json:"items"`
}
type PtpProfile struct {
Name *string `json:"name"`
Interface *string `json:"interface,omitempty"`
Ptp4lOpts *string `json:"ptp4lOpts,omitempty"`
Phc2sysOpts *string `json:"phc2sysOpts,omitempty"`
Ptp4lConf *string `json:"ptp4lConf,omitempty"`
PtpSchedulingPolicy *string `json:"ptpSchedulingPolicy,omitempty"`
PtpSchedulingPriority *int64 `json:"ptpSchedulingPriority,omitempty"`
PtpClockThreshold *PtpClockThreshold `json:"ptpClockThreshold,omitempty"`
}
type PtpClockThreshold struct {
// clock state to stay in holdover state in secs
HoldOverTimeout int64 `json:"holdOverTimeout,omitempty"`
// max offset in nano secs
MaxOffsetThreshold int64 `json:"maxOffsetThreshold,omitempty"`
// min offset in nano secs
MinOffsetThreshold int64 `json:"minOffsetThreshold,omitempty"`
}
type PtpRecommend struct {
Profile *string `json:"profile"`
Priority *int64 `json:"priority"`
Match []MatchRule `json:"match,omitempty"`
}
type MatchRule struct {
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
NodeName *string `json:"nodeName,omitempty"`
}
type NodeMatchList struct {
NodeName *string `json:"nodeName"`
Profile *string `json:"profile"`
}
func init() {
SchemeBuilder.Register(&PtpConfig{}, &PtpConfigList{})
}
ubuntu in ubuntuvmlarge in ~/mnt1/ptp-clientset via 🐹 v1.17.6
ubuntu in ubuntuvmlarge in ~/mnt1/ptp-clientset via 🐹 v1.17.6
❯ cat api/v1/ptpoperatorconfig_types.go
/*
Copyright 2022.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// PtpOperatorConfigSpec defines the desired state of PtpOperatorConfig
type PtpOperatorConfigSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
Affinity *corev1.Affinity `json:"affinity,omitempty"`
// EventConfig to configure event sidecar
EventConfig *PtpEventConfig `json:"ptpEventConfig,omitempty"`
}
// PtpOperatorConfigStatus defines the observed state of PtpOperatorConfig
type PtpOperatorConfigStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// PtpOperatorConfig is the Schema for the ptpoperatorconfigs API
type PtpOperatorConfig struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec PtpOperatorConfigSpec `json:"spec,omitempty"`
Status PtpOperatorConfigStatus `json:"status,omitempty"`
}
// PtpOperatorConfigList contains a list of PtpOperatorConfig
type PtpOperatorConfigList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []PtpOperatorConfig `json:"items"`
}
// PtpEventConfig defines the desired state of event framework
type PtpEventConfig struct {
// EnableEventPublisher will deploy event proxy as a sidecar
EnableEventPublisher bool `json:"enableEventPublisher,omitempty"`
// transportHost address for event messages. Example amqp://<service-name>.<namespace>.scv.cluster.local
TransportHost string `json:"transportHost,omitempty"`
}
func init() {
SchemeBuilder.Register(&PtpOperatorConfig{}, &PtpOperatorConfigList{})
}
ubuntu in ubuntuvmlarge in ~/mnt1/ptp-clientset via 🐹 v1.17.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment