Skip to content

Commit

Permalink
renamed module location to github.com, working on plan resource
Browse files Browse the repository at this point in the history
  • Loading branch information
meshuga committed Sep 15, 2024
1 parent a674cfc commit ef63576
Show file tree
Hide file tree
Showing 56 changed files with 929 additions and 133 deletions.
3 changes: 3 additions & 0 deletions artifacts/deployment/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ rules:
- apiGroups: ["apiextensions.k8s.io"]
resources: ['customresourcedefinitions']
verbs: ['list', 'watch', 'create', 'update', 'delete']
- apiGroups: ["*.hykube.io"]
resources: ['*']
verbs: ['list']
1 change: 1 addition & 0 deletions docs/local-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ Once the provider is ready, you can add a test AWS S3 bucket:

```shell
kubectl create -f artifacts/aws-test/s3-bucket.yaml
kubectl delete -f artifacts/aws-test/s3-bucket.yaml
# aws-s3-bucket.aws.hykube.io/test-bucket created
```

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module hykube.io/apiserver
module github.com/infrapot/hykube

go 1.22.0

Expand Down
4 changes: 2 additions & 2 deletions hack/build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ source "${KUBE_ROOT}/hack/lib/util.sh"

# Register function to be called on EXIT to remove generated binary.
function cleanup {
rm "${KUBE_ROOT}/staging/src/hykube.io/apiserver/artifacts/simple-image/kube-sample-apiserver"
rm "${KUBE_ROOT}/staging/src/github.com/infrapot/hykube/artifacts/simple-image/kube-sample-apiserver"
}
trap cleanup EXIT

pushd "${KUBE_ROOT}/staging/src/hykube.io/apiserver"
pushd "${KUBE_ROOT}/staging/src/github.com/infrapot/hykube"
cp -v ../../../../_output/local/bin/linux/amd64/sample-apiserver ./artifacts/simple-image/kube-sample-apiserver
docker build -t kube-sample-apiserver:latest ./artifacts/simple-image
popd
2 changes: 1 addition & 1 deletion hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-

source "${CODEGEN_PKG}/kube_codegen.sh"

THIS_PKG="hykube.io/apiserver"
THIS_PKG="github.com/infrapot/hykube"
API_KNOWN_VIOLATIONS_DIR="${SCRIPT_ROOT}/hack"

kube::codegen::gen_helpers \
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package main
import (
"os"

"hykube.io/apiserver/pkg/cmd/server"
"github.com/infrapot/hykube/pkg/cmd/server"
genericapiserver "k8s.io/apiserver/pkg/server"
"k8s.io/component-base/cli"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/admission/hykubeinitializer/hykubeinitializer.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package hykubeinitializer

import (
informers "hykube.io/apiserver/pkg/generated/informers/externalversions"
informers "github.com/infrapot/hykube/pkg/generated/informers/externalversions"
"k8s.io/apiserver/pkg/admission"
)

Expand Down
6 changes: 3 additions & 3 deletions pkg/admission/hykubeinitializer/hykubeinitializer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (
"testing"
"time"

"hykube.io/apiserver/pkg/admission/hykubeinitializer"
"hykube.io/apiserver/pkg/generated/clientset/versioned/fake"
informers "hykube.io/apiserver/pkg/generated/informers/externalversions"
"github.com/infrapot/hykube/pkg/admission/hykubeinitializer"
"github.com/infrapot/hykube/pkg/generated/clientset/versioned/fake"
informers "github.com/infrapot/hykube/pkg/generated/informers/externalversions"
"k8s.io/apiserver/pkg/admission"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/admission/hykubeinitializer/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package hykubeinitializer

import (
informers "hykube.io/apiserver/pkg/generated/informers/externalversions"
informers "github.com/infrapot/hykube/pkg/generated/informers/externalversions"
"k8s.io/apiserver/pkg/admission"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/hykube/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
// +groupName=hykube.io

// Package hykube is the internal version of the API.
package hykube // import "hykube.io/apiserver/pkg/apis/hykube"
package hykube // import "github.com/infrapot/hykube/pkg/apis/hykube"
2 changes: 1 addition & 1 deletion pkg/apis/hykube/fuzzer/fuzzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ package fuzzer

import (
fuzz "github.com/google/gofuzz"
"hykube.io/apiserver/pkg/apis/hykube"
"github.com/infrapot/hykube/pkg/apis/hykube"
runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/hykube/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
package install

import (
"hykube.io/apiserver/pkg/apis/hykube"
"hykube.io/apiserver/pkg/apis/hykube/v1alpha1"
"github.com/infrapot/hykube/pkg/apis/hykube"
"github.com/infrapot/hykube/pkg/apis/hykube/v1alpha1"
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/hykube/install/roundtrip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ package install
import (
"testing"

hykubefuzzer "hykube.io/apiserver/pkg/apis/hykube/fuzzer"
hykubefuzzer "github.com/infrapot/hykube/pkg/apis/hykube/fuzzer"
"k8s.io/apimachinery/pkg/api/apitesting/roundtrip"
)

Expand Down
3 changes: 3 additions & 0 deletions pkg/apis/hykube/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&Provider{},
&ProviderList{},

&Plan{},
&PlanList{},
)
return nil
}
26 changes: 26 additions & 0 deletions pkg/apis/hykube/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,29 @@ type Provider struct {
Status string
Filename string
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// PlanList is a list of Plan objects.
type PlanList struct {
metav1.TypeMeta
metav1.ListMeta

Items []Plan
}

// PlanSpec is the specification of a Provider.
type PlanSpec struct {
// TODO provider specific configuration
}

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

type Plan struct {
metav1.TypeMeta
metav1.ObjectMeta

Spec PlanSpec
Status string
}
2 changes: 1 addition & 1 deletion pkg/apis/hykube/v1alpha1/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
package v1alpha1

import (
"hykube.io/apiserver/pkg/apis/hykube"
"github.com/infrapot/hykube/pkg/apis/hykube"
"k8s.io/apimachinery/pkg/conversion"
)

Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/hykube/v1alpha1/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ func addDefaultingFuncs(scheme *runtime.Scheme) error {
func SetDefaults_ProviderSpec(obj *ProviderSpec) {

}

// SetDefaults_PlanSpec sets defaults for Plan spec
func SetDefaults_PlanSpec(p *PlanSpec) {

}
4 changes: 2 additions & 2 deletions pkg/apis/hykube/v1alpha1/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html

// +k8s:openapi-gen=true
// +k8s:deepcopy-gen=package
// +k8s:conversion-gen=hykube.io/apiserver/pkg/apis/hykube
// +k8s:conversion-gen=github.com/infrapot/hykube/pkg/apis/hykube
// +k8s:defaulter-gen=TypeMeta
// +k8s:prerelease-lifecycle-gen=true
// +groupName=hykube.io

// Package v1alpha1 is the v1alpha1 version of the API.
package v1alpha1 // import "hykube.io/apiserver/pkg/apis/hykube/v1alpha1"
package v1alpha1 // import "github.com/infrapot/hykube/pkg/apis/hykube/v1alpha1"
3 changes: 3 additions & 0 deletions pkg/apis/hykube/v1alpha1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&Provider{},
&ProviderList{},

&Plan{},
&PlanList{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
Expand Down
31 changes: 31 additions & 0 deletions pkg/apis/hykube/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,34 @@ type Provider struct {
Status string `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
Filename string `json:"filename,omitempty" protobuf:"bytes,4,opt,name=filename"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:prerelease-lifecycle-gen:introduced=1.0
// +k8s:prerelease-lifecycle-gen:removed=1.10

// PlanList is a list of Plan objects.
type PlanList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`

Items []Plan `json:"items" protobuf:"bytes,2,rep,name=items"`
}

type PlanSpec struct {
}

type PlanStatus struct {
}

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:prerelease-lifecycle-gen:introduced=1.0
// +k8s:prerelease-lifecycle-gen:removed=1.10

type Plan struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`

Spec PlanSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
Status string `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}
100 changes: 99 additions & 1 deletion pkg/apis/hykube/v1alpha1/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ef63576

Please sign in to comment.