-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This deals with creation, update, removal of clusters from the AKS provider. Co-authored-by: Kevin McDermott <kevin@weave.works>
- Loading branch information
Showing
18 changed files
with
1,316 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Steps before release of the AKS reflector | ||
|
||
- [ ] Secret does not exist but cluster exists - Create a new secret | ||
- [ ] Partial apply of clusters - ensure that subsequent reconciliations work | ||
- [ ] Add managed-by labels! | ||
- [ ] Conditions - ready with count of reflected clusters | ||
- [ ] Events - publish when cluster created or removed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package v1alpha1 | ||
|
||
import ( | ||
"fmt" | ||
|
||
runtime "k8s.io/apimachinery/pkg/runtime" | ||
"sigs.k8s.io/cli-utils/pkg/object" | ||
) | ||
|
||
// ResourceInventory contains a list of Kubernetes resource object references that have been applied by a Kustomization. | ||
type ResourceInventory struct { | ||
// Entries of Kubernetes resource object references. | ||
Entries []ResourceRef `json:"entries,omitempty"` | ||
} | ||
|
||
// ResourceRef contains the information necessary to locate a resource within a cluster. | ||
type ResourceRef struct { | ||
// ID is the string representation of the Kubernetes resource object's metadata, | ||
// in the format '<namespace>_<name>_<group>_<kind>'. | ||
ID string `json:"id"` | ||
|
||
// Version is the API version of the Kubernetes resource object's kind. | ||
Version string `json:"v"` | ||
} | ||
|
||
// ResourceRefFromObject returns a ResourceRef from a runtime.Object. | ||
func ResourceRefFromObject(obj runtime.Object) (ResourceRef, error) { | ||
objMeta, err := object.RuntimeToObjMeta(obj) | ||
if err != nil { | ||
return ResourceRef{}, fmt.Errorf("failed to parse object Metadata: %w", err) | ||
} | ||
|
||
return ResourceRef{ | ||
ID: objMeta.String(), | ||
Version: obj.GetObjectKind().GroupVersionKind().Version, | ||
}, nil | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.