Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
Rename references to gitops toolkit instead of ignite
Browse files Browse the repository at this point in the history
  • Loading branch information
luxas committed Aug 19, 2019
1 parent bffa3c4 commit b47252b
Show file tree
Hide file tree
Showing 25 changed files with 122 additions and 116 deletions.
2 changes: 1 addition & 1 deletion cmd/ignite-spawn/ignite-spawn.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import (
"path"

log "github.com/sirupsen/logrus"
patchutil "github.com/weaveworks/gitops-toolkit/pkg/util/patch"
api "github.com/weaveworks/ignite/pkg/apis/ignite"
"github.com/weaveworks/ignite/pkg/apis/ignite/scheme"
"github.com/weaveworks/ignite/pkg/constants"
"github.com/weaveworks/ignite/pkg/container"
dmcleanup "github.com/weaveworks/ignite/pkg/dmlegacy/cleanup"
"github.com/weaveworks/ignite/pkg/prometheus"
patchutil "github.com/weaveworks/ignite/pkg/util/patch"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/ignite/run/helpers.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package run

import (
"github.com/weaveworks/gitops-toolkit/pkg/filter"
api "github.com/weaveworks/ignite/pkg/apis/ignite"
"github.com/weaveworks/ignite/pkg/filter"
"github.com/weaveworks/ignite/pkg/providers"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/ignite/run/images.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package run

import (
"github.com/weaveworks/gitops-toolkit/pkg/filter"
api "github.com/weaveworks/ignite/pkg/apis/ignite"
"github.com/weaveworks/ignite/pkg/filter"
"github.com/weaveworks/ignite/pkg/providers"
"github.com/weaveworks/ignite/pkg/util"
)
Expand Down
8 changes: 4 additions & 4 deletions cmd/ignite/run/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"fmt"
"strings"

"github.com/weaveworks/gitops-toolkit/pkg/filter"
"github.com/weaveworks/gitops-toolkit/pkg/runtime"
api "github.com/weaveworks/ignite/pkg/apis/ignite"
"github.com/weaveworks/ignite/pkg/apis/ignite/scheme"
meta "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1"
"github.com/weaveworks/ignite/pkg/filter"
"github.com/weaveworks/ignite/pkg/providers"
)

Expand All @@ -18,12 +18,12 @@ type InspectFlags struct {

type inspectOptions struct {
*InspectFlags
object meta.Object
object runtime.Object
}

func (i *InspectFlags) NewInspectOptions(k, objectMatch string) (*inspectOptions, error) {
var err error
var kind meta.Kind
var kind runtime.Kind
io := &inspectOptions{InspectFlags: i}

switch strings.ToLower(k) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/ignite/run/kernels.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package run

import (
"github.com/weaveworks/gitops-toolkit/pkg/filter"
api "github.com/weaveworks/ignite/pkg/apis/ignite"
"github.com/weaveworks/ignite/pkg/filter"
"github.com/weaveworks/ignite/pkg/providers"
"github.com/weaveworks/ignite/pkg/util"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/ignite/run/rmi.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"os"

log "github.com/sirupsen/logrus"
"github.com/weaveworks/gitops-toolkit/pkg/filter"
api "github.com/weaveworks/ignite/pkg/apis/ignite"
"github.com/weaveworks/ignite/pkg/filter"
"github.com/weaveworks/ignite/pkg/operations/lookup"
"github.com/weaveworks/ignite/pkg/providers"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/ignite/run/rmk.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"os"

log "github.com/sirupsen/logrus"
"github.com/weaveworks/gitops-toolkit/pkg/filter"
api "github.com/weaveworks/ignite/pkg/apis/ignite"
"github.com/weaveworks/ignite/pkg/filter"
"github.com/weaveworks/ignite/pkg/operations/lookup"
"github.com/weaveworks/ignite/pkg/providers"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/ignite/scheme/scheme.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
k8sserializer "k8s.io/apimachinery/pkg/runtime/serializer"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"

"github.com/weaveworks/gitops-toolkit/pkg/serializer"
"github.com/weaveworks/ignite/pkg/apis/ignite"
"github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1"
"github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha2"
"github.com/weaveworks/ignite/pkg/serializer"
)

var (
Expand Down
31 changes: 16 additions & 15 deletions pkg/apis/ignite/types.go
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
package ignite

import (
"github.com/weaveworks/gitops-toolkit/pkg/runtime"
meta "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1"
)

const (
KindImage meta.Kind = "Image"
KindKernel meta.Kind = "Kernel"
KindVM meta.Kind = "VM"
KindImage runtime.Kind = "Image"
KindKernel runtime.Kind = "Kernel"
KindVM runtime.Kind = "VM"
)

// Image represents a cached OCI image ready to be used with Ignite
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type Image struct {
meta.TypeMeta `json:",inline"`
// meta.ObjectMeta is also embedded into the struct, and defines the human-readable name, and the machine-readable ID
runtime.TypeMeta `json:",inline"`
// runtime.ObjectMeta is also embedded into the struct, and defines the human-readable name, and the machine-readable ID
// Name is available at the .metadata.name JSON path
// ID is available at the .metadata.uid JSON path (the Go type is k8s.io/apimachinery/pkg/types.UID, which is only a typed string)
meta.ObjectMeta `json:"metadata"`
runtime.ObjectMeta `json:"metadata"`

Spec ImageSpec `json:"spec"`
Status ImageStatus `json:"status"`
Expand Down Expand Up @@ -48,9 +49,9 @@ type ImageStatus struct {
// is present at /var/lib/firecracker/snapshotter/pool.json
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type Pool struct {
meta.TypeMeta `json:",inline"`
runtime.TypeMeta `json:",inline"`
// Not needed (yet)
// meta.ObjectMeta `json:"metadata"`
// runtime.ObjectMeta `json:"metadata"`

Spec PoolSpec `json:"spec"`
Status PoolStatus `json:"status"`
Expand Down Expand Up @@ -103,11 +104,11 @@ type PoolDevice struct {
// This file is stored in /var/lib/firecracker/kernels/{oci-image-digest}/metadata.json
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type Kernel struct {
meta.TypeMeta `json:",inline"`
// meta.ObjectMeta is also embedded into the struct, and defines the human-readable name, and the machine-readable ID
runtime.TypeMeta `json:",inline"`
// runtime.ObjectMeta is also embedded into the struct, and defines the human-readable name, and the machine-readable ID
// Name is available at the .metadata.name JSON path
// ID is available at the .metadata.uid JSON path (the Go type is k8s.io/apimachinery/pkg/types.UID, which is only a typed string)
meta.ObjectMeta `json:"metadata"`
runtime.ObjectMeta `json:"metadata"`

Spec KernelSpec `json:"spec"`
Status KernelStatus `json:"status"`
Expand All @@ -130,11 +131,11 @@ type KernelStatus struct {
// These files are stored in /var/lib/firecracker/vm/{vm-id}/metadata.json
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type VM struct {
meta.TypeMeta `json:",inline"`
// meta.ObjectMeta is also embedded into the struct, and defines the human-readable name, and the machine-readable ID
runtime.TypeMeta `json:",inline"`
// runtime.ObjectMeta is also embedded into the struct, and defines the human-readable name, and the machine-readable ID
// Name is available at the .metadata.name JSON path
// ID is available at the .metadata.uid JSON path (the Go type is k8s.io/apimachinery/pkg/types.UID, which is only a typed string)
meta.ObjectMeta `json:"metadata"`
runtime.ObjectMeta `json:"metadata"`

Spec VMSpec `json:"spec"`
Status VMStatus `json:"status"`
Expand Down Expand Up @@ -225,7 +226,7 @@ type Runtime struct {
type VMStatus struct {
Running bool `json:"running"`
Runtime *Runtime `json:"runtime,omitempty"`
StartTime *meta.Time `json:"startTime,omitempty"`
StartTime *runtime.Time `json:"startTime,omitempty"`
IPAddresses meta.IPAddresses `json:"ipAddresses,omitempty"`
Image OCIImageSource `json:"image"`
Kernel OCIImageSource `json:"kernel"`
Expand Down
29 changes: 15 additions & 14 deletions pkg/apis/ignite/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,24 @@ package v1alpha1
import (
"fmt"

"github.com/weaveworks/gitops-toolkit/pkg/runtime"
meta "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1"
)

const (
KindImage meta.Kind = "Image"
KindKernel meta.Kind = "Kernel"
KindVM meta.Kind = "VM"
KindImage runtime.Kind = "Image"
KindKernel runtime.Kind = "Kernel"
KindVM runtime.Kind = "VM"
)

// Image represents a cached OCI image ready to be used with Ignite
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type Image struct {
meta.TypeMeta `json:",inline"`
// meta.ObjectMeta is also embedded into the struct, and defines the human-readable name, and the machine-readable ID
runtime.TypeMeta `json:",inline"`
// runtime.ObjectMeta is also embedded into the struct, and defines the human-readable name, and the machine-readable ID
// Name is available at the .metadata.name JSON path
// ID is available at the .metadata.uid JSON path (the Go type is k8s.io/apimachinery/pkg/types.UID, which is only a typed string)
meta.ObjectMeta `json:"metadata"`
runtime.ObjectMeta `json:"metadata"`

Spec ImageSpec `json:"spec"`
Status ImageStatus `json:"status"`
Expand Down Expand Up @@ -75,9 +76,9 @@ type ImageStatus struct {
// is present at /var/lib/firecracker/snapshotter/pool.json
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type Pool struct {
meta.TypeMeta `json:",inline"`
runtime.TypeMeta `json:",inline"`
// Not needed (yet)
// meta.ObjectMeta `json:"metadata"`
// runtime.ObjectMeta `json:"metadata"`

Spec PoolSpec `json:"spec"`
Status PoolStatus `json:"status"`
Expand Down Expand Up @@ -130,11 +131,11 @@ type PoolDevice struct {
// This file is stored in /var/lib/firecracker/kernels/{oci-image-digest}/metadata.json
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type Kernel struct {
meta.TypeMeta `json:",inline"`
// meta.ObjectMeta is also embedded into the struct, and defines the human-readable name, and the machine-readable ID
runtime.TypeMeta `json:",inline"`
// runtime.ObjectMeta is also embedded into the struct, and defines the human-readable name, and the machine-readable ID
// Name is available at the .metadata.name JSON path
// ID is available at the .metadata.uid JSON path (the Go type is k8s.io/apimachinery/pkg/types.UID, which is only a typed string)
meta.ObjectMeta `json:"metadata"`
runtime.ObjectMeta `json:"metadata"`

Spec KernelSpec `json:"spec"`
Status KernelStatus `json:"status"`
Expand All @@ -157,11 +158,11 @@ type KernelStatus struct {
// These files are stored in /var/lib/firecracker/vm/{vm-id}/metadata.json
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type VM struct {
meta.TypeMeta `json:",inline"`
// meta.ObjectMeta is also embedded into the struct, and defines the human-readable name, and the machine-readable ID
runtime.TypeMeta `json:",inline"`
// runtime.ObjectMeta is also embedded into the struct, and defines the human-readable name, and the machine-readable ID
// Name is available at the .metadata.name JSON path
// ID is available at the .metadata.uid JSON path (the Go type is k8s.io/apimachinery/pkg/types.UID, which is only a typed string)
meta.ObjectMeta `json:"metadata"`
runtime.ObjectMeta `json:"metadata"`

Spec VMSpec `json:"spec"`
Status VMStatus `json:"status"`
Expand Down
31 changes: 16 additions & 15 deletions pkg/apis/ignite/v1alpha2/types.go
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
package v1alpha2

import (
"github.com/weaveworks/gitops-toolkit/pkg/runtime"
meta "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1"
)

const (
KindImage meta.Kind = "Image"
KindKernel meta.Kind = "Kernel"
KindVM meta.Kind = "VM"
KindImage runtime.Kind = "Image"
KindKernel runtime.Kind = "Kernel"
KindVM runtime.Kind = "VM"
)

// Image represents a cached OCI image ready to be used with Ignite
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type Image struct {
meta.TypeMeta `json:",inline"`
// meta.ObjectMeta is also embedded into the struct, and defines the human-readable name, and the machine-readable ID
runtime.TypeMeta `json:",inline"`
// runtime.ObjectMeta is also embedded into the struct, and defines the human-readable name, and the machine-readable ID
// Name is available at the .metadata.name JSON path
// ID is available at the .metadata.uid JSON path (the Go type is k8s.io/apimachinery/pkg/types.UID, which is only a typed string)
meta.ObjectMeta `json:"metadata"`
runtime.ObjectMeta `json:"metadata"`

Spec ImageSpec `json:"spec"`
Status ImageStatus `json:"status"`
Expand Down Expand Up @@ -48,9 +49,9 @@ type ImageStatus struct {
// is present at /var/lib/firecracker/snapshotter/pool.json
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type Pool struct {
meta.TypeMeta `json:",inline"`
runtime.TypeMeta `json:",inline"`
// Not needed (yet)
// meta.ObjectMeta `json:"metadata"`
// runtime.ObjectMeta `json:"metadata"`

Spec PoolSpec `json:"spec"`
Status PoolStatus `json:"status"`
Expand Down Expand Up @@ -103,11 +104,11 @@ type PoolDevice struct {
// This file is stored in /var/lib/firecracker/kernels/{oci-image-digest}/metadata.json
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type Kernel struct {
meta.TypeMeta `json:",inline"`
// meta.ObjectMeta is also embedded into the struct, and defines the human-readable name, and the machine-readable ID
runtime.TypeMeta `json:",inline"`
// runtime.ObjectMeta is also embedded into the struct, and defines the human-readable name, and the machine-readable ID
// Name is available at the .metadata.name JSON path
// ID is available at the .metadata.uid JSON path (the Go type is k8s.io/apimachinery/pkg/types.UID, which is only a typed string)
meta.ObjectMeta `json:"metadata"`
runtime.ObjectMeta `json:"metadata"`

Spec KernelSpec `json:"spec"`
Status KernelStatus `json:"status"`
Expand All @@ -130,11 +131,11 @@ type KernelStatus struct {
// These files are stored in /var/lib/firecracker/vm/{vm-id}/metadata.json
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type VM struct {
meta.TypeMeta `json:",inline"`
// meta.ObjectMeta is also embedded into the struct, and defines the human-readable name, and the machine-readable ID
runtime.TypeMeta `json:",inline"`
// runtime.ObjectMeta is also embedded into the struct, and defines the human-readable name, and the machine-readable ID
// Name is available at the .metadata.name JSON path
// ID is available at the .metadata.uid JSON path (the Go type is k8s.io/apimachinery/pkg/types.UID, which is only a typed string)
meta.ObjectMeta `json:"metadata"`
runtime.ObjectMeta `json:"metadata"`

Spec VMSpec `json:"spec"`
Status VMStatus `json:"status"`
Expand Down Expand Up @@ -225,7 +226,7 @@ type Runtime struct {
type VMStatus struct {
Running bool `json:"running"`
Runtime *Runtime `json:"runtime,omitempty"`
StartTime *meta.Time `json:"startTime,omitempty"`
StartTime *runtime.Time `json:"startTime,omitempty"`
IPAddresses meta.IPAddresses `json:"ipAddresses,omitempty"`
Image OCIImageSource `json:"image"`
Kernel OCIImageSource `json:"kernel"`
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/meta/v1alpha1/size.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"github.com/c2h5oh/datasize"
)

const sectorSize = 512

// Size specifies a common unit for data sizes
type Size struct {
datasize.ByteSize
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ VM with a new IP address:
package client

import (
"github.com/weaveworks/gitops-toolkit/pkg/storage"
api "github.com/weaveworks/ignite/pkg/apis/ignite"
"github.com/weaveworks/ignite/pkg/storage"

"k8s.io/apimachinery/pkg/runtime/schema"
)
Expand Down
Loading

0 comments on commit b47252b

Please sign in to comment.